@@ -188,7 +188,8 @@ def parse_mergefile
188188 def merge ( merged_framework_name , group_contents , podfile_info )
189189 Pod ::UI . puts "Preparing to Merge: #{ merged_framework_name } "
190190
191- pods_to_merge = group_contents [ 'titles' ]
191+ # Replace the Subspecs notation (e.g AppAuth/Core) for `AppAuth` only as the folder AppAuth/Core would not exist
192+ pods_to_merge = group_contents [ 'titles' ] . map { |pod_name | pod_name . sub /(\/ [a-zA-Z]+)/ , '' } . uniq
192193 flags = group_contents [ 'flags' ]
193194 forced_swift_language_version = group_contents [ 'swift_version' ]
194195 platforms_in_target = group_contents [ 'platforms' ]
@@ -231,7 +232,7 @@ def merge(merged_framework_name, group_contents, podfile_info)
231232 FileUtils . mkdir ( "#{ InstallationDirectory } /#{ merged_framework_name } /Sources" )
232233
233234 Pod ::UI . puts 'Merging Pods' . cyan
234- pods_to_merge . each do |pod |
235+ pods_to_merge . each_with_index do |pod , index |
235236 # Capture all resources to specify in the final podspec
236237 Pod ::UI . puts "\t #{ pod . cyan } "
237238
@@ -293,8 +294,13 @@ def merge(merged_framework_name, group_contents, podfile_info)
293294
294295 # Read each pod's podspec, and collect configuration for the final merged podspec
295296 Pod ::UI . puts "\t \t Extracting Detailed Podspecs" . magenta
297+
298+ # The originals pods name with the subspecs from the MergeFile. The subspecs are renamed to
299+ # PodspecName_Subspec instead of PodspecName/Subspec
300+ pods_to_merge_with_subspecs = group_contents [ 'titles' ] . map { |pod_name | pod_name . sub '/' , '_' }
301+
296302 Dir . chdir ( "#{ CacheDirectory } /Podspecs" ) do
297- info = extract_info_from_podspec ( pod , mixed_language_group )
303+ info = extract_info_from_podspec ( pods_to_merge_with_subspecs [ index ] , mixed_language_group )
298304 frameworks += info . frameworks
299305 prefix_header_contents += info . prefix_header_contents
300306 private_header_files += info . private_header_files
0 commit comments