├── spec ├── fixtures │ ├── LocalSources │ │ ├── LICENSE │ │ ├── LocalNikeKit.h │ │ ├── LocalNikeKit.m │ │ └── LocalNikeKit.podspec │ ├── PackagerTest │ │ ├── PackagerTest │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ ├── CPDAppDelegate.h │ │ │ ├── PackagerTest-Prefix.pch │ │ │ ├── main.m │ │ │ ├── Images.xcassets │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ │ └── LaunchImage.launchimage │ │ │ │ │ └── Contents.json │ │ │ ├── PackagerTest-Info.plist │ │ │ └── CPDAppDelegate.m │ │ ├── PackagerTestTests │ │ │ ├── en.lproj │ │ │ │ └── InfoPlist.strings │ │ │ ├── PackagerTestTests-Info.plist │ │ │ └── PackagerTestTests.m │ │ ├── Podfile │ │ ├── PackagerTest.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── .gitignore │ │ ├── PackagerTest.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ │ └── PackagerTest.xcscheme │ │ │ └── project.pbxproj │ │ └── Podfile.lock │ ├── LibraryConsumerDemo │ │ ├── Podfile │ │ ├── LibraryConsumer.xcodeproj │ │ │ ├── project.xcworkspace │ │ │ │ └── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ │ └── LibraryConsumer.xcscheme │ │ │ └── project.pbxproj │ │ ├── .gitignore │ │ ├── LibraryConsumer.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── LibraryConsumer │ │ │ ├── AppDelegate.h │ │ │ ├── main.m │ │ │ ├── AppDelegate.m │ │ │ └── Info.plist │ ├── Archs.podspec │ ├── Weakly.podspec │ ├── LibraryDemo.podspec │ ├── layer-client-messaging-schema.podspec │ ├── a.podspec │ ├── NikeKit.podspec │ ├── foo-bar.podspec │ ├── CPDColors.podspec │ ├── Builder.podspec │ ├── FH.podspec │ ├── OpenSans.podspec │ └── KFData.podspec ├── user_interface │ └── build_failed_report_spec.rb ├── command │ ├── subspecs_spec.rb │ ├── error_spec.rb │ └── package_spec.rb ├── spec_helper.rb ├── specification │ ├── builder_spec.rb │ └── spec_builder_spec.rb ├── pod │ └── utils_spec.rb └── integration │ └── project_spec.rb ├── .coveralls.yml ├── .gitignore ├── lib ├── cocoapods_packager.rb ├── cocoapods_plugin.rb ├── cocoapods-packager │ ├── user_interface │ │ └── build_failed_report.rb │ ├── mangle.rb │ ├── symbols.rb │ ├── framework.rb │ ├── spec_builder.rb │ ├── pod_utils.rb │ └── builder.rb └── pod │ └── command │ └── package.rb ├── scripts ├── lstsym.sh └── lstconst.sh ├── .travis.yml ├── Gemfile ├── Rakefile ├── .rubocop.yml ├── cocoapods-packager.gemspec ├── LICENSE ├── .rubocop-cocoapods.yml ├── README.md └── Gemfile.lock /spec/fixtures/LocalSources/LICENSE: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.coveralls.yml: -------------------------------------------------------------------------------- 1 | service_name: travis-ci 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | coverage 2 | pkg 3 | .DS_Store 4 | example 5 | -------------------------------------------------------------------------------- /lib/cocoapods_packager.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | module Packager 3 | VERSION = '1.5.4'.freeze 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /spec/fixtures/LocalSources/LocalNikeKit.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface LocalNikeKit : NSObject 4 | @end -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTestTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/Podfile: -------------------------------------------------------------------------------- 1 | target 'LibraryConsumer' do 2 | 3 | pod 'LibraryDemo', :path => '../../../LibraryDemo-1.0.0' 4 | 5 | end 6 | -------------------------------------------------------------------------------- /spec/fixtures/LocalSources/LocalNikeKit.m: -------------------------------------------------------------------------------- 1 | #import "LocalNikeKit.h" 2 | 3 | @implementation LocalNikeKit 4 | 5 | - (void)localMethod { 6 | 7 | } 8 | 9 | @end -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, "6.0" 4 | 5 | target "PackagerTest" do 6 | 7 | pod 'AFNetworking' 8 | 9 | end 10 | 11 | -------------------------------------------------------------------------------- /scripts/lstsym.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # List symbols for all Objective-C classes 5 | # 6 | 7 | nm "$@"| grep 'OBJC_CLASS_\$_'|grep -v '_NS\|_UI'| \ 8 | rev|cut -d' ' -f-1|rev|sort|uniq|cut -d'_' -f5- 9 | -------------------------------------------------------------------------------- /scripts/lstconst.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # List symbols for all constants 5 | # 6 | 7 | nm "$@"|grep ' S '|grep -v 'OBJC\|\.eh$'| \ 8 | cut -d_ -f2-|sort|uniq 9 | nm "$@"|grep ' T '|cut -d_ -f2-|sort|uniq 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode7.3 2 | language: objective-c 3 | cache: bundler 4 | before_install: 5 | - bundle install 6 | - bundle exec pod repo update --silent 7 | script: 8 | - bundle exec rake spec 9 | - bundle exec rubocop 10 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gemspec 4 | 5 | group :development do 6 | gem 'bacon' 7 | gem 'mocha-on-bacon' 8 | gem 'mocha' 9 | gem 'prettybacon' 10 | gem 'coveralls', :require => false 11 | gem 'rubocop' 12 | end 13 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/.gitignore: -------------------------------------------------------------------------------- 1 | ## CocoaPods 2 | 3 | Pods 4 | 5 | ## Node 6 | 7 | node_modules 8 | 9 | ## OS X 10 | 11 | .DS_Store 12 | 13 | ## Other 14 | 15 | .pt 16 | NikeKit.framework 17 | 18 | ## Xcode 19 | 20 | *.xccheckout 21 | xcuserdata 22 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/gem_tasks' 2 | 3 | def specs(dir) 4 | FileList["spec/#{dir}/*_spec.rb"].shuffle.join(' ') 5 | end 6 | 7 | desc 'Runs all the specs' 8 | task :spec do 9 | sh "bundle exec bacon #{specs('**')}" 10 | end 11 | 12 | task :default => :spec 13 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/.gitignore: -------------------------------------------------------------------------------- 1 | ## CocoaPods 2 | 3 | Pods 4 | Podfile.lock 5 | LibraryConsumer.xcworkspace 6 | 7 | ## Node 8 | 9 | node_modules 10 | 11 | ## OS X 12 | 13 | .DS_Store 14 | 15 | ## Other 16 | 17 | .pt 18 | 19 | ## Xcode 20 | 21 | *.xccheckout 22 | xcuserdata 23 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /lib/cocoapods_plugin.rb: -------------------------------------------------------------------------------- 1 | require 'pod/command/package' 2 | require 'cocoapods-packager/user_interface/build_failed_report' 3 | require 'cocoapods-packager/builder' 4 | require 'cocoapods-packager/framework' 5 | require 'cocoapods-packager/mangle' 6 | require 'cocoapods-packager/pod_utils' 7 | require 'cocoapods-packager/spec_builder' 8 | require 'cocoapods-packager/symbols' 9 | -------------------------------------------------------------------------------- /spec/user_interface/build_failed_report_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | module UserInterface 5 | describe BuildFailedReport do 6 | it 'should format a report correctly' do 7 | UI::BuildFailedReport.report('a', ['b']).should == "Build command failed: a\nOutput:\n b\n" 8 | end 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/user_interface/build_failed_report.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | module UserInterface 3 | module BuildFailedReport 4 | class << self 5 | def report(command, output) 6 | <<-EOF 7 | Build command failed: #{command} 8 | Output: 9 | #{output.map { |line| " #{line}" }.join} 10 | EOF 11 | end 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // CPDAppDelegate.h 3 | // PackagerTest 4 | // 5 | // Created by Boris Bügling on 24/08/14. 6 | // Copyright (c) 2014 CocoaPods. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CPDAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // LibraryConsumer 4 | // 5 | // Created by Ole Gammelgaard Poulsen on 16/10/14. 6 | // Copyright (c) 2014 Shape A/S. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // LibraryConsumer 4 | // 5 | // Created by Ole Gammelgaard Poulsen on 16/10/14. 6 | // Copyright (c) 2014 Shape A/S. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PackagerTest 4 | // 5 | // Created by Boris Bügling on 24/08/14. 6 | // Copyright (c) 2014 CocoaPods. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "CPDAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([CPDAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spec/fixtures/Archs.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Archs" 3 | s.version = "0.1.0" 4 | s.summary = "Yo" 5 | s.homepage = "http://google.com" 6 | s.license = "MIT" 7 | s.author = { "Boris Bügling" => "boris@icculus.org" } 8 | s.platform = :ios, '8.0' 9 | s.source = { :git => "https://github.com/neonichu/CPDColors.git", :tag => s.version } 10 | s.source_files = 'Code' 11 | 12 | s.dependency 'ABTestingVessel', '~> 1.3' 13 | end 14 | -------------------------------------------------------------------------------- /spec/fixtures/Weakly.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "Weakly" 3 | s.version = "0.1.0" 4 | s.summary = "Yo" 5 | s.homepage = "http://google.com" 6 | s.license = "MIT" 7 | s.author = { "Boris Bügling" => "boris@icculus.org" } 8 | s.platform = :ios, '8.0' 9 | s.source = { :git => "https://github.com/neonichu/CPDColors.git", :tag => s.version } 10 | s.source_files = 'Code' 11 | 12 | s.dependency 'PromiseKit', '~> 1.5' 13 | end 14 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // LibraryConsumer 4 | // 5 | // Created by Ole Gammelgaard Poulsen on 16/10/14. 6 | // Copyright (c) 2014 Shape A/S. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | 22 | NSLog(@"%@", [MyDemoClass welcomeMessage]); 23 | 24 | return YES; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryDemo.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'LibraryDemo' 3 | s.version = '1.0.0' 4 | s.summary = 'Demo' 5 | s.author = {'Ole Gammelgaard Poulsen' => 'ole@shape.dk' } 6 | s.source = { :git => 'https://github.com/olegam/LibraryDemo.git', :tag => s.version.to_s } 7 | s.source_files = 'sources/**/*.{h,m}' 8 | s.requires_arc = true 9 | s.ios.deployment_target = '6.0' 10 | s.osx.deployment_target = '10.9' 11 | 12 | s.license = 'GPL' # :trollface: 13 | s.homepage = 'https://www.youtube.com/watch?v=32UGD0fV45g' 14 | end 15 | -------------------------------------------------------------------------------- /spec/fixtures/layer-client-messaging-schema.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "layer-client-messaging-schema" 3 | s.version = "20140715104949748" 4 | s.summary = "Packages the database schema and migrations for layer-client-messaging-schema" 5 | s.homepage = "http://github.com/layerhq" 6 | s.author = { "Steven Jones" => "steven@layer.com" } 7 | s.source = { :git => "https://github.com/neonichu/CPDColors.git", 8 | :tag => "0.1.0" } 9 | s.license = 'Commercial' 10 | s.requires_arc = true 11 | s.platform = :ios, '7.0' 12 | s.resource_bundles = { 'layer-client-messaging-schema' => ['Code/**/*.h'] } 13 | end 14 | -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_from: 2 | - .rubocop-cocoapods.yml 3 | 4 | #- Core ----------------------------------------------------------------------- 5 | 6 | AllCops: 7 | Exclude: 8 | - spec/**/* 9 | - spec/fixtures/**/* 10 | - vendor/**/* 11 | 12 | Style/Tab: 13 | Enabled: false 14 | 15 | LineLength: 16 | Enabled: false 17 | 18 | ClassLength: 19 | Enabled: false 20 | 21 | MethodLength: 22 | Enabled: false 23 | 24 | Metrics/AbcSize: 25 | Enabled: false 26 | 27 | Metrics/CyclomaticComplexity: 28 | Enabled: false 29 | 30 | Metrics/PerceivedComplexity: 31 | Enabled: false 32 | 33 | Metrics/ParameterLists: 34 | Enabled: false 35 | 36 | Style/SpecialGlobalVars: 37 | EnforcedStyle: use_perl_names 38 | 39 | -------------------------------------------------------------------------------- /spec/fixtures/a.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'a' 3 | s.version = '0.0.1' 4 | s.summary = 'Objective-C implementation of the Nike+ API.' 5 | s.homepage = 'https://github.com/neonichu/NikeKit' 6 | s.license = {:type => 'MIT', :file => 'LICENSE'} 7 | s.authors = { 'Boris Bügling' => 'http://buegling.com' } 8 | s.source = { :git => 'https://github.com/neonichu/NikeKit.git', :tag => s.version.to_s } 9 | s.platform = :ios, '8.0' 10 | 11 | s.public_header_files = '*.h' 12 | s.source_files = '*.{h,m}' 13 | s.frameworks = 'Foundation' 14 | s.requires_arc = true 15 | 16 | s.dependency 'AFNetworking' 17 | s.dependency 'ISO8601DateFormatter' 18 | s.dependency 'KZPropertyMapper' 19 | end 20 | -------------------------------------------------------------------------------- /spec/fixtures/NikeKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'NikeKit' 3 | s.version = '0.0.1' 4 | s.summary = 'Objective-C implementation of the Nike+ API.' 5 | s.homepage = 'https://github.com/neonichu/NikeKit' 6 | s.license = {:type => 'MIT', :file => 'LICENSE'} 7 | s.authors = { 'Boris Bügling' => 'http://buegling.com' } 8 | s.source = { :git => 'https://github.com/neonichu/NikeKit.git', :tag => s.version.to_s } 9 | s.platform = :ios, '8.0' 10 | 11 | s.public_header_files = '*.h' 12 | s.source_files = '*.{h,m}' 13 | s.frameworks = 'Foundation' 14 | s.requires_arc = true 15 | 16 | s.dependency 'AFNetworking' 17 | s.dependency 'ISO8601DateFormatter' 18 | s.dependency 'KZPropertyMapper' 19 | end 20 | -------------------------------------------------------------------------------- /spec/fixtures/foo-bar.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'foo-bar' 3 | s.version = '0.0.1' 4 | s.summary = 'Objective-C implementation of the Nike+ API.' 5 | s.homepage = 'https://github.com/neonichu/NikeKit' 6 | s.license = {:type => 'MIT', :file => 'LICENSE'} 7 | s.authors = { 'Boris Bügling' => 'http://buegling.com' } 8 | s.source = { :git => 'https://github.com/neonichu/NikeKit.git', :tag => s.version.to_s } 9 | s.platform = :ios, '8.0' 10 | 11 | s.public_header_files = '*.h' 12 | s.source_files = '*.{h,m}' 13 | s.frameworks = 'Foundation' 14 | s.requires_arc = true 15 | 16 | s.dependency 'AFNetworking' 17 | s.dependency 'ISO8601DateFormatter' 18 | s.dependency 'KZPropertyMapper' 19 | end 20 | -------------------------------------------------------------------------------- /spec/fixtures/LocalSources/LocalNikeKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'LocalNikeKit' 3 | s.version = '0.0.1' 4 | s.summary = 'Objective-C implementation of the Nike+ API.' 5 | s.homepage = 'https://github.com/neonichu/NikeKit' 6 | s.license = {:type => 'MIT', :file => 'LICENSE'} 7 | s.authors = { 'Boris Bügling' => 'http://buegling.com' } 8 | s.source = { :git => 'https://github.com/neonichu/NikeKit.git', :tag => s.version.to_s } 9 | s.platform = :ios, '8.0' 10 | 11 | s.public_header_files = '*.h' 12 | s.source_files = '*.{h,m}' 13 | s.frameworks = 'Foundation' 14 | s.requires_arc = true 15 | 16 | s.dependency 'AFNetworking' 17 | s.dependency 'ISO8601DateFormatter' 18 | s.dependency 'KZPropertyMapper' 19 | end 20 | -------------------------------------------------------------------------------- /spec/fixtures/CPDColors.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "CPDColors" 3 | s.version = "0.1.0" 4 | s.summary = "Stay true to the brand with these orta-sanctioned colors." 5 | s.homepage = "https://github.com/neonichu/CPDColors" 6 | s.screenshots = "https://raw.githubusercontent.com/neonichu/CPDColors/master/screenshot.png" 7 | s.license = 'MIT' 8 | s.author = { "Boris Bügling" => "boris@icculus.org" } 9 | s.source = { :git => "https://github.com/neonichu/CPDColors.git", :tag => s.version.to_s } 10 | s.social_media_url = 'https://twitter.com/NeoNacho' 11 | 12 | s.platform = :ios, '8.0' 13 | 14 | s.requires_arc = true 15 | s.source_files = 'Code' 16 | s.public_header_files = 'Code/**/*.h' 17 | 18 | s.dependency 'FirebaseAnalytics' 19 | end 20 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PackagerTestTests.m 3 | // PackagerTestTests 4 | // 5 | // Created by Boris Bügling on 24/08/14. 6 | // Copyright (c) 2014 CocoaPods. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PackagerTestTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PackagerTestTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /cocoapods-packager.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'cocoapods_packager.rb' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = 'cocoapods-packager-pro' 8 | spec.version = Pod::Packager::VERSION 9 | spec.authors = ['Kyle Fuller', 'Boris Bügling'] 10 | spec.summary = 'CocoaPods plugin which allows you to generate a framework or static library from a podspec.' 11 | spec.homepage = 'https://github.com/CocoaPods/cocoapods-packager' 12 | spec.license = 'MIT' 13 | spec.files = `git ls-files`.split($/) 14 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 15 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 16 | spec.require_paths = ["lib"] 17 | 18 | spec.add_dependency "cocoapods", '>= 1.1.1', '< 2.0' 19 | 20 | spec.add_development_dependency "bundler", "~> 1.3" 21 | spec.add_development_dependency "rake" 22 | end 23 | -------------------------------------------------------------------------------- /spec/command/subspecs_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | describe Command::Spec::Package do 5 | describe 'Subspecs' do 6 | after do 7 | Dir.glob("KFData-*").each { |dir| Pathname.new(dir).rmtree } 8 | end 9 | 10 | it 'can package a single subspec' do 11 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 12 | 13 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --subspecs=Core}) 14 | command.run 15 | 16 | true.should == true # To make the test pass without any shoulds 17 | end 18 | 19 | it 'can package a list of subspecs' do 20 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 21 | 22 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --subspecs=Core,Compatibility}) 23 | command.run 24 | 25 | true.should == true # To make the test pass without any shoulds 26 | end 27 | end 28 | end 29 | end 30 | 31 | -------------------------------------------------------------------------------- /spec/fixtures/Builder.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Builder' 3 | s.version = '0.0.1' 4 | s.summary = 'Yo' 5 | s.homepage = 'https://github.com/CocoaPods/cocoapods-packager' 6 | s.license = {:type => 'MIT'} 7 | s.authors = { 'Boris Bügling' => 'http://buegling.com' } 8 | s.source = { :git => 'https://github.com/CocoaPods/cocoapods-packager.git', 9 | :tag => s.version.to_s } 10 | 11 | s.libraries = 'xml2' 12 | s.requires_arc = true 13 | s.xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' } 14 | s.compiler_flag = "-DBASE_FLAG" 15 | 16 | s.ios.frameworks = 'Foundation' 17 | s.ios.deployment_target = '8.0' 18 | s.ios.compiler_flag = "-DIOS_FLAG" 19 | 20 | s.osx.frameworks = 'AppKit' 21 | s.osx.deployment_target = "10.8" 22 | s.osx.requires_arc = false 23 | s.osx.xcconfig = { 'CFLAGS' => '-I.' } 24 | s.osx.compiler_flag = "-DOSX_FLAG" 25 | end 26 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AFNetworking (2.3.1): 3 | - AFNetworking/NSURLConnection (= 2.3.1) 4 | - AFNetworking/NSURLSession (= 2.3.1) 5 | - AFNetworking/Reachability (= 2.3.1) 6 | - AFNetworking/Security (= 2.3.1) 7 | - AFNetworking/Serialization (= 2.3.1) 8 | - AFNetworking/UIKit (= 2.3.1) 9 | - AFNetworking/NSURLConnection (2.3.1): 10 | - AFNetworking/Reachability 11 | - AFNetworking/Security 12 | - AFNetworking/Serialization 13 | - AFNetworking/NSURLSession (2.3.1): 14 | - AFNetworking/Reachability 15 | - AFNetworking/Security 16 | - AFNetworking/Serialization 17 | - AFNetworking/Reachability (2.3.1) 18 | - AFNetworking/Security (2.3.1) 19 | - AFNetworking/Serialization (2.3.1) 20 | - AFNetworking/UIKit (2.3.1): 21 | - AFNetworking/NSURLConnection 22 | - AFNetworking/NSURLSession 23 | 24 | DEPENDENCIES: 25 | - AFNetworking 26 | 27 | SPEC CHECKSUMS: 28 | AFNetworking: 05b9f6e3aa5ac45bc383b4bb108ef338080a26c7 29 | 30 | PODFILE CHECKSUM: 5099f0db5f9f3c3a6167fc27cde4e08d429a30ec 31 | 32 | COCOAPODS: 1.4.0 33 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/mangle.rb: -------------------------------------------------------------------------------- 1 | module Symbols 2 | # 3 | # performs symbol aliasing 4 | # 5 | # for each dependency: 6 | # - determine symbols for classes and global constants 7 | # - alias each symbol to Pod#{pod_name}_#{symbol} 8 | # - put defines into `GCC_PREPROCESSOR_DEFINITIONS` for passing to Xcode 9 | # 10 | def mangle_for_pod_dependencies(pod_name, sandbox_root) 11 | pod_libs = Dir.glob("#{sandbox_root}/build/lib*.a").select do |file| 12 | file !~ /lib#{pod_name}.a$/ 13 | end 14 | 15 | dummy_alias = alias_symbol "PodsDummy_#{pod_name}", pod_name 16 | all_syms = [dummy_alias] 17 | 18 | pod_libs.each do |pod_lib| 19 | syms = Symbols.symbols_from_library(pod_lib) 20 | all_syms += syms.map! { |sym| alias_symbol sym, pod_name } 21 | end 22 | 23 | "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) #{all_syms.uniq.join(' ')}'" 24 | end 25 | 26 | def alias_symbol(sym, pod_name) 27 | pod_name = pod_name.tr('-', '_') 28 | sym + "=Pod#{pod_name}_" + sym 29 | end 30 | 31 | module_function :mangle_for_pod_dependencies, :alias_symbol 32 | end 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This project is licensed under the MIT license. 2 | 3 | Copyright (c) 2014 Kyle Fuller, Boris Bügling and CocoaPods Dev Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 20 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 21 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 22 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require 'coveralls' 2 | Coveralls.wear! 3 | 4 | require 'pathname' 5 | ROOT = Pathname.new(File.expand_path('../../', __FILE__)) 6 | $:.unshift((ROOT + 'lib').to_s) 7 | $:.unshift((ROOT + 'spec').to_s) 8 | 9 | require 'bundler/setup' 10 | require 'bacon' 11 | require 'mocha-on-bacon' 12 | require 'pretty_bacon' 13 | require 'cocoapods' 14 | 15 | require 'cocoapods_plugin' 16 | 17 | #-----------------------------------------------------------------------------# 18 | 19 | module Pod 20 | 21 | # Disable the wrapping so the output is deterministic in the tests. 22 | # 23 | UI.disable_wrap = true 24 | 25 | # Redirects the messages to an internal store. 26 | # 27 | module UI 28 | @output = '' 29 | @warnings = '' 30 | 31 | class << self 32 | attr_accessor :output 33 | attr_accessor :warnings 34 | 35 | def puts(message = '') 36 | @output << "#{message}\n" 37 | end 38 | 39 | def warn(message = '', actions = []) 40 | @warnings << "#{message}\n" 41 | end 42 | 43 | def print(message) 44 | @output << message 45 | end 46 | end 47 | end 48 | end 49 | 50 | #-----------------------------------------------------------------------------# 51 | -------------------------------------------------------------------------------- /spec/fixtures/FH.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'FH' 3 | s.version = '2.2.8' 4 | s.summary = 'FeedHenry iOS Software Development Kit' 5 | s.homepage = 'https://www.feedhenry.com' 6 | s.social_media_url = 'https://twitter.com/feedhenry' 7 | s.license = 'FeedHenry' 8 | s.author = 'Red Hat, Inc.' 9 | s.source = { :git => 'https://github.com/cvasilak/fh-ios-sdk.git', :branch => 'module_map' } 10 | s.platform = :ios, 7.0 11 | s.source_files = 'fh-ios-sdk/**/*.{h,m}' 12 | s.public_header_files = 'fh-ios-sdk/FeedHenry.h', 'fh-ios-sdk/FH.h', 'fh-ios-sdk/FHAct.h', 'fh-ios-sdk/FHActRequest.h', 'fh-ios-sdk/FHAuthRequest.h', 'fh-ios-sdk/FHCloudProps.h', 'fh-ios-sdk/FHCloudRequest.h', 'fh-ios-sdk/FHConfig.h', 'fh-ios-sdk/FHResponse.h', 'fh-ios-sdk/FHResponseDelegate.h', 'fh-ios-sdk/Sync/FHSyncClient.h', 'fh-ios-sdk/Sync/FHSyncConfig.h', 'fh-ios-sdk/Sync/FHSyncNotificationMessage.h', 'fh-ios-sdk/Sync/FHSyncDelegate.h', 'fh-ios-sdk/Categories/JSON/FHJSON.h', 'fh-ios-sdk/FHDataManager.h' 13 | s.module_map = 'fh-ios-sdk/module.modulemap' 14 | s.requires_arc = true 15 | s.libraries = 'xml2', 'z' 16 | s.dependency 'ASIHTTPRequest/Core', '1.8.2' 17 | s.dependency 'Reachability', '3.2' 18 | end 19 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/symbols.rb: -------------------------------------------------------------------------------- 1 | module Symbols 2 | def symbols_from_library(library) 3 | syms = `nm -gU #{library}`.split("\n") 4 | result = classes_from_symbols(syms) 5 | result += constants_from_symbols(syms) 6 | 7 | result.select do |e| 8 | case e 9 | when 'llvm.cmdline', 'llvm.embedded.module', '__clang_at_available_requires_core_foundation_framework' 10 | false 11 | else 12 | true 13 | end 14 | end 15 | end 16 | 17 | module_function :symbols_from_library 18 | 19 | private 20 | 21 | def classes_from_symbols(syms) 22 | classes = syms.select { |klass| klass[/OBJC_CLASS_\$_/] } 23 | classes = classes.uniq 24 | classes.map! { |klass| klass.gsub(/^.*\$_/, '') } 25 | end 26 | 27 | def constants_from_symbols(syms) 28 | consts = syms.select { |const| const[/ S /] } 29 | consts = consts.select { |const| const !~ /OBJC|\.eh/ } 30 | consts = consts.uniq 31 | consts = consts.map! { |const| const.gsub(/^.* _/, '') } 32 | 33 | other_consts = syms.select { |const| const[/ T /] } 34 | other_consts = other_consts.uniq 35 | other_consts = other_consts.map! { |const| const.gsub(/^.* _/, '') } 36 | 37 | consts + other_consts 38 | end 39 | 40 | module_function :classes_from_symbols 41 | module_function :constants_from_symbols 42 | end 43 | -------------------------------------------------------------------------------- /spec/fixtures/OpenSans.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |spec| 2 | spec.name = 'OpenSans' 3 | spec.version = '1.0.3' 4 | spec.summary = 'A podspec encapsulating OpenSans font for iOS' 5 | spec.description = "Open Sans is a humanist sans serif typeface designed by Steve Matteson, Type Director of Ascender Corp. This version contains the complete 897 character set, which includes the standard ISO Latin 1, Latin CE, Greek and Cyrillic character sets. Open Sans was designed with an upright stress, open forms and a neutral, yet friendly appearance. It was optimized for print, web, and mobile interfaces, and has excellent legibility characteristics in its letterforms." 6 | spec.license = { :type => 'Apache License, Version 2.0', :file => 'LICENSE.txt' } 7 | spec.authors = { 'Kyle Fuller' => 'inbox@kylefuller.co.uk' } 8 | spec.homepage = 'https://github.com/CocoaPods-Fonts/OpenSans' 9 | spec.screenshot = 'http://f.cl.ly/items/2t2F032e3W0h2T1i0j1n/opensans-ios7-iphone5.png' 10 | spec.social_media_url = 'https://twitter.com/kylefuller' 11 | spec.platform = :ios 12 | spec.source = { :git => 'https://github.com/CocoaPods-Fonts/OpenSans.git', :tag => spec.version.to_s } 13 | spec.source_files = 'UIFont+OpenSans.{h,m}' 14 | spec.resource_bundle = { 'OpenSans' => 'Fonts/*.ttf' } 15 | spec.frameworks = 'UIKit', 'CoreText' 16 | spec.requires_arc = true 17 | end 18 | 19 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | dk.shape.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.rubocop-cocoapods.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Include: 3 | - Rakefile 4 | - Gemfile 5 | - ./*.gemspec 6 | Exclude: 7 | - spec/fixtures/**/* 8 | - vendor/**/* 9 | 10 | # At the moment not ready to be used 11 | # https://github.com/bbatsov/rubocop/issues/947 12 | Documentation: 13 | Enabled: false 14 | 15 | #- CocoaPods -----------------------------------------------------------------# 16 | 17 | # We adopted raise instead of fail. 18 | SignalException: 19 | EnforcedStyle: only_raise 20 | 21 | # They are idiomatic 22 | AssignmentInCondition: 23 | Enabled: false 24 | 25 | # Allow backticks 26 | AsciiComments: 27 | Enabled: false 28 | 29 | # Indentation clarifies logic branches in implementations 30 | IfUnlessModifier: 31 | Enabled: false 32 | 33 | # No enforced convention here. 34 | SingleLineBlockParams: 35 | Enabled: false 36 | 37 | # We only add the comment when needed. 38 | Encoding: 39 | Enabled: false 40 | 41 | #- CocoaPods support for Ruby 1.8.7 ------------------------------------------# 42 | 43 | HashSyntax: 44 | EnforcedStyle: hash_rockets 45 | 46 | Lambda: 47 | Enabled: false 48 | 49 | DotPosition: 50 | EnforcedStyle: trailing 51 | 52 | #- CocoaPods specs -----------------------------------------------------------# 53 | 54 | # Allow for `should.match /regexp/`. 55 | AmbiguousRegexpLiteral: 56 | Exclude: 57 | - spec/**/* 58 | 59 | # Allow `object.should == object` syntax. 60 | Void: 61 | Exclude: 62 | - spec/**/* 63 | 64 | ClassAndModuleChildren: 65 | Exclude: 66 | - spec/**/* 67 | 68 | UselessComparison: 69 | Exclude: 70 | - spec/**/* 71 | 72 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/framework.rb: -------------------------------------------------------------------------------- 1 | module Framework 2 | class Tree 3 | attr_reader :headers_path 4 | attr_reader :module_map_path 5 | attr_reader :resources_path 6 | attr_reader :root_path 7 | attr_reader :versions_path 8 | 9 | def delete_resources 10 | Pathname.new(@resources_path).rmtree 11 | (Pathname.new(@fwk_path) + Pathname.new('Resources')).delete 12 | end 13 | 14 | def initialize(name, platform, embedded) 15 | @name = name 16 | @platform = platform 17 | @embedded = embedded 18 | end 19 | 20 | def make 21 | make_root 22 | make_framework 23 | make_headers 24 | make_resources 25 | make_current_version 26 | end 27 | 28 | private 29 | 30 | def make_current_version 31 | current_version_path = @versions_path + Pathname.new('../Current') 32 | `ln -sf A #{current_version_path}` 33 | `ln -sf Versions/Current/Headers #{@fwk_path}/` 34 | `ln -sf Versions/Current/Resources #{@fwk_path}/` 35 | `ln -sf Versions/Current/#{@name} #{@fwk_path}/` 36 | end 37 | 38 | def make_framework 39 | @fwk_path = @root_path + Pathname.new(@name + '.framework') 40 | @fwk_path.mkdir unless @fwk_path.exist? 41 | 42 | @module_map_path = @fwk_path + Pathname.new('Modules') 43 | @versions_path = @fwk_path + Pathname.new('Versions/A') 44 | end 45 | 46 | def make_headers 47 | @headers_path = @versions_path + Pathname.new('Headers') 48 | @headers_path.mkpath unless @headers_path.exist? 49 | end 50 | 51 | def make_resources 52 | @resources_path = @versions_path + Pathname.new('Resources') 53 | @resources_path.mkpath unless @resources_path.exist? 54 | end 55 | 56 | def make_root 57 | @root_path = Pathname.new(@platform) 58 | 59 | if @embedded 60 | @root_path += Pathname.new(@name + '.embeddedframework') 61 | end 62 | 63 | @root_path.mkpath unless @root_path.exist? 64 | end 65 | end 66 | end 67 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/spec_builder.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | class SpecBuilder 3 | def initialize(spec, source, embedded, dynamic) 4 | @spec = spec 5 | @source = source.nil? ? '{ :path => \'.\' }' : source 6 | @embedded = embedded 7 | @dynamic = dynamic 8 | end 9 | 10 | def framework_path 11 | if @embedded 12 | @spec.name + '.embeddedframework' + '/' + @spec.name + '.framework' 13 | else 14 | @spec.name + '.framework' 15 | end 16 | end 17 | 18 | def spec_platform(platform) 19 | fwk_base = platform.name.to_s + '/' + framework_path 20 | spec = < []) 10 | end 11 | 12 | it "includes proper compiler flags for iOS" do 13 | @builder = Builder.new(Platform.new(:ios), @installer, nil, nil, nil, nil, @spec, nil, nil, nil, nil, nil, nil) 14 | @builder.expects(:xcodebuild).with("GCC_PREPROCESSOR_DEFINITIONS='$(inherited) PodsDummy_Pods_Builder=PodsDummy_PodPackage_Builder' -DBASE_FLAG -DIOS_FLAG", "ARCHS='x86_64 i386 arm64 armv7 armv7s' OTHER_CFLAGS='-fembed-bitcode -Qunused-arguments'").returns(nil) 15 | @builder.send(:compile) 16 | end 17 | 18 | it "includes proper compiler flags for OSX" do 19 | @builder = Builder.new(Platform.new(:osx), @installer, nil, nil, nil, nil, @spec, nil, nil, nil, nil, nil, nil) 20 | @builder.expects(:xcodebuild).with("GCC_PREPROCESSOR_DEFINITIONS='$(inherited) PodsDummy_Pods_Builder=PodsDummy_PodPackage_Builder' -DBASE_FLAG -DOSX_FLAG", nil).returns(nil) 21 | @builder.send(:compile) 22 | end 23 | end 24 | 25 | describe 'on build failure' do 26 | before do 27 | @spec = Specification.from_file('spec/fixtures/Builder.podspec') 28 | @installer = stub('Installer', :pod_targets => []) 29 | @builder = Builder.new(Platform.new(:ios), @installer, nil, nil, nil, nil, @spec, nil, nil, nil, nil, nil, nil) 30 | end 31 | 32 | it 'dumps report and terminates' do 33 | UI::BuildFailedReport.expects(:report).returns(nil) 34 | 35 | should.raise SystemExit do 36 | # TODO: check that it dumps report 37 | @builder.send(:compile) 38 | end 39 | end 40 | end 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CocoaPods Packager 2 | 3 | [![Build Status](http://img.shields.io/travis/CocoaPods/cocoapods-packager/master.svg?style=flat)](https://travis-ci.org/CocoaPods/cocoapods-packager) 4 | [![Coverage Status](https://img.shields.io/coveralls/CocoaPods/cocoapods-packager.svg)](https://coveralls.io/r/CocoaPods/cocoapods-packager?branch=master) 5 | [![Gem Version](http://img.shields.io/gem/v/cocoapods-packager.svg?style=flat)](http://badge.fury.io/rb/cocoapods-packager) 6 | [![Code Climate](http://img.shields.io/codeclimate/github/CocoaPods/cocoapods-packager.svg?style=flat)](https://codeclimate.com/github/CocoaPods/cocoapods-packager) 7 | 8 | CocoaPods plugin which allows you to generate a framework or static library from a podspec. 9 | 10 | This plugin is for CocoaPods *developers*, who need to distribute their Pods not only via CocoaPods, but also as frameworks or static libraries for people who do not use Pods. 11 | 12 | ## Why should I use Pods if I'm targeting developers who don't use Pods? 13 | 14 | There are still a number of advantages to developing against a `podspec`, even if your public distribution is closed-source: 15 | 16 | 1. You can easily use the Pod in-house in an open-source style. This makes step-by-step debugging and multi-project development a breeze. 17 | 2. You can pull in third-party dependencies using CocoaPods. (CocoaPods Packager is even capable of mangling symbols to improve compatibility with any symbols that might appear in the integrating app.) 18 | 3. You can declaratively specify build settings (e.g. frameworks, compiler flags) in your `podspec`. This is easier to maintain and replicate than build settings embedded in your Xcode project. 19 | 20 | ## Installation 21 | 22 | ```sh 23 | $ gem install cocoapods-packager 24 | ``` 25 | 26 | or add a line to your Gemfile: 27 | 28 | ```ruby 29 | gem "cocoapods-packager" 30 | ``` 31 | 32 | then run `bundle install`. 33 | 34 | This installs Packager as a CocoaPods plugin. 35 | 36 | ## Usage 37 | 38 | ```bash 39 | $ pod package KFData.podspec 40 | ``` 41 | 42 | See also `pod --help`. 43 | -------------------------------------------------------------------------------- /spec/specification/spec_builder_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | describe SpecBuilder do 5 | def compare_attributes(first_spec, second_spec, attribute_name) 6 | first_spec.attributes_hash[attribute_name].should == 7 | second_spec.attributes_hash[attribute_name] 8 | 9 | %w(ios osx).each do |platform| 10 | first_spec.attributes_hash[platform][attribute_name].should == 11 | second_spec.attributes_hash[platform][attribute_name] 12 | end 13 | end 14 | 15 | def specification_from_builder(builder) 16 | spec_string = builder.spec_metadata 17 | spec_string += builder.spec_platform(Platform.ios) 18 | spec_string += builder.spec_platform(Platform.osx) 19 | spec_string += builder.spec_close 20 | 21 | return Specification.from_string(spec_string, 'Builder.podspec') 22 | end 23 | 24 | describe 'Preserve attributes from source specification' do 25 | before do 26 | @spec = Specification.from_file('spec/fixtures/Builder.podspec') 27 | @builder = SpecBuilder.new(@spec, nil, false, nil) 28 | end 29 | 30 | it "preserves platform.frameworks" do 31 | spec = specification_from_builder(@builder) 32 | compare_attributes(spec, @spec, 'frameworks') 33 | end 34 | 35 | it "preserves platform.weak_frameworks" do 36 | spec = specification_from_builder(@builder) 37 | compare_attributes(spec, @spec, 'weak_frameworks') 38 | end 39 | 40 | it "preserves platform.libraries" do 41 | spec = specification_from_builder(@builder) 42 | compare_attributes(spec, @spec, 'libraries') 43 | end 44 | 45 | it "preserves platform.requires_arc" do 46 | spec = specification_from_builder(@builder) 47 | compare_attributes(spec, @spec, 'requires_arc') 48 | end 49 | 50 | it "preserves platform.deployment_target" do 51 | spec = specification_from_builder(@builder) 52 | compare_attributes(spec, @spec, 'deployment_target') 53 | end 54 | 55 | it "preserves platform.xcconfig" do 56 | spec = specification_from_builder(@builder) 57 | compare_attributes(spec, @spec, 'xcconfig') 58 | end 59 | end 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /spec/pod/utils_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | describe Command::Package do 5 | after do 6 | Dir.glob("Pods").each { |dir| Pathname.new(dir).rmtree } 7 | end 8 | 9 | it "uses additional spec repos passed on the command line" do 10 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 11 | nil::NilClass.any_instance.stubs(:install!) 12 | Installer.expects(:new).with { 13 | |sandbox, podfile| podfile.sources == ['foo', 'bar'] 14 | } 15 | 16 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --spec-sources=foo,bar}) 17 | command.send(:install_pod, :osx, nil) 18 | 19 | end 20 | 21 | it "uses only the master repo if no spec repos were passed" do 22 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 23 | nil::NilClass.any_instance.stubs(:install!) 24 | Installer.expects(:new).with { 25 | |sandbox, podfile| podfile.sources == ['https://github.com/CocoaPods/Specs.git'] 26 | } 27 | 28 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec }) 29 | command.send(:install_pod, :osx, nil) 30 | end 31 | 32 | it "creates seperate static and dynamic target if dynamic is passed" do 33 | source_dir = Dir.pwd 34 | 35 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 36 | 37 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec -dynamic}) 38 | t, w = command.send(:create_working_directory) 39 | 40 | command.config.installation_root = Pathname.new(w) 41 | command.config.sandbox_root = 'Pods' 42 | 43 | static_sandbox = command.send(:build_static_sandbox, true) 44 | static_installer = command.send(:install_pod, :ios, static_sandbox) 45 | 46 | dynamic_sandbox = command.send(:build_dynamic_sandbox, static_sandbox, static_installer) 47 | command.send(:install_dynamic_pod, dynamic_sandbox, static_sandbox, static_installer) 48 | 49 | static_sandbox_dir = Dir.new(Dir.pwd << "/Pods/Static") 50 | dynamic_sandbox_dir = Dir.new(Dir.pwd << "/Pods/Dynamic") 51 | 52 | static_sandbox_dir.to_s.should.not.be.empty 53 | dynamic_sandbox_dir.to_s.should.not.be.empty 54 | 55 | Dir.chdir(source_dir) 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // CPDAppDelegate.m 3 | // PackagerTest 4 | // 5 | // Created by Boris Bügling on 24/08/14. 6 | // Copyright (c) 2014 CocoaPods. All rights reserved. 7 | // 8 | 9 | #import "CPDAppDelegate.h" 10 | 11 | @implementation CPDAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 16 | // Override point for customization after application launch. 17 | self.window.backgroundColor = [UIColor whiteColor]; 18 | [self.window makeKeyAndVisible]; 19 | return YES; 20 | } 21 | 22 | - (void)applicationWillResignActive:(UIApplication *)application 23 | { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application 35 | { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application 40 | { 41 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application 45 | { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /spec/integration/project_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | 5 | DONT_CODESIGN = true 6 | 7 | describe Command::Spec::Package do 8 | describe 'IntegrationTests' do 9 | after do 10 | Dir.glob("NikeKit-*").each { |dir| Pathname.new(dir).rmtree } 11 | Dir.glob("LibraryDemo-*").each { |dir| Pathname.new(dir).rmtree } 12 | FileUtils.rm_rf('spec/fixtures/PackagerTest/NikeKit.framework') 13 | end 14 | 15 | it 'Allow integration into project alongside CocoaPods' do 16 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 17 | 18 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 19 | command.run 20 | `cp -Rp NikeKit-*/ios/NikeKit.framework spec/fixtures/PackagerTest` 21 | 22 | log = '' 23 | 24 | Dir.chdir('spec/fixtures/PackagerTest') do 25 | `pod install 2>&1` 26 | log << `xcodebuild -workspace PackagerTest.xcworkspace -scheme PackagerTest -sdk iphonesimulator CODE_SIGN_IDENTITY=- 2>&1` 27 | end 28 | 29 | puts log if $?.exitstatus != 0 30 | $?.exitstatus.should == 0 31 | end 32 | 33 | it 'Allow integration of dynamic framework into project alongside CocoaPods' do 34 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 35 | 36 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 37 | command.run 38 | `cp -Rp NikeKit-*/ios/NikeKit.framework spec/fixtures/PackagerTest` 39 | 40 | log = '' 41 | 42 | Dir.chdir('spec/fixtures/PackagerTest') do 43 | `pod install 2>&1` 44 | log << `xcodebuild -workspace PackagerTest.xcworkspace -scheme PackagerTest -sdk iphonesimulator CODE_SIGN_IDENTITY=- 2>&1` 45 | end 46 | 47 | puts log if $?.exitstatus != 0 48 | $?.exitstatus.should == 0 49 | end 50 | 51 | it 'allows integration of a library without dependencies' do 52 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 53 | 54 | command = Command.parse(%w{ package spec/fixtures/LibraryDemo.podspec }) 55 | command.run 56 | 57 | log = '' 58 | 59 | Dir.chdir('spec/fixtures/LibraryConsumerDemo') do 60 | `pod install 2>&1` 61 | log << `xcodebuild -workspace LibraryConsumer.xcworkspace -scheme LibraryConsumer 2>&1` 62 | log << `xcodebuild -sdk iphonesimulator -workspace LibraryConsumer.xcworkspace -scheme LibraryConsumer 2>&1` 63 | end 64 | 65 | puts log if $?.exitstatus != 0 66 | $?.exitstatus.should == 0 67 | end 68 | end 69 | end 70 | end 71 | -------------------------------------------------------------------------------- /spec/fixtures/KFData.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'KFData' 3 | s.version = '1.0.5' 4 | s.license = 'BSD' 5 | s.summary = 'Lightweight Core Data wrapper.' 6 | s.homepage = 'https://github.com/kylef/KFData' 7 | s.authors = { 'Kyle Fuller' => 'inbox@kylefuller.co.uk' } 8 | s.social_media_url = 'https://twitter.com/kylefuller' 9 | s.source = { :git => 'https://github.com/neonichu/KFData.git', :commit => '68ee9d94fbfa4e12db9401dd0dea205c18ad1c01' } 10 | 11 | s.requires_arc = true 12 | 13 | s.osx.deployment_target = '10.7' 14 | s.ios.deployment_target = '6.0' 15 | 16 | s.default_subspec = 'Essentials' 17 | s.header_dir = 'KFData' 18 | 19 | s.subspec 'Attribute' do |attribute_spec| 20 | attribute_spec.dependency 'QueryKit', '~> 0.8.3' 21 | attribute_spec.ios.source_files = 'KFData/Attribute/*.{h,m}' 22 | attribute_spec.osx.source_files = 'KFData/Attribute/*.{h,m}' 23 | end 24 | 25 | s.subspec 'Manager' do |manager_spec| 26 | manager_spec.dependency 'QueryKit', '~> 0.8.3' 27 | manager_spec.ios.source_files = 'KFData/Manager/*.{h,m}' 28 | manager_spec.osx.source_files = 'KFData/Manager/*.{h,m}' 29 | end 30 | 31 | s.subspec 'Core' do |corespec| 32 | corespec.ios.frameworks = 'CoreData' 33 | corespec.ios.source_files = 'KFData/KFData.h', 'KFData/Core/*.{h,m}' 34 | 35 | corespec.osx.frameworks = 'CoreData' 36 | corespec.osx.source_files = 'KFData/Core/*.{h,m}' 37 | end 38 | 39 | s.subspec 'Store' do |storespec| 40 | storespec.ios.frameworks = 'CoreData' 41 | storespec.ios.source_files = 'KFData/Store/*.{h,m}' 42 | storespec.ios.public_header_files = 'KFData/Store/KFDataStore.h' 43 | storespec.ios.private_header_files = 'KFData/Store/KFDataStoreInternal.h' 44 | 45 | storespec.osx.frameworks = 'CoreData' 46 | storespec.osx.source_files = 'KFData/Store/*.{h,m}' 47 | storespec.osx.public_header_files = 'KFData/Store/KFDataStore.h' 48 | storespec.osx.private_header_files = 'KFData/Store/KFDataStoreInternal.h' 49 | end 50 | 51 | s.subspec 'UI' do |uispec| 52 | uispec.dependency 'KFData/Manager' 53 | uispec.platform = :ios 54 | uispec.ios.frameworks = 'UIKit' 55 | uispec.ios.source_files = 'KFData/UI/*.{h,m}' 56 | end 57 | 58 | s.subspec 'Essentials' do |essentialsspec| 59 | essentialsspec.dependency 'KFData/Core' 60 | essentialsspec.dependency 'KFData/Store' 61 | essentialsspec.dependency 'KFData/Attribute' 62 | essentialsspec.dependency 'KFData/Manager' 63 | essentialsspec.ios.dependency 'KFData/UI' 64 | end 65 | 66 | s.subspec 'Compatibility' do |cspec| 67 | cspec.dependency 'KFData/Core' 68 | cspec.dependency 'KFData/Manager' 69 | cspec.header_dir = 'KFData/Compatibility' 70 | cspec.source_files = 'KFData/Compatibility/*.{h,m}' 71 | end 72 | end 73 | 74 | -------------------------------------------------------------------------------- /spec/command/error_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | describe 'Packager' do 5 | after do 6 | Dir.glob("CPDColors-*").each { |dir| Pathname.new(dir).rmtree } 7 | Dir.glob("layer-client-messaging-schema-*").each { |dir| Pathname.new(dir).rmtree } 8 | Dir.glob("OpenSans-*").each { |dir| Pathname.new(dir).rmtree } 9 | Dir.glob("Weakly-*").each { |dir| Pathname.new(dir).rmtree } 10 | end 11 | 12 | it 'presents the help if a directory is provided' do 13 | should.raise CLAide::Help do 14 | command = Command.parse(%w{ package spec }) 15 | end.message.should.match /is a directory/ 16 | end 17 | 18 | it 'presents the help if a random file is provided instead of a specification' do 19 | should.raise CLAide::Help do 20 | command = Command.parse(%w{ package README.md }) 21 | end.message.should.match /is not a podspec/ 22 | end 23 | 24 | it 'presents the help if a podspec with binary-only dependencies is used' do 25 | command = Command.parse(%w{ package spec/fixtures/CPDColors.podspec }) 26 | should.raise CLAide::Help do 27 | command.validate! 28 | end.message.should.match /binary-only/ 29 | end 30 | 31 | it 'presents the help if only --bundle-identifier is specified' do 32 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --bundle-identifier=com.example.NikeKit }) 33 | should.raise CLAide::Help do 34 | command.validate! 35 | end.message.should.match /--bundle-identifier option can only be used for dynamic frameworks/ 36 | end 37 | 38 | it 'presents the help if both --exclude-deps and --dynamic are specified' do 39 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --exclude-deps --dynamic }) 40 | should.raise CLAide::Help do 41 | command.validate! 42 | end.message.should.match /--exclude-deps option can only be used for static libraries/ 43 | end 44 | 45 | it 'presents the help if --local is specified without .podspec path' do 46 | command = Command.parse(%w{ package AFNetworking --local }) 47 | should.raise CLAide::Help do 48 | command.validate! 49 | end.message.should.match /--local option can only be used when a local `.podspec` path is given/ 50 | end 51 | 52 | it 'can package a podspec with only resources' do 53 | command = Command.parse(%w{ package spec/fixtures/layer-client-messaging-schema.podspec --no-mangle }) 54 | command.run 55 | 56 | true.should == true # To make the test pass without any shoulds 57 | end 58 | 59 | it 'can package a podspec with binary-only dependencies if --no-mangle is specified' do 60 | command = Command.parse(%w{ package spec/fixtures/CPDColors.podspec --no-mangle }) 61 | command.run 62 | 63 | true.should == true # To make the test pass without any shoulds 64 | end 65 | 66 | it 'can package a podspec with resource bundles' do 67 | command = Command.parse(%w{ package spec/fixtures/OpenSans.podspec }) 68 | command.run 69 | 70 | bundles = Dir.glob('OpenSans-*/ios/OpenSans.framework/Versions/A/Resources/*.bundle') 71 | bundles.count.should == 1 72 | end 73 | 74 | it 'can package a podspec with weak frameworks without strong linking' do 75 | command = Command.parse(%w{ package spec/fixtures/Weakly.podspec }) 76 | command.run 77 | 78 | `otool -l Weakly-*/ios/Weakly.framework/Weakly`.should.not.match /AssetsLibrary/ 79 | end 80 | end 81 | end 82 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | PATH 2 | remote: . 3 | specs: 4 | cocoapods-packager (1.5.0) 5 | cocoapods (>= 1.1.1, < 2.0) 6 | 7 | GEM 8 | remote: https://rubygems.org/ 9 | specs: 10 | CFPropertyList (2.3.6) 11 | activesupport (4.2.10) 12 | i18n (~> 0.7) 13 | minitest (~> 5.1) 14 | thread_safe (~> 0.3, >= 0.3.4) 15 | tzinfo (~> 1.1) 16 | ast (2.2.0) 17 | atomos (0.1.2) 18 | bacon (1.2.0) 19 | claide (1.0.2) 20 | cocoapods (1.4.0) 21 | activesupport (>= 4.0.2, < 5) 22 | claide (>= 1.0.2, < 2.0) 23 | cocoapods-core (= 1.4.0) 24 | cocoapods-deintegrate (>= 1.0.2, < 2.0) 25 | cocoapods-downloader (>= 1.1.3, < 2.0) 26 | cocoapods-plugins (>= 1.0.0, < 2.0) 27 | cocoapods-search (>= 1.0.0, < 2.0) 28 | cocoapods-stats (>= 1.0.0, < 2.0) 29 | cocoapods-trunk (>= 1.3.0, < 2.0) 30 | cocoapods-try (>= 1.1.0, < 2.0) 31 | colored2 (~> 3.1) 32 | escape (~> 0.0.4) 33 | fourflusher (~> 2.0.1) 34 | gh_inspector (~> 1.0) 35 | molinillo (~> 0.6.4) 36 | nap (~> 1.0) 37 | ruby-macho (~> 1.1) 38 | xcodeproj (>= 1.5.4, < 2.0) 39 | cocoapods-core (1.4.0) 40 | activesupport (>= 4.0.2, < 6) 41 | fuzzy_match (~> 2.0.4) 42 | nap (~> 1.0) 43 | cocoapods-deintegrate (1.0.2) 44 | cocoapods-downloader (1.1.3) 45 | cocoapods-plugins (1.0.0) 46 | nap 47 | cocoapods-search (1.0.0) 48 | cocoapods-stats (1.0.0) 49 | cocoapods-trunk (1.3.0) 50 | nap (>= 0.8, < 2.0) 51 | netrc (~> 0.11) 52 | cocoapods-try (1.1.0) 53 | colored2 (3.1.2) 54 | concurrent-ruby (1.0.5) 55 | coveralls (0.8.21) 56 | json (>= 1.8, < 3) 57 | simplecov (~> 0.14.1) 58 | term-ansicolor (~> 1.3) 59 | thor (~> 0.19.4) 60 | tins (~> 1.6) 61 | docile (1.1.5) 62 | escape (0.0.4) 63 | fourflusher (2.0.1) 64 | fuzzy_match (2.0.4) 65 | gh_inspector (1.1.2) 66 | i18n (0.9.5) 67 | concurrent-ruby (~> 1.0) 68 | json (2.1.0) 69 | metaclass (0.0.4) 70 | minitest (5.11.3) 71 | mocha (1.2.1) 72 | metaclass (~> 0.0.1) 73 | mocha-on-bacon (0.2.3) 74 | mocha (>= 0.13.0) 75 | molinillo (0.6.4) 76 | nanaimo (0.2.3) 77 | nap (1.1.0) 78 | netrc (0.11.0) 79 | parser (2.3.0.6) 80 | ast (~> 2.2) 81 | powerpack (0.1.1) 82 | prettybacon (0.0.2) 83 | bacon (~> 1.2) 84 | rainbow (2.1.0) 85 | rake (10.5.0) 86 | rubocop (0.37.2) 87 | parser (>= 2.3.0.4, < 3.0) 88 | powerpack (~> 0.1) 89 | rainbow (>= 1.99.1, < 3.0) 90 | ruby-progressbar (~> 1.7) 91 | unicode-display_width (~> 0.3) 92 | ruby-macho (1.1.0) 93 | ruby-progressbar (1.7.5) 94 | simplecov (0.14.1) 95 | docile (~> 1.1.0) 96 | json (>= 1.8, < 3) 97 | simplecov-html (~> 0.10.0) 98 | simplecov-html (0.10.2) 99 | term-ansicolor (1.6.0) 100 | tins (~> 1.0) 101 | thor (0.19.4) 102 | thread_safe (0.3.6) 103 | tins (1.16.3) 104 | tzinfo (1.2.5) 105 | thread_safe (~> 0.1) 106 | unicode-display_width (0.3.1) 107 | xcodeproj (1.5.6) 108 | CFPropertyList (~> 2.3.3) 109 | atomos (~> 0.1.2) 110 | claide (>= 1.0.2, < 2.0) 111 | colored2 (~> 3.1) 112 | nanaimo (~> 0.2.3) 113 | 114 | PLATFORMS 115 | ruby 116 | 117 | DEPENDENCIES 118 | bacon 119 | bundler (~> 1.3) 120 | cocoapods-packager! 121 | coveralls 122 | mocha 123 | mocha-on-bacon 124 | prettybacon 125 | rake 126 | rubocop 127 | 128 | BUNDLED WITH 129 | 1.16.1 130 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/xcshareddata/xcschemes/LibraryConsumer.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | 53 | 54 | 55 | 56 | 65 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 84 | 90 | 91 | 92 | 93 | 95 | 96 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /spec/fixtures/PackagerTest/PackagerTest.xcodeproj/xcshareddata/xcschemes/PackagerTest.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /lib/pod/command/package.rb: -------------------------------------------------------------------------------- 1 | require 'tmpdir' 2 | module Pod 3 | class Command 4 | class PackagePro < Command 5 | self.summary = 'Package a podspec into a static library.' 6 | self.arguments = [ 7 | CLAide::Argument.new('NAME', true), 8 | CLAide::Argument.new('SOURCE', false) 9 | ] 10 | 11 | def self.options 12 | [ 13 | ['--force', 'Overwrite existing files.'], 14 | ['--no-mangle', 'Do not mangle symbols of depedendant Pods.'], 15 | ['--embedded', 'Generate embedded frameworks.'], 16 | ['--library', 'Generate static libraries.'], 17 | ['--dynamic', 'Generate dynamic framework.'], 18 | ['--local', 'Use local state rather than published versions.'], 19 | ['--bundle-identifier', 'Bundle identifier for dynamic framework'], 20 | ['--exclude-deps', 'Exclude symbols from dependencies.'], 21 | ['--configuration', 'Build the specified configuration (e.g. Debug). Defaults to Release'], 22 | ['--subspecs', 'Only include the given subspecs'], 23 | ['--spec-sources=private,https://github.com/CocoaPods/Specs.git', 'The sources to pull dependant ' \ 24 | 'pods from (defaults to https://github.com/CocoaPods/Specs.git)'] 25 | ] 26 | end 27 | 28 | def initialize(argv) 29 | @embedded = argv.flag?('embedded') 30 | @library = argv.flag?('library') 31 | @dynamic = argv.flag?('dynamic') 32 | @local = argv.flag?('local', false) 33 | @package_type = if @embedded 34 | :static_framework 35 | elsif @dynamic 36 | :dynamic_framework 37 | elsif @library 38 | :static_library 39 | else 40 | :static_framework 41 | end 42 | @force = argv.flag?('force') 43 | @mangle = argv.flag?('mangle', true) 44 | @bundle_identifier = argv.option('bundle-identifier', nil) 45 | @exclude_deps = argv.flag?('exclude-deps', false) 46 | @name = argv.shift_argument 47 | @source = argv.shift_argument 48 | @spec_sources = argv.option('spec-sources', 'https://github.com/CocoaPods/Specs.git').split(',') 49 | 50 | subspecs = argv.option('subspecs') 51 | @subspecs = subspecs.split(',') unless subspecs.nil? 52 | 53 | @config = argv.option('configuration', 'Release') 54 | 55 | @source_dir = Dir.pwd 56 | @is_spec_from_path = false 57 | @spec = spec_with_path(@name) 58 | @is_spec_from_path = true if @spec 59 | @spec ||= spec_with_name(@name) 60 | super 61 | end 62 | 63 | def validate! 64 | super 65 | help! 'A podspec name or path is required.' unless @spec 66 | help! 'podspec has binary-only depedencies, mangling not possible.' if @mangle && binary_only?(@spec) 67 | help! '--bundle-identifier option can only be used for dynamic frameworks' if @bundle_identifier && !@dynamic 68 | help! '--exclude-deps option can only be used for static libraries' if @exclude_deps && @dynamic 69 | help! '--local option can only be used when a local `.podspec` path is given.' if @local && !@is_spec_from_path 70 | end 71 | 72 | def run 73 | if @spec.nil? 74 | help! 'Unable to find a podspec with path or name.' 75 | return 76 | end 77 | 78 | target_dir, work_dir = create_working_directory 79 | return if target_dir.nil? 80 | build_package 81 | 82 | `mv "#{work_dir}" "#{target_dir}"` 83 | Dir.chdir(@source_dir) 84 | end 85 | 86 | private 87 | 88 | def build_in_sandbox(platform) 89 | config.installation_root = Pathname.new(Dir.pwd) 90 | config.sandbox_root = 'Pods' 91 | 92 | static_sandbox = build_static_sandbox(@dynamic) 93 | static_installer = install_pod(platform.name, static_sandbox) 94 | 95 | if @dynamic 96 | dynamic_sandbox = build_dynamic_sandbox(static_sandbox, static_installer) 97 | install_dynamic_pod(dynamic_sandbox, static_sandbox, static_installer) 98 | end 99 | 100 | begin 101 | perform_build(platform, static_sandbox, dynamic_sandbox, static_installer) 102 | ensure # in case the build fails; see Builder#xcodebuild. 103 | Pathname.new(config.sandbox_root).rmtree 104 | FileUtils.rm_f('Podfile.lock') 105 | end 106 | end 107 | 108 | def build_package 109 | builder = SpecBuilder.new(@spec, @source, @embedded, @dynamic) 110 | newspec = builder.spec_metadata 111 | 112 | @spec.available_platforms.each do |platform| 113 | build_in_sandbox(platform) 114 | 115 | newspec += builder.spec_platform(platform) 116 | end 117 | 118 | newspec += builder.spec_close 119 | File.open(@spec.name + '.podspec', 'w') { |file| file.write(newspec) } 120 | end 121 | 122 | def create_target_directory 123 | target_dir = "#{@source_dir}/#{@spec.name}-#{@spec.version}" 124 | if File.exist? target_dir 125 | if @force 126 | Pathname.new(target_dir).rmtree 127 | else 128 | UI.puts "Target directory '#{target_dir}' already exists." 129 | return nil 130 | end 131 | end 132 | target_dir 133 | end 134 | 135 | def create_working_directory 136 | target_dir = create_target_directory 137 | return if target_dir.nil? 138 | 139 | work_dir = Dir.tmpdir + '/cocoapods-' + Array.new(8) { rand(36).to_s(36) }.join 140 | Pathname.new(work_dir).mkdir 141 | Dir.chdir(work_dir) 142 | 143 | [target_dir, work_dir] 144 | end 145 | 146 | def perform_build(platform, static_sandbox, dynamic_sandbox, static_installer) 147 | static_sandbox_root = config.sandbox_root.to_s 148 | 149 | if @dynamic 150 | static_sandbox_root = "#{static_sandbox_root}/#{static_sandbox.root.to_s.split('/').last}" 151 | dynamic_sandbox_root = "#{config.sandbox_root}/#{dynamic_sandbox.root.to_s.split('/').last}" 152 | end 153 | 154 | builder = Pod::Builder.new( 155 | platform, 156 | static_installer, 157 | @source_dir, 158 | static_sandbox_root, 159 | dynamic_sandbox_root, 160 | static_sandbox.public_headers.root, 161 | @spec, 162 | @embedded, 163 | @mangle, 164 | @dynamic, 165 | @config, 166 | @bundle_identifier, 167 | @exclude_deps 168 | ) 169 | 170 | builder.build(@package_type) 171 | 172 | return unless @embedded 173 | builder.link_embedded_resources 174 | end 175 | end 176 | end 177 | end 178 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/pod_utils.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | class Command 3 | class PackagePro < Command 4 | private 5 | 6 | def build_static_sandbox(dynamic) 7 | static_sandbox_root = if dynamic 8 | Pathname.new(config.sandbox_root + '/Static') 9 | else 10 | Pathname.new(config.sandbox_root) 11 | end 12 | Sandbox.new(static_sandbox_root) 13 | end 14 | 15 | def install_pod(platform_name, sandbox) 16 | podfile = podfile_from_spec( 17 | @path, 18 | @spec.name, 19 | platform_name, 20 | @spec.deployment_target(platform_name), 21 | @subspecs, 22 | @spec_sources 23 | ) 24 | 25 | static_installer = Installer.new(sandbox, podfile) 26 | static_installer.install! 27 | 28 | unless static_installer.nil? 29 | static_installer.pods_project.targets.each do |target| 30 | target.build_configurations.each do |config| 31 | config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO' 32 | config.build_settings['GCC_GENERATE_DEBUGGING_SYMBOLS'] = 'NO' 33 | end 34 | end 35 | static_installer.pods_project.save 36 | end 37 | 38 | static_installer 39 | end 40 | 41 | def podfile_from_spec(path, spec_name, platform_name, deployment_target, subspecs, sources) 42 | options = {} 43 | if path 44 | if @local 45 | options[:path] = path 46 | else 47 | options[:podspec] = path 48 | end 49 | end 50 | options[:subspecs] = subspecs if subspecs 51 | Pod::Podfile.new do 52 | sources.each { |s| source s } 53 | platform(platform_name, deployment_target) 54 | pod(spec_name, options) 55 | 56 | install!('cocoapods', 57 | :integrate_targets => false, 58 | :deterministic_uuids => false) 59 | 60 | target('packager') do 61 | inherit! :complete 62 | end 63 | end 64 | end 65 | 66 | def binary_only?(spec) 67 | deps = spec.dependencies.map { |dep| spec_with_name(dep.name) } 68 | [spec, *deps].each do |specification| 69 | %w(vendored_frameworks vendored_libraries).each do |attrib| 70 | if specification.attributes_hash[attrib] 71 | return true 72 | end 73 | end 74 | end 75 | 76 | false 77 | end 78 | 79 | def spec_with_name(name) 80 | return if name.nil? 81 | 82 | set = Pod::Config.instance.sources_manager.search(Dependency.new(name)) 83 | return nil if set.nil? 84 | 85 | set.specification.root 86 | end 87 | 88 | def spec_with_path(path) 89 | return if path.nil? || !Pathname.new(path).exist? 90 | 91 | @path = Pathname.new(path).expand_path 92 | 93 | if @path.directory? 94 | help! @path + ': is a directory.' 95 | return 96 | end 97 | 98 | unless ['.podspec', '.json'].include? @path.extname 99 | help! @path + ': is not a podspec.' 100 | return 101 | end 102 | 103 | Specification.from_file(@path) 104 | end 105 | 106 | #---------------------- 107 | # Dynamic Project Setup 108 | #---------------------- 109 | 110 | def build_dynamic_sandbox(_static_sandbox, _static_installer) 111 | dynamic_sandbox_root = Pathname.new(config.sandbox_root + '/Dynamic') 112 | dynamic_sandbox = Sandbox.new(dynamic_sandbox_root) 113 | 114 | dynamic_sandbox 115 | end 116 | 117 | def install_dynamic_pod(dynamic_sandbox, static_sandbox, static_installer) 118 | # 1 Create a dynamic target for only the spec pod. 119 | dynamic_target = build_dynamic_target(dynamic_sandbox, static_installer) 120 | 121 | # 2. Build a new xcodeproj in the dynamic_sandbox with only the spec pod as a target. 122 | project = prepare_pods_project(dynamic_sandbox, dynamic_target.name, static_installer) 123 | 124 | # 3. Copy the source directory for the dynamic framework from the static sandbox. 125 | copy_dynamic_target(static_sandbox, dynamic_target, dynamic_sandbox) 126 | 127 | # 5. Update the file accecssors. 128 | dynamic_target = update_file_accessors(dynamic_target, dynamic_sandbox) 129 | 130 | # 6. Create the file references. 131 | install_file_references(dynamic_sandbox, [dynamic_target], project) 132 | 133 | # 7. Install the target. 134 | install_library(dynamic_sandbox, dynamic_target) 135 | 136 | # 9. Write the actual Xcodeproject to the dynamic sandbox. 137 | write_pod_project(project, dynamic_sandbox) 138 | end 139 | 140 | def build_dynamic_target(dynamic_sandbox, static_installer) 141 | spec_targets = static_installer.pod_targets.select do |target| 142 | target.name == @spec.name 143 | end 144 | static_target = spec_targets[0] 145 | 146 | dynamic_target = Pod::PodTarget.new(static_target.specs, static_target.target_definitions, dynamic_sandbox) 147 | dynamic_target.host_requires_frameworks = true 148 | dynamic_target.user_build_configurations = static_target.user_build_configurations 149 | dynamic_target 150 | end 151 | 152 | def prepare_pods_project(dynamic_sandbox, spec_name, installer) 153 | # Create a new pods project 154 | pods_project = Pod::Project.new(dynamic_sandbox.project_path) 155 | 156 | # Update build configurations 157 | installer.analysis_result.all_user_build_configurations.each do |name, type| 158 | pods_project.add_build_configuration(name, type) 159 | end 160 | 161 | # Add the pod group for only the dynamic framework 162 | local = dynamic_sandbox.local?(spec_name) 163 | path = dynamic_sandbox.pod_dir(spec_name) 164 | was_absolute = dynamic_sandbox.local_path_was_absolute?(spec_name) 165 | pods_project.add_pod_group(spec_name, path, local, was_absolute) 166 | 167 | dynamic_sandbox.project = pods_project 168 | pods_project 169 | end 170 | 171 | def copy_dynamic_target(static_sandbox, _dynamic_target, dynamic_sandbox) 172 | command = "cp -a #{static_sandbox.root}/#{@spec.name} #{dynamic_sandbox.root}" 173 | `#{command}` 174 | end 175 | 176 | def update_file_accessors(dynamic_target, dynamic_sandbox) 177 | pod_root = dynamic_sandbox.pod_dir(dynamic_target.root_spec.name) 178 | 179 | path_list = Sandbox::PathList.new(pod_root) 180 | file_accessors = dynamic_target.specs.map do |spec| 181 | Sandbox::FileAccessor.new(path_list, spec.consumer(dynamic_target.platform)) 182 | end 183 | 184 | dynamic_target.file_accessors = file_accessors 185 | dynamic_target 186 | end 187 | 188 | def install_file_references(dynamic_sandbox, pod_targets, pods_project) 189 | installer = Pod::Installer::Xcode::PodsProjectGenerator::FileReferencesInstaller.new(dynamic_sandbox, pod_targets, pods_project) 190 | installer.install! 191 | end 192 | 193 | def install_library(dynamic_sandbox, dynamic_target) 194 | return if dynamic_target.target_definitions.flat_map(&:dependencies).empty? 195 | target_installer = Pod::Installer::Xcode::PodsProjectGenerator::PodTargetInstaller.new(dynamic_sandbox, dynamic_target) 196 | target_installer.install! 197 | 198 | # Installs System Frameworks 199 | dynamic_target.file_accessors.each do |file_accessor| 200 | file_accessor.spec_consumer.frameworks.each do |framework| 201 | if dynamic_target.should_build? 202 | dynamic_target.native_target.add_system_framework(framework) 203 | end 204 | end 205 | 206 | file_accessor.spec_consumer.libraries.each do |library| 207 | if dynamic_target.should_build? 208 | dynamic_target.native_target.add_system_library(library) 209 | end 210 | end 211 | end 212 | end 213 | 214 | def write_pod_project(dynamic_project, dynamic_sandbox) 215 | UI.message "- Writing Xcode project file to #{UI.path dynamic_sandbox.project_path}" do 216 | dynamic_project.pods.remove_from_project if dynamic_project.pods.empty? 217 | dynamic_project.development_pods.remove_from_project if dynamic_project.development_pods.empty? 218 | dynamic_project.sort(:groups_position => :below) 219 | dynamic_project.recreate_user_schemes(false) 220 | 221 | # Edit search paths so that we can find our dependency headers 222 | dynamic_project.targets.first.build_configuration_list.build_configurations.each do |config| 223 | config.build_settings['HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**" 224 | config.build_settings['USER_HEADER_SEARCH_PATHS'] = "$(inherited) #{Dir.pwd}/Pods/Static/Headers/**" 225 | config.build_settings['OTHER_LDFLAGS'] = '$(inherited) -ObjC' 226 | end 227 | dynamic_project.save 228 | end 229 | end 230 | end 231 | end 232 | end 233 | -------------------------------------------------------------------------------- /lib/cocoapods-packager/builder.rb: -------------------------------------------------------------------------------- 1 | module Pod 2 | class Builder 3 | def initialize(platform, static_installer, source_dir, static_sandbox_root, dynamic_sandbox_root, public_headers_root, spec, embedded, mangle, dynamic, config, bundle_identifier, exclude_deps) 4 | @platform = platform 5 | @static_installer = static_installer 6 | @source_dir = source_dir 7 | @static_sandbox_root = static_sandbox_root 8 | @dynamic_sandbox_root = dynamic_sandbox_root 9 | @public_headers_root = public_headers_root 10 | @spec = spec 11 | @embedded = embedded 12 | @mangle = mangle 13 | @dynamic = dynamic 14 | @config = config 15 | @bundle_identifier = bundle_identifier 16 | @exclude_deps = exclude_deps 17 | 18 | @file_accessors = @static_installer.pod_targets.select { |t| t.pod_name == @spec.name }.flat_map(&:file_accessors) 19 | end 20 | 21 | def build(package_type) 22 | case package_type 23 | when :static_library 24 | build_static_library 25 | when :static_framework 26 | build_static_framework 27 | when :dynamic_framework 28 | build_dynamic_framework 29 | end 30 | end 31 | 32 | def build_static_library 33 | UI.puts("Building static library #{@spec} with configuration #{@config}") 34 | 35 | defines = compile 36 | build_sim_libraries(defines) 37 | 38 | platform_path = Pathname.new(@platform.name.to_s) 39 | platform_path.mkdir unless platform_path.exist? 40 | 41 | output = platform_path + "lib#{@spec.name}.a" 42 | 43 | if @platform.name == :ios 44 | build_static_library_for_ios(output) 45 | else 46 | build_static_library_for_mac(output) 47 | end 48 | end 49 | 50 | def build_static_framework 51 | UI.puts("Building static framework #{@spec} with configuration #{@config}") 52 | 53 | defines = compile 54 | build_sim_libraries(defines) 55 | 56 | create_framework 57 | output = @fwk.versions_path + Pathname.new(@spec.name) 58 | 59 | if @platform.name == :ios 60 | build_static_library_for_ios(output) 61 | else 62 | build_static_library_for_mac(output) 63 | end 64 | 65 | copy_headers 66 | copy_license 67 | copy_resources 68 | end 69 | 70 | def link_embedded_resources 71 | target_path = @fwk.root_path + Pathname.new('Resources') 72 | target_path.mkdir unless target_path.exist? 73 | 74 | Dir.glob(@fwk.resources_path.to_s + '/*').each do |resource| 75 | resource = Pathname.new(resource).relative_path_from(target_path) 76 | `ln -sf #{resource} #{target_path}` 77 | end 78 | end 79 | 80 | def build_dynamic_framework 81 | UI.puts("Building dynamic framework #{@spec} with configuration #{@config}") 82 | 83 | defines = compile 84 | build_sim_libraries(defines) 85 | 86 | if @bundle_identifier 87 | defines = "#{defines} PRODUCT_BUNDLE_IDENTIFIER='#{@bundle_identifier}'" 88 | end 89 | 90 | output = "#{@dynamic_sandbox_root}/build/#{@spec.name}.framework/#{@spec.name}" 91 | 92 | clean_directory_for_dynamic_build 93 | if @platform.name == :ios 94 | build_dynamic_framework_for_ios(defines, output) 95 | else 96 | build_dynamic_framework_for_mac(defines, output) 97 | end 98 | 99 | copy_resources 100 | end 101 | 102 | def build_dynamic_framework_for_ios(defines, output) 103 | # Specify frameworks to link and search paths 104 | linker_flags = static_linker_flags_in_sandbox 105 | defines = "#{defines} OTHER_LDFLAGS='$(inherited) #{linker_flags.join(' ')}'" 106 | 107 | # Build Target Dynamic Framework for both device and Simulator 108 | device_defines = "#{defines} LIBRARY_SEARCH_PATHS=\"#{Dir.pwd}/#{@static_sandbox_root}/build\"" 109 | device_options = ios_build_options << ' -sdk iphoneos' 110 | xcodebuild(device_defines, device_options, 'build', @spec.name.to_s, @dynamic_sandbox_root.to_s) 111 | 112 | sim_defines = "#{defines} LIBRARY_SEARCH_PATHS=\"#{Dir.pwd}/#{@static_sandbox_root}/build-sim\" ONLY_ACTIVE_ARCH=NO" 113 | xcodebuild(sim_defines, '-sdk iphonesimulator', 'build-sim', @spec.name.to_s, @dynamic_sandbox_root.to_s) 114 | 115 | # Combine architectures 116 | `lipo #{@dynamic_sandbox_root}/build/#{@spec.name}.framework/#{@spec.name} #{@dynamic_sandbox_root}/build-sim/#{@spec.name}.framework/#{@spec.name} -create -output #{output}` 117 | 118 | FileUtils.mkdir(@platform.name.to_s) 119 | `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework #{@platform.name}` 120 | `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework.dSYM #{@platform.name}` 121 | end 122 | 123 | def build_dynamic_framework_for_mac(defines, _output) 124 | # Specify frameworks to link and search paths 125 | linker_flags = static_linker_flags_in_sandbox 126 | defines = "#{defines} OTHER_LDFLAGS=\"#{linker_flags.join(' ')}\"" 127 | 128 | # Build Target Dynamic Framework for osx 129 | defines = "#{defines} LIBRARY_SEARCH_PATHS=\"#{Dir.pwd}/#{@static_sandbox_root}/build\"" 130 | xcodebuild(defines, nil, 'build', @spec.name.to_s, @dynamic_sandbox_root.to_s) 131 | 132 | FileUtils.mkdir(@platform.name.to_s) 133 | `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework #{@platform.name}` 134 | `mv #{@dynamic_sandbox_root}/build/#{@spec.name}.framework.dSYM #{@platform.name}` 135 | end 136 | 137 | def build_sim_libraries(defines) 138 | if @platform.name == :ios 139 | xcodebuild(defines, '-sdk iphonesimulator', 'build-sim') 140 | end 141 | end 142 | 143 | def build_static_library_for_ios(output) 144 | static_libs = static_libs_in_sandbox('build') + static_libs_in_sandbox('build-sim') + vendored_libraries 145 | libs = ios_architectures.map do |arch| 146 | library = "#{@static_sandbox_root}/build/package-#{arch}.a" 147 | `libtool -arch_only #{arch} -static -o #{library} #{static_libs.join(' ')}` 148 | library 149 | end 150 | 151 | `lipo -create -output #{output} #{libs.join(' ')}` 152 | end 153 | 154 | def build_static_library_for_mac(output) 155 | static_libs = static_libs_in_sandbox + vendored_libraries 156 | `libtool -static -o #{output} #{static_libs.join(' ')}` 157 | end 158 | 159 | def build_with_mangling(options) 160 | UI.puts 'Mangling symbols' 161 | defines = Symbols.mangle_for_pod_dependencies(@spec.name, @static_sandbox_root) 162 | defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ') 163 | 164 | UI.puts 'Building mangled framework' 165 | xcodebuild(defines, options) 166 | defines 167 | end 168 | 169 | def clean_directory_for_dynamic_build 170 | # Remove static headers to avoid duplicate declaration conflicts 171 | FileUtils.rm_rf("#{@static_sandbox_root}/Headers/Public/#{@spec.name}") 172 | FileUtils.rm_rf("#{@static_sandbox_root}/Headers/Private/#{@spec.name}") 173 | 174 | # Equivalent to removing derrived data 175 | FileUtils.rm_rf('Pods/build') 176 | end 177 | 178 | def compile 179 | defines = "GCC_PREPROCESSOR_DEFINITIONS='$(inherited) PodsDummy_Pods_#{@spec.name}=PodsDummy_PodPackage_#{@spec.name}'" 180 | defines << ' ' << @spec.consumer(@platform).compiler_flags.join(' ') 181 | 182 | if @platform.name == :ios 183 | options = ios_build_options 184 | end 185 | 186 | xcodebuild(defines, options) 187 | 188 | if @mangle 189 | return build_with_mangling(options) 190 | end 191 | 192 | defines 193 | end 194 | 195 | def copy_headers 196 | headers_source_root = "#{@public_headers_root}/#{@spec.name}" 197 | 198 | Dir.glob("#{headers_source_root}/**/*.h"). 199 | each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` } 200 | 201 | # If custom 'module_map' is specified add it to the framework distribution 202 | # otherwise check if a header exists that is equal to 'spec.name', if so 203 | # create a default 'module_map' one using it. 204 | if !@spec.module_map.nil? 205 | module_map_file = @file_accessors.flat_map(&:module_map).first 206 | module_map = File.read(module_map_file) if Pathname(module_map_file).exist? 207 | elsif File.exist?("#{@public_headers_root}/#{@spec.name}/#{@spec.name}.h") 208 | module_map = <&1` 250 | else 251 | `cp -rp #{bundle_files} #{@fwk.resources_path} 2>&1` 252 | dependency_names = @static_installer.podfile.dependencies.map(&:name) 253 | resources = [@spec, *@spec.recursive_subspecs].flat_map do |spec| 254 | if (dependency_names & [spec.name, @spec.name]).any? 255 | expand_paths(spec.consumer(@platform).resources) 256 | end 257 | end.compact.uniq 258 | 259 | if resources.count == 0 && bundles.count == 0 260 | @fwk.delete_resources 261 | return 262 | end 263 | if resources.count > 0 264 | `cp -rp #{resources.join(' ')} #{@fwk.resources_path}` 265 | end 266 | end 267 | end 268 | 269 | def create_framework 270 | @fwk = Framework::Tree.new(@spec.name, @platform.name.to_s, @embedded) 271 | @fwk.make 272 | end 273 | 274 | def dependency_count 275 | count = @spec.dependencies.count 276 | 277 | @spec.subspecs.each do |subspec| 278 | count += subspec.dependencies.count 279 | end 280 | 281 | count 282 | end 283 | 284 | def expand_paths(path_specs) 285 | path_specs.map do |path_spec| 286 | Dir.glob(File.join(@source_dir, path_spec)) 287 | end 288 | end 289 | 290 | def static_libs_in_sandbox(build_dir = 'build') 291 | if @exclude_deps 292 | UI.puts 'Excluding dependencies' 293 | Dir.glob("#{@static_sandbox_root}/#{build_dir}/lib#{@spec.name}.a") 294 | else 295 | Dir.glob("#{@static_sandbox_root}/#{build_dir}/lib*.a") 296 | end 297 | end 298 | 299 | def vendored_libraries 300 | if @vendored_libraries 301 | @vendored_libraries 302 | end 303 | file_accessors = if @exclude_deps 304 | @file_accessors 305 | else 306 | @static_installer.pod_targets.flat_map(&:file_accessors) 307 | end 308 | libs = file_accessors.flat_map(&:vendored_static_frameworks).map { |f| f + f.basename('.*') } || [] 309 | libs += file_accessors.flat_map(&:vendored_static_libraries) 310 | @vendored_libraries = libs.compact.map(&:to_s) 311 | @vendored_libraries 312 | end 313 | 314 | def static_linker_flags_in_sandbox 315 | linker_flags = static_libs_in_sandbox.map do |lib| 316 | lib.slice!('lib') 317 | lib_flag = lib.chomp('.a').split('/').last 318 | "-l#{lib_flag}" 319 | end 320 | linker_flags.reject { |e| e == "-l#{@spec.name}" || e == '-lPods-packager' } 321 | end 322 | 323 | def ios_build_options 324 | "ARCHS=\'#{ios_architectures.join(' ')}\' OTHER_CFLAGS=\'-fembed-bitcode -Qunused-arguments\'" 325 | end 326 | 327 | def ios_architectures 328 | archs = %w(x86_64 i386 arm64 armv7 armv7s) 329 | vendored_libraries.each do |library| 330 | archs = `lipo -info #{library}`.split & archs 331 | end 332 | archs 333 | end 334 | 335 | def xcodebuild(defines = '', args = '', build_dir = 'build', target = 'Pods-packager', project_root = @static_sandbox_root, config = @config) 336 | if defined?(Pod::DONT_CODESIGN) 337 | args = "#{args} CODE_SIGN_IDENTITY=\"\" CODE_SIGNING_REQUIRED=NO" 338 | end 339 | 340 | command = "xcodebuild #{defines} #{args} CONFIGURATION_BUILD_DIR=#{build_dir} clean build -configuration #{config} -target #{target} -project #{project_root}/Pods.xcodeproj 2>&1" 341 | output = `#{command}`.lines.to_a 342 | 343 | if $?.exitstatus != 0 344 | puts UI::BuildFailedReport.report(command, output) 345 | 346 | # Note: We use `Process.exit` here because it fires a `SystemExit` 347 | # exception, which gives the caller a chance to clean up before the 348 | # process terminates. 349 | # 350 | # See http://ruby-doc.org/core-1.9.3/Process.html#method-c-exit 351 | Process.exit 352 | end 353 | end 354 | end 355 | end 356 | -------------------------------------------------------------------------------- /spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 7CE4CCEF5BF27FD4FBB972EB /* libPods-LibraryConsumer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34AD1A407B865D05B65A5301 /* libPods-LibraryConsumer.a */; }; 11 | 9B89D2E019EFC04D00803D42 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B89D2DF19EFC04D00803D42 /* main.m */; }; 12 | 9B89D2E319EFC04D00803D42 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B89D2E219EFC04D00803D42 /* AppDelegate.m */; }; 13 | /* End PBXBuildFile section */ 14 | 15 | /* Begin PBXFileReference section */ 16 | 0AA277EF1097393AE42174B8 /* Pods-LibraryConsumer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibraryConsumer.release.xcconfig"; path = "Pods/Target Support Files/Pods-LibraryConsumer/Pods-LibraryConsumer.release.xcconfig"; sourceTree = ""; }; 17 | 34AD1A407B865D05B65A5301 /* libPods-LibraryConsumer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LibraryConsumer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 18 | 4A66E303CCF429F9D7C502D1 /* Pods-LibraryConsumer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LibraryConsumer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-LibraryConsumer/Pods-LibraryConsumer.debug.xcconfig"; sourceTree = ""; }; 19 | 9B89D2DA19EFC04D00803D42 /* LibraryConsumer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LibraryConsumer.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | 9B89D2DE19EFC04D00803D42 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 21 | 9B89D2DF19EFC04D00803D42 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 22 | 9B89D2E119EFC04D00803D42 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 23 | 9B89D2E219EFC04D00803D42 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 24 | /* End PBXFileReference section */ 25 | 26 | /* Begin PBXFrameworksBuildPhase section */ 27 | 9B89D2D719EFC04D00803D42 /* Frameworks */ = { 28 | isa = PBXFrameworksBuildPhase; 29 | buildActionMask = 2147483647; 30 | files = ( 31 | 7CE4CCEF5BF27FD4FBB972EB /* libPods-LibraryConsumer.a in Frameworks */, 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | 1CFA5E012476526B947AF945 /* Frameworks */ = { 39 | isa = PBXGroup; 40 | children = ( 41 | 34AD1A407B865D05B65A5301 /* libPods-LibraryConsumer.a */, 42 | ); 43 | name = Frameworks; 44 | sourceTree = ""; 45 | }; 46 | 6DC8E89A3E645F7841B27894 /* Pods */ = { 47 | isa = PBXGroup; 48 | children = ( 49 | 4A66E303CCF429F9D7C502D1 /* Pods-LibraryConsumer.debug.xcconfig */, 50 | 0AA277EF1097393AE42174B8 /* Pods-LibraryConsumer.release.xcconfig */, 51 | ); 52 | name = Pods; 53 | sourceTree = ""; 54 | }; 55 | 9B89D2D119EFC04D00803D42 = { 56 | isa = PBXGroup; 57 | children = ( 58 | 9B89D2DC19EFC04D00803D42 /* LibraryConsumer */, 59 | 9B89D2DB19EFC04D00803D42 /* Products */, 60 | 6DC8E89A3E645F7841B27894 /* Pods */, 61 | 1CFA5E012476526B947AF945 /* Frameworks */, 62 | ); 63 | sourceTree = ""; 64 | }; 65 | 9B89D2DB19EFC04D00803D42 /* Products */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | 9B89D2DA19EFC04D00803D42 /* LibraryConsumer.app */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 9B89D2DC19EFC04D00803D42 /* LibraryConsumer */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 9B89D2E119EFC04D00803D42 /* AppDelegate.h */, 77 | 9B89D2E219EFC04D00803D42 /* AppDelegate.m */, 78 | 9B89D2DD19EFC04D00803D42 /* Supporting Files */, 79 | ); 80 | path = LibraryConsumer; 81 | sourceTree = ""; 82 | }; 83 | 9B89D2DD19EFC04D00803D42 /* Supporting Files */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9B89D2DE19EFC04D00803D42 /* Info.plist */, 87 | 9B89D2DF19EFC04D00803D42 /* main.m */, 88 | ); 89 | name = "Supporting Files"; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | 9B89D2D919EFC04D00803D42 /* LibraryConsumer */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = 9B89D2FD19EFC04D00803D42 /* Build configuration list for PBXNativeTarget "LibraryConsumer" */; 98 | buildPhases = ( 99 | 170A030C4EB518D9349852B9 /* [CP] Check Pods Manifest.lock */, 100 | 9B89D2D619EFC04D00803D42 /* Sources */, 101 | 9B89D2D719EFC04D00803D42 /* Frameworks */, 102 | 9B89D2D819EFC04D00803D42 /* Resources */, 103 | 66E97541EE256003BD711EDA /* [CP] Embed Pods Frameworks */, 104 | DFB55D7B0E04E9E06397977F /* [CP] Copy Pods Resources */, 105 | ); 106 | buildRules = ( 107 | ); 108 | dependencies = ( 109 | ); 110 | name = LibraryConsumer; 111 | productName = LibraryConsumer; 112 | productReference = 9B89D2DA19EFC04D00803D42 /* LibraryConsumer.app */; 113 | productType = "com.apple.product-type.application"; 114 | }; 115 | /* End PBXNativeTarget section */ 116 | 117 | /* Begin PBXProject section */ 118 | 9B89D2D219EFC04D00803D42 /* Project object */ = { 119 | isa = PBXProject; 120 | attributes = { 121 | LastUpgradeCheck = 0600; 122 | ORGANIZATIONNAME = "Shape A/S"; 123 | TargetAttributes = { 124 | 9B89D2D919EFC04D00803D42 = { 125 | CreatedOnToolsVersion = 6.0.1; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = 9B89D2D519EFC04D00803D42 /* Build configuration list for PBXProject "LibraryConsumer" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = 9B89D2D119EFC04D00803D42; 138 | productRefGroup = 9B89D2DB19EFC04D00803D42 /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | 9B89D2D919EFC04D00803D42 /* LibraryConsumer */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | 9B89D2D819EFC04D00803D42 /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | ); 153 | runOnlyForDeploymentPostprocessing = 0; 154 | }; 155 | /* End PBXResourcesBuildPhase section */ 156 | 157 | /* Begin PBXShellScriptBuildPhase section */ 158 | 170A030C4EB518D9349852B9 /* [CP] Check Pods Manifest.lock */ = { 159 | isa = PBXShellScriptBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | ); 163 | inputPaths = ( 164 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 165 | "${PODS_ROOT}/Manifest.lock", 166 | ); 167 | name = "[CP] Check Pods Manifest.lock"; 168 | outputPaths = ( 169 | "$(DERIVED_FILE_DIR)/Pods-LibraryConsumer-checkManifestLockResult.txt", 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | shellPath = /bin/sh; 173 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 174 | showEnvVarsInLog = 0; 175 | }; 176 | 66E97541EE256003BD711EDA /* [CP] Embed Pods Frameworks */ = { 177 | isa = PBXShellScriptBuildPhase; 178 | buildActionMask = 2147483647; 179 | files = ( 180 | ); 181 | inputPaths = ( 182 | ); 183 | name = "[CP] Embed Pods Frameworks"; 184 | outputPaths = ( 185 | ); 186 | runOnlyForDeploymentPostprocessing = 0; 187 | shellPath = /bin/sh; 188 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LibraryConsumer/Pods-LibraryConsumer-frameworks.sh\"\n"; 189 | showEnvVarsInLog = 0; 190 | }; 191 | DFB55D7B0E04E9E06397977F /* [CP] Copy Pods Resources */ = { 192 | isa = PBXShellScriptBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | ); 196 | inputPaths = ( 197 | ); 198 | name = "[CP] Copy Pods Resources"; 199 | outputPaths = ( 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | shellPath = /bin/sh; 203 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-LibraryConsumer/Pods-LibraryConsumer-resources.sh\"\n"; 204 | showEnvVarsInLog = 0; 205 | }; 206 | /* End PBXShellScriptBuildPhase section */ 207 | 208 | /* Begin PBXSourcesBuildPhase section */ 209 | 9B89D2D619EFC04D00803D42 /* Sources */ = { 210 | isa = PBXSourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 9B89D2E319EFC04D00803D42 /* AppDelegate.m in Sources */, 214 | 9B89D2E019EFC04D00803D42 /* main.m in Sources */, 215 | ); 216 | runOnlyForDeploymentPostprocessing = 0; 217 | }; 218 | /* End PBXSourcesBuildPhase section */ 219 | 220 | /* Begin XCBuildConfiguration section */ 221 | 9B89D2FB19EFC04D00803D42 /* Debug */ = { 222 | isa = XCBuildConfiguration; 223 | buildSettings = { 224 | ALWAYS_SEARCH_USER_PATHS = NO; 225 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 226 | CLANG_CXX_LIBRARY = "libc++"; 227 | CLANG_ENABLE_MODULES = YES; 228 | CLANG_ENABLE_OBJC_ARC = YES; 229 | CLANG_WARN_BOOL_CONVERSION = YES; 230 | CLANG_WARN_CONSTANT_CONVERSION = YES; 231 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 232 | CLANG_WARN_EMPTY_BODY = YES; 233 | CLANG_WARN_ENUM_CONVERSION = YES; 234 | CLANG_WARN_INT_CONVERSION = YES; 235 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 236 | CLANG_WARN_UNREACHABLE_CODE = YES; 237 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 238 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 239 | COPY_PHASE_STRIP = NO; 240 | ENABLE_STRICT_OBJC_MSGSEND = YES; 241 | GCC_C_LANGUAGE_STANDARD = gnu99; 242 | GCC_DYNAMIC_NO_PIC = NO; 243 | GCC_OPTIMIZATION_LEVEL = 0; 244 | GCC_PREPROCESSOR_DEFINITIONS = ( 245 | "DEBUG=1", 246 | "$(inherited)", 247 | ); 248 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 256 | MTL_ENABLE_DEBUG_INFO = YES; 257 | ONLY_ACTIVE_ARCH = YES; 258 | SDKROOT = iphoneos; 259 | }; 260 | name = Debug; 261 | }; 262 | 9B89D2FC19EFC04D00803D42 /* Release */ = { 263 | isa = XCBuildConfiguration; 264 | buildSettings = { 265 | ALWAYS_SEARCH_USER_PATHS = NO; 266 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 267 | CLANG_CXX_LIBRARY = "libc++"; 268 | CLANG_ENABLE_MODULES = YES; 269 | CLANG_ENABLE_OBJC_ARC = YES; 270 | CLANG_WARN_BOOL_CONVERSION = YES; 271 | CLANG_WARN_CONSTANT_CONVERSION = YES; 272 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 273 | CLANG_WARN_EMPTY_BODY = YES; 274 | CLANG_WARN_ENUM_CONVERSION = YES; 275 | CLANG_WARN_INT_CONVERSION = YES; 276 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 277 | CLANG_WARN_UNREACHABLE_CODE = YES; 278 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 279 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 280 | COPY_PHASE_STRIP = YES; 281 | ENABLE_NS_ASSERTIONS = NO; 282 | ENABLE_STRICT_OBJC_MSGSEND = YES; 283 | GCC_C_LANGUAGE_STANDARD = gnu99; 284 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 285 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 286 | GCC_WARN_UNDECLARED_SELECTOR = YES; 287 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 288 | GCC_WARN_UNUSED_FUNCTION = YES; 289 | GCC_WARN_UNUSED_VARIABLE = YES; 290 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 291 | MTL_ENABLE_DEBUG_INFO = NO; 292 | SDKROOT = iphoneos; 293 | VALIDATE_PRODUCT = YES; 294 | }; 295 | name = Release; 296 | }; 297 | 9B89D2FE19EFC04D00803D42 /* Debug */ = { 298 | isa = XCBuildConfiguration; 299 | baseConfigurationReference = 4A66E303CCF429F9D7C502D1 /* Pods-LibraryConsumer.debug.xcconfig */; 300 | buildSettings = { 301 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 302 | INFOPLIST_FILE = LibraryConsumer/Info.plist; 303 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | }; 306 | name = Debug; 307 | }; 308 | 9B89D2FF19EFC04D00803D42 /* Release */ = { 309 | isa = XCBuildConfiguration; 310 | baseConfigurationReference = 0AA277EF1097393AE42174B8 /* Pods-LibraryConsumer.release.xcconfig */; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | INFOPLIST_FILE = LibraryConsumer/Info.plist; 314 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 315 | PRODUCT_NAME = "$(TARGET_NAME)"; 316 | }; 317 | name = Release; 318 | }; 319 | /* End XCBuildConfiguration section */ 320 | 321 | /* Begin XCConfigurationList section */ 322 | 9B89D2D519EFC04D00803D42 /* Build configuration list for PBXProject "LibraryConsumer" */ = { 323 | isa = XCConfigurationList; 324 | buildConfigurations = ( 325 | 9B89D2FB19EFC04D00803D42 /* Debug */, 326 | 9B89D2FC19EFC04D00803D42 /* Release */, 327 | ); 328 | defaultConfigurationIsVisible = 0; 329 | defaultConfigurationName = Release; 330 | }; 331 | 9B89D2FD19EFC04D00803D42 /* Build configuration list for PBXNativeTarget "LibraryConsumer" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 9B89D2FE19EFC04D00803D42 /* Debug */, 335 | 9B89D2FF19EFC04D00803D42 /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | /* End XCConfigurationList section */ 341 | }; 342 | rootObject = 9B89D2D219EFC04D00803D42 /* Project object */; 343 | } 344 | -------------------------------------------------------------------------------- /spec/command/package_spec.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../../spec_helper', __FILE__) 2 | 3 | module Pod 4 | 5 | DONT_CODESIGN = true 6 | 7 | describe Command::Spec::Package do 8 | describe 'CLAide' do 9 | after do 10 | Dir.glob("Archs-*").each { |dir| Pathname.new(dir).rmtree } 11 | Dir.glob("CPDColors-*").each { |dir| Pathname.new(dir).rmtree } 12 | Dir.glob("KFData-*").each { |dir| Pathname.new(dir).rmtree } 13 | Dir.glob("NikeKit-*").each { |dir| Pathname.new(dir).rmtree } 14 | Dir.glob("LocalNikeKit-*").each { |dir| Pathname.new(dir).rmtree } 15 | Dir.glob("foo-bar-*").each { |dir| Pathname.new(dir).rmtree } 16 | Dir.glob("a-*").each { |dir| Pathname.new(dir).rmtree } 17 | Dir.glob("FH-*").each { |dir| Pathname.new(dir).rmtree } 18 | Dir.glob("FirebaseAnalytics-*").each { |dir| Pathname.new(dir).rmtree } 19 | end 20 | 21 | it 'registers itself' do 22 | Command.parse(%w{ package }).should.be.instance_of Command::Package 23 | end 24 | 25 | it 'presents the help if no spec is provided' do 26 | command = Command.parse(%w{ package }) 27 | should.raise CLAide::Help do 28 | command.validate! 29 | end.message.should.match /required/ 30 | end 31 | 32 | it "errors if it cannot find a spec" do 33 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 34 | 35 | command = Command.parse(%w{ package KFData }) 36 | should.raise CLAide::Help do 37 | command.run 38 | end.message.should.match /Unable to find/ 39 | end 40 | 41 | 42 | it "should produce a dynamic library when dynamic is specified" do 43 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 44 | 45 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 46 | command.run 47 | 48 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 49 | file_command = "file #{lib}" 50 | output = `#{file_command}`.lines.to_a 51 | 52 | output[0].should.match /Mach-O universal binary with 5 architectures/ 53 | output[1].should.match /Mach-O dynamically linked shared library i386/ 54 | end 55 | 56 | it "should produce a dSYM when dynamic is specified" do 57 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 58 | 59 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 60 | command.run 61 | 62 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework.dSYM/Contents/Resources/DWARF/NikeKit").first 63 | file_command = "file #{lib}" 64 | output = `#{file_command}`.lines.to_a 65 | 66 | output[0].should.match /Mach-O universal binary with 3 architectures/ 67 | output[1].should.match /Mach-O dSYM companion file arm/ 68 | end 69 | 70 | it "should link category symbols when dynamic is specified" do 71 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 72 | 73 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 74 | command.run 75 | 76 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 77 | file_command = "nm #{lib}" 78 | output = `#{file_command}`.lines.to_a 79 | 80 | match = output.detect { |line| line =~ /UIButton\(AFNetworking\)/ } 81 | match.should.not.be.empty 82 | end 83 | 84 | it "should produce a dynamic library for OSX when dynamic is specified" do 85 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 86 | 87 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --dynamic }) 88 | command.run 89 | 90 | lib = Dir.glob("KFData-*/osx/KFData.framework/KFData").first 91 | file_command = "file #{lib}" 92 | output = `#{file_command}`.lines.to_a 93 | 94 | output[0].should.match /Mach-O 64-bit dynamically linked shared library x86_64/ 95 | end 96 | 97 | it "should produce a dSYM for OSX when dynamic is specified" do 98 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 99 | 100 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --dynamic }) 101 | command.run 102 | 103 | lib = Dir.glob("KFData-*/osx/KFData.framework.dSYM/Contents/Resources/DWARF/KFData").first 104 | file_command = "file #{lib}" 105 | output = `#{file_command}`.lines.to_a 106 | 107 | output[0].should.match /Mach-O 64-bit dSYM companion file x86_64/ 108 | end 109 | 110 | it "should produce the default plist for iOS and OSX when --dynamic is specified but --bundle-identifier is not" do 111 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 112 | 113 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --dynamic}) 114 | command.run 115 | 116 | ios_plist = File.expand_path(Dir.glob("KFData-*/ios/KFData.framework/Info.plist").first) 117 | osx_plist = File.expand_path(Dir.glob("KFData-*/osx/KFData.framework/Resources/Info.plist").first) 118 | 119 | ios_bundle_id = `defaults read #{ios_plist} CFBundleIdentifier` 120 | osx_bundle_id = `defaults read #{osx_plist} CFBundleIdentifier` 121 | 122 | ios_bundle_id.should.match /org.cocoapods.KFData/ 123 | osx_bundle_id.should.match /org.cocoapods.KFData/ 124 | end 125 | 126 | it "should produce the correct plist for iOS and OSX when --dynamic and --bundle-identifier are specified" do 127 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 128 | 129 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec --dynamic --bundle-identifier=com.example.KFData}) 130 | command.run 131 | 132 | ios_plist = File.expand_path(Dir.glob("KFData-*/ios/KFData.framework/Info.plist").first) 133 | osx_plist = File.expand_path(Dir.glob("KFData-*/osx/KFData.framework/Resources/Info.plist").first) 134 | 135 | ios_bundle_id = `defaults read #{ios_plist} CFBundleIdentifier` 136 | osx_bundle_id = `defaults read #{osx_plist} CFBundleIdentifier` 137 | 138 | ios_bundle_id.should.match /com.example.KFData/ 139 | osx_bundle_id.should.match /com.example.KFData/ 140 | end 141 | 142 | it "should produce a static library when dynamic is not specified" do 143 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 144 | 145 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 146 | command.run 147 | 148 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 149 | file_command = "file #{lib}" 150 | output = `#{file_command}`.lines.to_a 151 | 152 | output[0].should.match /Mach-O universal binary with 5 architectures/ 153 | output[1].should.match /current ar archive/ 154 | end 155 | 156 | it "produces package using local sources when --local is specified" do 157 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 158 | 159 | command = Command.parse(%w{ package spec/fixtures/LocalSources/LocalNikeKit.podspec --local}) 160 | command.run 161 | 162 | lib = Dir.glob("LocalNikeKit-*/ios/LocalNikeKit.framework/LocalNikeKit").first 163 | symbols = Symbols.symbols_from_library(lib) 164 | symbols.should.include('LocalNikeKit') 165 | symbols.should.not.include('BBUNikePlusActivity') 166 | end 167 | 168 | it "includes vendor symbols both from itself and pod dependencies" do 169 | command = Command.parse(%w{ package FirebaseAnalytics --no-mangle }) 170 | command.run 171 | 172 | lib = Dir.glob("FirebaseAnalytics-*/ios/FirebaseAnalytics.framework/FirebaseAnalytics").first 173 | symbols = Symbols.symbols_from_library(lib) 174 | # from itself 175 | symbols.should.include('FIRAnalytics') 176 | # from pod dependency 177 | symbols.should.include('FIRApp') 178 | end 179 | 180 | it "does not include vendor symbols from pod dependencies if option --exclude-deps is specified" do 181 | command = Command.parse(%w{ package FirebaseAnalytics --no-mangle --exclude-deps}) 182 | command.run 183 | 184 | lib = Dir.glob("FirebaseAnalytics-*/ios/FirebaseAnalytics.framework/FirebaseAnalytics").first 185 | symbols = Symbols.symbols_from_library(lib) 186 | # from itself 187 | symbols.should.include('FIRAnalytics') 188 | # from pod dependency 189 | symbols.should.not.include('FIRApp') 190 | end 191 | 192 | it "includes only available architectures when packaging an iOS Pod with binary dependencies" do 193 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 194 | 195 | command = Command.parse(%w{ package spec/fixtures/Archs.podspec --no-mangle }) 196 | command.run 197 | 198 | lib = Dir.glob("Archs-*/ios/Archs.framework/Archs").first 199 | `lipo #{lib} -verify_arch x86_64 i386 armv7 arm64` 200 | $?.success?.should == true 201 | end 202 | 203 | it "mangles symbols if the Pod has dependencies" do 204 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 205 | 206 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 207 | command.run 208 | 209 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 210 | symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /PodNikeKit/ } 211 | 212 | symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager 213 | BBUNikePlusTag } 214 | end 215 | 216 | it "mangles symbols if the Pod has dependencies and framework is dynamic" do 217 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 218 | 219 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 220 | command.run 221 | 222 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 223 | symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /PodNikeKit/ } 224 | 225 | symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager 226 | BBUNikePlusTag NikeKitVersionNumber NikeKitVersionString } 227 | end 228 | 229 | it "mangles symbols if the Pod has dependencies regardless of name" do 230 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 231 | 232 | command = Command.parse(%w{ package spec/fixtures/a.podspec }) 233 | command.run 234 | 235 | lib = Dir.glob("a-*/ios/a.framework/a").first 236 | symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /Poda/ } 237 | symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager 238 | BBUNikePlusTag } 239 | end 240 | 241 | it "does not mangle symbols if option --no-mangle is specified" do 242 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 243 | 244 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --no-mangle }) 245 | command.run 246 | 247 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 248 | symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /PodNikeKit/ } 249 | symbols.should == [] 250 | end 251 | 252 | it "does not mangle symbols if option --no-mangle and --dynamic are specified" do 253 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 254 | 255 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --no-mangle --dynamic }) 256 | command.run 257 | 258 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 259 | symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /PodNikeKit/ } 260 | symbols.should == [] 261 | end 262 | 263 | it "does not include symbols from dependencies if option --exclude-deps is specified" do 264 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 265 | 266 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --exclude-deps }) 267 | command.run 268 | 269 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 270 | symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /AFNetworking|ISO8601DateFormatter|KZPropertyMapper/ } 271 | symbols.should == [] 272 | end 273 | 274 | it "includes the correct architectures when packaging an iOS Pod" do 275 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 276 | 277 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 278 | command.run 279 | 280 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 281 | `lipo #{lib} -verify_arch x86_64 i386 armv7 armv7s arm64` 282 | $?.success?.should == true 283 | end 284 | 285 | it "includes the correct architectures when packaging an iOS Pod as --dynamic" do 286 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 287 | 288 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 289 | command.run 290 | 291 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 292 | `lipo #{lib} -verify_arch armv7 armv7s arm64` 293 | $?.success?.should == true 294 | end 295 | 296 | it "includes Bitcode for device arch slices when packaging an iOS Pod" do 297 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 298 | 299 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 300 | command.run 301 | 302 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 303 | 304 | #Check for __LLVM segment in each device architecture 305 | `lipo -extract armv7 #{lib} -o armv7.a && otool -l armv7.a`.should.match /__LLVM/ 306 | `lipo -extract armv7s #{lib} -o armv7s.a && otool -l armv7s.a`.should.match /__LLVM/ 307 | `lipo -extract arm64 #{lib} -o arm64.a && otool -l arm64.a`.should.match /__LLVM/ 308 | `rm armv7.a armv7s.a arm64.a` 309 | end 310 | 311 | it "includes Bitcode for device arch slices when packaging an dynamic iOS Pod" do 312 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 313 | 314 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 315 | command.run 316 | 317 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 318 | 319 | #Check for __LLVM segment in each device architecture 320 | `lipo -extract armv7 #{lib} -o armv7.a && otool -l armv7.a`.should.match /__LLVM/ 321 | `lipo -extract armv7s #{lib} -o armv7s.a && otool -l armv7s.a`.should.match /__LLVM/ 322 | `lipo -extract arm64 #{lib} -o arm64.a && otool -l arm64.a`.should.match /__LLVM/ 323 | `rm armv7.a armv7s.a arm64.a` 324 | end 325 | 326 | it "does not include Bitcode for simulator arch slices when packaging an iOS Pod" do 327 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 328 | 329 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 330 | command.run 331 | 332 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 333 | 334 | #Check for __LLVM segment in each simulator architecture 335 | `lipo -extract i386 #{lib} -o i386.a && otool -l i386.a`.should.not.match /__LLVM/ 336 | `lipo -extract x86_64 #{lib} -o x86_64.a && otool -l x86_64.a`.should.not.match /__LLVM/ 337 | `rm i386.a x86_64.a` 338 | end 339 | 340 | it "does not include Bitcode for simulator arch slices when packaging an dynamic iOS Pod" do 341 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 342 | 343 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec --dynamic }) 344 | command.run 345 | 346 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 347 | 348 | #Check for __LLVM segment in each simulator architecture 349 | `lipo -extract i386 #{lib} -o i386.a && otool -l i386.a`.should.not.match /__LLVM/ 350 | `lipo -extract x86_64 #{lib} -o x86_64.a && otool -l x86_64.a`.should.not.match /__LLVM/ 351 | `rm i386.a x86_64.a` 352 | end 353 | 354 | it "does not include local ModuleCache references" do 355 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 356 | 357 | command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec }) 358 | command.run 359 | 360 | lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first 361 | 362 | #Check for ModuleCache references 363 | `strings #{lib}`.should.not.match /ModuleCache/ 364 | end 365 | 366 | it "does not fail when the pod name contains a dash" do 367 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 368 | 369 | command = Command.parse(%w{ package spec/fixtures/foo-bar.podspec }) 370 | command.run 371 | 372 | true.should == true # To make the test pass without any shoulds 373 | end 374 | 375 | it "runs with a path to a spec" do 376 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 377 | 378 | command = Command.parse(%w{ package spec/fixtures/KFData.podspec }) 379 | command.run 380 | 381 | true.should == true # To make the test pass without any shoulds 382 | end 383 | 384 | it "it respects module_map directive" do 385 | Pod::Config.instance.sources_manager.stubs(:search).returns(nil) 386 | 387 | command = Command.parse(%w{ package spec/fixtures/FH.podspec }) 388 | command.run 389 | 390 | modulemap_contents = File.read(Dir.glob("FH-*/ios/FH.framework/Modules/module.modulemap").first) 391 | module_map = < /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 278 | showEnvVarsInLog = 0; 279 | }; 280 | E32FAE278D58BC5B3F788CE7 /* [CP] Embed Pods Frameworks */ = { 281 | isa = PBXShellScriptBuildPhase; 282 | buildActionMask = 2147483647; 283 | files = ( 284 | ); 285 | inputPaths = ( 286 | ); 287 | name = "[CP] Embed Pods Frameworks"; 288 | outputPaths = ( 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | shellPath = /bin/sh; 292 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PackagerTest/Pods-PackagerTest-frameworks.sh\"\n"; 293 | showEnvVarsInLog = 0; 294 | }; 295 | E4E1E4640AC6D4A3D67EC563 /* [CP] Copy Pods Resources */ = { 296 | isa = PBXShellScriptBuildPhase; 297 | buildActionMask = 2147483647; 298 | files = ( 299 | ); 300 | inputPaths = ( 301 | ); 302 | name = "[CP] Copy Pods Resources"; 303 | outputPaths = ( 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PackagerTest/Pods-PackagerTest-resources.sh\"\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | /* End PBXShellScriptBuildPhase section */ 311 | 312 | /* Begin PBXSourcesBuildPhase section */ 313 | A1DE56B119AA4A97000339C6 /* Sources */ = { 314 | isa = PBXSourcesBuildPhase; 315 | buildActionMask = 2147483647; 316 | files = ( 317 | A1DE56C919AA4A97000339C6 /* CPDAppDelegate.m in Sources */, 318 | A1DE56C519AA4A97000339C6 /* main.m in Sources */, 319 | ); 320 | runOnlyForDeploymentPostprocessing = 0; 321 | }; 322 | A1DE56CC19AA4A97000339C6 /* Sources */ = { 323 | isa = PBXSourcesBuildPhase; 324 | buildActionMask = 2147483647; 325 | files = ( 326 | A1DE56DE19AA4A97000339C6 /* PackagerTestTests.m in Sources */, 327 | ); 328 | runOnlyForDeploymentPostprocessing = 0; 329 | }; 330 | /* End PBXSourcesBuildPhase section */ 331 | 332 | /* Begin PBXTargetDependency section */ 333 | A1DE56D619AA4A97000339C6 /* PBXTargetDependency */ = { 334 | isa = PBXTargetDependency; 335 | target = A1DE56B419AA4A97000339C6 /* PackagerTest */; 336 | targetProxy = A1DE56D519AA4A97000339C6 /* PBXContainerItemProxy */; 337 | }; 338 | /* End PBXTargetDependency section */ 339 | 340 | /* Begin PBXVariantGroup section */ 341 | A1DE56C119AA4A97000339C6 /* InfoPlist.strings */ = { 342 | isa = PBXVariantGroup; 343 | children = ( 344 | A1DE56C219AA4A97000339C6 /* en */, 345 | ); 346 | name = InfoPlist.strings; 347 | sourceTree = ""; 348 | }; 349 | A1DE56DA19AA4A97000339C6 /* InfoPlist.strings */ = { 350 | isa = PBXVariantGroup; 351 | children = ( 352 | A1DE56DB19AA4A97000339C6 /* en */, 353 | ); 354 | name = InfoPlist.strings; 355 | sourceTree = ""; 356 | }; 357 | /* End PBXVariantGroup section */ 358 | 359 | /* Begin XCBuildConfiguration section */ 360 | A1DE56DF19AA4A97000339C6 /* Debug */ = { 361 | isa = XCBuildConfiguration; 362 | buildSettings = { 363 | ALWAYS_SEARCH_USER_PATHS = NO; 364 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 365 | CLANG_CXX_LIBRARY = "libc++"; 366 | CLANG_ENABLE_MODULES = YES; 367 | CLANG_ENABLE_OBJC_ARC = YES; 368 | CLANG_WARN_BOOL_CONVERSION = YES; 369 | CLANG_WARN_CONSTANT_CONVERSION = YES; 370 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 371 | CLANG_WARN_EMPTY_BODY = YES; 372 | CLANG_WARN_ENUM_CONVERSION = YES; 373 | CLANG_WARN_INT_CONVERSION = YES; 374 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 375 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 376 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 377 | COPY_PHASE_STRIP = NO; 378 | GCC_C_LANGUAGE_STANDARD = gnu99; 379 | GCC_DYNAMIC_NO_PIC = NO; 380 | GCC_OPTIMIZATION_LEVEL = 0; 381 | GCC_PREPROCESSOR_DEFINITIONS = ( 382 | "DEBUG=1", 383 | "$(inherited)", 384 | ); 385 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 386 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 387 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 388 | GCC_WARN_UNDECLARED_SELECTOR = YES; 389 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 390 | GCC_WARN_UNUSED_FUNCTION = YES; 391 | GCC_WARN_UNUSED_VARIABLE = YES; 392 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 393 | ONLY_ACTIVE_ARCH = YES; 394 | SDKROOT = iphoneos; 395 | }; 396 | name = Debug; 397 | }; 398 | A1DE56E019AA4A97000339C6 /* Release */ = { 399 | isa = XCBuildConfiguration; 400 | buildSettings = { 401 | ALWAYS_SEARCH_USER_PATHS = NO; 402 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 403 | CLANG_CXX_LIBRARY = "libc++"; 404 | CLANG_ENABLE_MODULES = YES; 405 | CLANG_ENABLE_OBJC_ARC = YES; 406 | CLANG_WARN_BOOL_CONVERSION = YES; 407 | CLANG_WARN_CONSTANT_CONVERSION = YES; 408 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 409 | CLANG_WARN_EMPTY_BODY = YES; 410 | CLANG_WARN_ENUM_CONVERSION = YES; 411 | CLANG_WARN_INT_CONVERSION = YES; 412 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 413 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 414 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 415 | COPY_PHASE_STRIP = YES; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | GCC_C_LANGUAGE_STANDARD = gnu99; 418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 420 | GCC_WARN_UNDECLARED_SELECTOR = YES; 421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 422 | GCC_WARN_UNUSED_FUNCTION = YES; 423 | GCC_WARN_UNUSED_VARIABLE = YES; 424 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 425 | SDKROOT = iphoneos; 426 | VALIDATE_PRODUCT = YES; 427 | }; 428 | name = Release; 429 | }; 430 | A1DE56E219AA4A97000339C6 /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | baseConfigurationReference = A0F1D7427B53DCDF0F9C99C4 /* Pods-PackagerTest.debug.xcconfig */; 433 | buildSettings = { 434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 435 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 436 | FRAMEWORK_SEARCH_PATHS = ( 437 | "$(inherited)", 438 | "$(PROJECT_DIR)", 439 | ); 440 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 441 | GCC_PREFIX_HEADER = "PackagerTest/PackagerTest-Prefix.pch"; 442 | INFOPLIST_FILE = "PackagerTest/PackagerTest-Info.plist"; 443 | PRODUCT_NAME = "$(TARGET_NAME)"; 444 | WRAPPER_EXTENSION = app; 445 | }; 446 | name = Debug; 447 | }; 448 | A1DE56E319AA4A97000339C6 /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | baseConfigurationReference = 551F7332E67FB33B4FD37276 /* Pods-PackagerTest.release.xcconfig */; 451 | buildSettings = { 452 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 453 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 454 | FRAMEWORK_SEARCH_PATHS = ( 455 | "$(inherited)", 456 | "$(PROJECT_DIR)", 457 | ); 458 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 459 | GCC_PREFIX_HEADER = "PackagerTest/PackagerTest-Prefix.pch"; 460 | INFOPLIST_FILE = "PackagerTest/PackagerTest-Info.plist"; 461 | PRODUCT_NAME = "$(TARGET_NAME)"; 462 | WRAPPER_EXTENSION = app; 463 | }; 464 | name = Release; 465 | }; 466 | A1DE56E519AA4A97000339C6 /* Debug */ = { 467 | isa = XCBuildConfiguration; 468 | buildSettings = { 469 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/PackagerTest.app/PackagerTest"; 470 | FRAMEWORK_SEARCH_PATHS = ( 471 | "$(SDKROOT)/Developer/Library/Frameworks", 472 | "$(inherited)", 473 | "$(DEVELOPER_FRAMEWORKS_DIR)", 474 | ); 475 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 476 | GCC_PREFIX_HEADER = "PackagerTest/PackagerTest-Prefix.pch"; 477 | GCC_PREPROCESSOR_DEFINITIONS = ( 478 | "DEBUG=1", 479 | "$(inherited)", 480 | ); 481 | INFOPLIST_FILE = "PackagerTestTests/PackagerTestTests-Info.plist"; 482 | PRODUCT_NAME = "$(TARGET_NAME)"; 483 | TEST_HOST = "$(BUNDLE_LOADER)"; 484 | WRAPPER_EXTENSION = xctest; 485 | }; 486 | name = Debug; 487 | }; 488 | A1DE56E619AA4A97000339C6 /* Release */ = { 489 | isa = XCBuildConfiguration; 490 | buildSettings = { 491 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/PackagerTest.app/PackagerTest"; 492 | FRAMEWORK_SEARCH_PATHS = ( 493 | "$(SDKROOT)/Developer/Library/Frameworks", 494 | "$(inherited)", 495 | "$(DEVELOPER_FRAMEWORKS_DIR)", 496 | ); 497 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 498 | GCC_PREFIX_HEADER = "PackagerTest/PackagerTest-Prefix.pch"; 499 | INFOPLIST_FILE = "PackagerTestTests/PackagerTestTests-Info.plist"; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | TEST_HOST = "$(BUNDLE_LOADER)"; 502 | WRAPPER_EXTENSION = xctest; 503 | }; 504 | name = Release; 505 | }; 506 | /* End XCBuildConfiguration section */ 507 | 508 | /* Begin XCConfigurationList section */ 509 | A1DE56B019AA4A97000339C6 /* Build configuration list for PBXProject "PackagerTest" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | A1DE56DF19AA4A97000339C6 /* Debug */, 513 | A1DE56E019AA4A97000339C6 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | A1DE56E119AA4A97000339C6 /* Build configuration list for PBXNativeTarget "PackagerTest" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | A1DE56E219AA4A97000339C6 /* Debug */, 522 | A1DE56E319AA4A97000339C6 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | A1DE56E419AA4A97000339C6 /* Build configuration list for PBXNativeTarget "PackagerTestTests" */ = { 528 | isa = XCConfigurationList; 529 | buildConfigurations = ( 530 | A1DE56E519AA4A97000339C6 /* Debug */, 531 | A1DE56E619AA4A97000339C6 /* Release */, 532 | ); 533 | defaultConfigurationIsVisible = 0; 534 | defaultConfigurationName = Release; 535 | }; 536 | /* End XCConfigurationList section */ 537 | }; 538 | rootObject = A1DE56AD19AA4A97000339C6 /* Project object */; 539 | } 540 | --------------------------------------------------------------------------------