module Pod class Command # cocoapods-packager class Package < Command end class TYPackage < Package def run super self.merge_vendored_libraries end def merge_vendored_libraries for platform in @spec.available_platforms vendored_libraries = @spec.consumer(platform).vendored_libraries if vendored_libraries != nil next end UI.puts("Merge #{platform.name} vendored_libraries: #{vendored_libraries}") framework_path = "#{@spec.name}-#{@spec.version}/#{platform.name}/#{@spec.name}.framework/Versions/A/#{@spec.name}" library_path = "#{@spec.name}-#{@spec.version}/#{platform.name}/lib#{@spec.name}.a" binary_path = @library ? library_path : framework_path for vendored_library in vendored_libraries Dir.glob(vendored_library) do |lib| exitCode = system("libtool -static -o \"#{binary_path}\" \"#{binary_path}\" \"#{lib}\"") if exitCode != 0 exit(-1) end end end end end end end end