cocoapods-packager 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -1
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +49 -46
  5. data/Podfile.lock +14 -0
  6. data/lib/cocoapods-packager/builder.rb +36 -10
  7. data/lib/cocoapods-packager/framework.rb +2 -0
  8. data/lib/cocoapods-packager/pod_utils.rb +9 -0
  9. data/lib/cocoapods-packager/symbols.rb +1 -2
  10. data/lib/cocoapods_packager.rb +1 -1
  11. data/lib/pod/command/package.rb +1 -1
  12. data/spec/command/error_spec.rb +8 -0
  13. data/spec/command/package_spec.rb +11 -0
  14. data/spec/fixtures/KFData.podspec +11 -2
  15. data/spec/fixtures/LibraryConsumerDemo/.gitignore +22 -0
  16. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.pbxproj +324 -0
  17. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  18. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/xcshareddata/xcschemes/LibraryConsumer.xcscheme +100 -0
  19. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.h +17 -0
  20. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.m +26 -0
  21. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/Info.plist +40 -0
  22. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/main.m +16 -0
  23. data/spec/fixtures/LibraryConsumerDemo/Podfile +1 -0
  24. data/spec/fixtures/LibraryDemo.podspec +12 -0
  25. data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/xcshareddata/xcschemes/PackagerTest.xcscheme +110 -0
  26. data/spec/fixtures/PackagerTest/Podfile.lock +7 -7
  27. data/spec/fixtures/Weakly.podspec +13 -0
  28. data/spec/integration/project_spec.rb +26 -4
  29. metadata +40 -13
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f68350cb77545ef11604ac7139398932e10ca6f8
4
- data.tar.gz: 747890a043aeb9cdefb008c0e1c6142c798991fd
3
+ metadata.gz: 8c849b6abc14bda5bbe67353b6bb80761e86257e
4
+ data.tar.gz: bac5200f10d47f6d6ce3ff83eaa6ac1ead83a4b1
5
5
  SHA512:
6
- metadata.gz: 33e98e575824bc64a7b46faaa6b73e5cf0cb54f96a0ea1efadbb6cfa5b9d550e57ec82e27a02d334ed9fe2d47006e5dcab06077175144106c4dffac01edfaba9
7
- data.tar.gz: c7257bec6e11d1274f0b2e8319129d1e0ab17eb44a2f9121fded44b6b2b87ee093ae3f2881288ed8e73ec07a4f95d0536b9e6f9bfa762171f8e2ce22cf5ba447
6
+ metadata.gz: 74c98ae789aad82d5beb092396f3c475277cd8f6f205ca7f6f1b65b6a70c5191d1093003b7cfd261e8907262197518c698925f628fad239f8a493eebac65cb72
7
+ data.tar.gz: f61e462a0a2040893f03a1bbf013d77984161a46342d2aee2efeb8f1c26dcf082f07d2f8f608fef29479d350198383ce711b35d4a9931f21c6f27c8d019bd958
@@ -1,4 +1,6 @@
1
1
  language: objective-c
2
2
  cache: bundler
3
- before_install: bundle install
3
+ before_install:
4
+ - bundle install
5
+ - bundle exec pod repo update --silent
4
6
  script: bundle exec rake specs
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  group :development do
6
- gem 'cocoapods', '>= 0.34.0'
6
+ gem 'cocoapods', '>= 0.36.0'
7
7
  gem 'bacon'
8
8
  gem 'mocha-on-bacon'
9
9
  gem 'mocha', '~> 0.11.4'
@@ -9,82 +9,85 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- cocoapods-packager (1.1.0)
12
+ cocoapods-packager (1.1.1)
13
13
 
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- CFPropertyList (2.2.8)
18
- activesupport (3.2.19)
19
- i18n (~> 0.6, >= 0.6.4)
20
- multi_json (~> 1.0)
17
+ activesupport (4.2.0)
18
+ i18n (~> 0.7)
19
+ json (~> 1.7, >= 1.7.7)
20
+ minitest (~> 5.1)
21
+ thread_safe (~> 0.3, >= 0.3.4)
22
+ tzinfo (~> 1.1)
21
23
  bacon (1.2.0)
22
- claide (0.7.0)
23
- cocoapods (0.34.0)
24
- activesupport (>= 3.2.15, < 4)
25
- claide (~> 0.7.0)
26
- cocoapods-core (= 0.34.0)
27
- cocoapods-downloader (~> 0.7.0)
28
- cocoapods-plugins (~> 0.3.1)
29
- cocoapods-trunk (~> 0.2.0)
30
- cocoapods-try (~> 0.4.0)
24
+ claide (0.8.1)
25
+ cocoapods (0.36.0)
26
+ activesupport (>= 3.2.15)
27
+ claide (~> 0.8.1)
28
+ cocoapods-core (= 0.36.0)
29
+ cocoapods-downloader (~> 0.8.1)
30
+ cocoapods-plugins (~> 0.4.1)
31
+ cocoapods-trunk (~> 0.6.0)
32
+ cocoapods-try (~> 0.4.3)
31
33
  colored (~> 1.2)
32
34
  escape (~> 0.0.4)
33
- json_pure (~> 1.8)
35
+ molinillo (~> 0.2.1)
34
36
  nap (~> 0.8)
35
37
  open4 (~> 1.3)
36
- xcodeproj (~> 0.19.2)
37
- cocoapods-core (0.34.0)
38
+ xcodeproj (~> 0.23.0)
39
+ cocoapods-core (0.36.0)
38
40
  activesupport (>= 3.2.15)
39
41
  fuzzy_match (~> 2.0.4)
40
- json_pure (~> 1.8)
41
42
  nap (~> 0.8.0)
42
- cocoapods-downloader (0.7.0)
43
- cocoapods-plugins (0.3.1)
43
+ cocoapods-downloader (0.8.1)
44
+ cocoapods-plugins (0.4.1)
44
45
  nap
45
- cocoapods-trunk (0.2.0)
46
- json_pure (~> 1.8)
46
+ cocoapods-trunk (0.6.0)
47
47
  nap (>= 0.8)
48
- netrc
49
- cocoapods-try (0.4.0)
48
+ netrc (= 0.7.8)
49
+ cocoapods-try (0.4.3)
50
50
  colored (1.2)
51
- coveralls (0.7.1)
51
+ coveralls (0.7.2)
52
52
  multi_json (~> 1.3)
53
- rest-client
53
+ rest-client (= 1.6.7)
54
54
  simplecov (>= 0.7)
55
- term-ansicolor
56
- thor
55
+ term-ansicolor (= 1.2.2)
56
+ thor (= 0.18.1)
57
57
  docile (1.1.5)
58
58
  escape (0.0.4)
59
59
  fuzzy_match (2.0.4)
60
- i18n (0.6.11)
61
- json_pure (1.8.1)
60
+ i18n (0.7.0)
61
+ json (1.8.2)
62
62
  metaclass (0.0.4)
63
- mime-types (2.3)
63
+ mime-types (2.4.3)
64
+ minitest (5.5.1)
64
65
  mocha (0.11.4)
65
66
  metaclass (~> 0.0.1)
66
67
  mocha-on-bacon (0.2.1)
67
68
  mocha (>= 0.9.8)
69
+ molinillo (0.2.1)
68
70
  multi_json (1.10.1)
69
71
  nap (0.8.0)
70
- netrc (0.7.7)
72
+ netrc (0.7.8)
71
73
  open4 (1.3.4)
72
- rake (10.3.2)
73
- rest-client (1.7.2)
74
- mime-types (>= 1.16, < 3.0)
75
- netrc (~> 0.7)
76
- simplecov (0.9.0)
74
+ rake (10.4.2)
75
+ rest-client (1.6.7)
76
+ mime-types (>= 1.16)
77
+ simplecov (0.9.1)
77
78
  docile (~> 1.1.0)
78
- multi_json
79
+ multi_json (~> 1.0)
79
80
  simplecov-html (~> 0.8.0)
80
81
  simplecov-html (0.8.0)
81
- term-ansicolor (1.3.0)
82
- tins (~> 1.0)
83
- thor (0.19.1)
84
- tins (1.3.3)
85
- xcodeproj (0.19.2)
86
- CFPropertyList (~> 2.2)
87
- activesupport (~> 3.0)
82
+ term-ansicolor (1.2.2)
83
+ tins (~> 0.8)
84
+ thor (0.18.1)
85
+ thread_safe (0.3.4)
86
+ tins (0.13.2)
87
+ tzinfo (1.2.2)
88
+ thread_safe (~> 0.1)
89
+ xcodeproj (0.23.0)
90
+ activesupport (>= 3)
88
91
  colored (~> 1.2)
89
92
 
90
93
  PLATFORMS
@@ -93,7 +96,7 @@ PLATFORMS
93
96
  DEPENDENCIES
94
97
  bacon
95
98
  bundler (~> 1.3)
96
- cocoapods (>= 0.34.0)
99
+ cocoapods (>= 0.36.0)
97
100
  cocoapods-packager!
98
101
  coveralls
99
102
  mocha (~> 0.11.4)
@@ -0,0 +1,14 @@
1
+ PODS:
2
+ - LibraryDemo (1.0.0)
3
+
4
+ DEPENDENCIES:
5
+ - LibraryDemo (from `LibraryDemo.podspec`)
6
+
7
+ EXTERNAL SOURCES:
8
+ LibraryDemo:
9
+ :podspec: LibraryDemo.podspec
10
+
11
+ SPEC CHECKSUMS:
12
+ LibraryDemo: 45c4165cee78755e6ac7952f1af2a3d85a6c5fc3
13
+
14
+ COCOAPODS: 0.36.0
@@ -20,7 +20,7 @@ module Pod
20
20
  def build_static_library(platform)
21
21
  UI.puts('Building static library')
22
22
 
23
- defines = compile
23
+ defines = compile(platform)
24
24
  platform_path = Pathname.new(platform.name.to_s)
25
25
  platform_path.mkdir unless platform_path.exist?
26
26
  build_library(platform, defines, platform_path + Pathname.new("lib#{@spec.name}.a"))
@@ -29,7 +29,7 @@ module Pod
29
29
  def build_framework(platform)
30
30
  UI.puts('Building framework')
31
31
 
32
- defines = compile
32
+ defines = compile(platform)
33
33
  create_framework(platform.name.to_s)
34
34
  copy_headers
35
35
  build_library(platform, defines, @fwk.versions_path + Pathname.new(@spec.name))
@@ -60,6 +60,7 @@ module Pod
60
60
  end
61
61
 
62
62
  def build_static_lib_for_ios(static_libs, defines, output)
63
+ return if static_libs.count == 0
63
64
  `libtool -static -o #{@sandbox_root}/build/package.a #{static_libs.join(' ')}`
64
65
 
65
66
  xcodebuild(defines, '-sdk iphonesimulator', 'build-sim')
@@ -70,25 +71,36 @@ module Pod
70
71
  end
71
72
 
72
73
  def build_static_lib_for_mac(static_libs, output)
74
+ return if static_libs.count == 0
73
75
  `libtool -static -o #{output} #{static_libs.join(' ')}`
74
76
  end
75
77
 
76
- def build_with_mangling
78
+ def build_with_mangling(platform)
77
79
  UI.puts 'Mangling symbols'
78
80
  defines = Symbols.mangle_for_pod_dependencies(@spec.name, @sandbox_root)
81
+ if platform.name == :ios
82
+ defines = "#{defines} ARCHS=\"x86_64 i386 arm64 armv7 armv7s\""
83
+ end
84
+
79
85
  UI.puts 'Building mangled framework'
80
86
  xcodebuild(defines)
81
87
  defines
82
88
  end
83
89
 
84
- def compile
85
- xcodebuild
90
+ def compile(platform)
91
+ defines = "GCC_PREPROCESSOR_DEFINITIONS='PodsDummy_Pods_#{@spec.name}=PodsDummy_PodPackage_#{@spec.name}'"
92
+
93
+ if platform.name == :ios
94
+ defines = "#{defines} ARCHS=\"x86_64 i386 arm64 armv7 armv7s\""
95
+ end
96
+
97
+ xcodebuild(defines)
86
98
 
87
99
  if dependency_count > 0 && @mangle
88
- return build_with_mangling
100
+ return build_with_mangling(platform)
89
101
  end
90
102
 
91
- ''
103
+ defines
92
104
  end
93
105
 
94
106
  def copy_headers
@@ -96,12 +108,26 @@ module Pod
96
108
 
97
109
  Dir.glob("#{headers_source_root}/**/*.h").
98
110
  each { |h| `ditto #{h} #{@fwk.headers_path}/#{h.sub(headers_source_root, '')}` }
111
+
112
+ if File.exist?("#{@public_headers_root}/#{@spec.name}/#{@spec.name}.h")
113
+ module_map = <<MAP
114
+ framework module #{@spec.name} {
115
+ umbrella header "#{@spec.name}.h"
116
+
117
+ export *
118
+ module * { export * }
119
+ }
120
+ MAP
121
+
122
+ @fwk.module_map_path.mkpath unless @fwk.module_map_path.exist?
123
+ File.write("#{@fwk.module_map_path}/module.modulemap", module_map)
124
+ end
99
125
  end
100
126
 
101
127
  def copy_license
102
- license_file = @spec.license[:file]
103
- license_file = 'LICENSE' unless license_file
104
- `cp "#{@sandbox_root}/#{@spec.name}/#{license_file}" .`
128
+ license_file = @spec.license[:file] || 'LICENSE'
129
+ license_file = "#{@sandbox_root}/#{@spec.name}/#{license_file}"
130
+ `cp "#{license_file}" .` if Pathname(license_file).exist?
105
131
  end
106
132
 
107
133
  def copy_resources(platform)
@@ -1,6 +1,7 @@
1
1
  module Framework
2
2
  class Tree
3
3
  attr_reader :headers_path
4
+ attr_reader :module_map_path
4
5
  attr_reader :resources_path
5
6
  attr_reader :root_path
6
7
  attr_reader :versions_path
@@ -38,6 +39,7 @@ module Framework
38
39
  @fwk_path = @root_path + Pathname.new(@name + '.framework')
39
40
  @fwk_path.mkdir unless @fwk_path.exist?
40
41
 
42
+ @module_map_path = @fwk_path + Pathname.new('Modules')
41
43
  @versions_path = @fwk_path + Pathname.new('Versions/A')
42
44
  end
43
45
 
@@ -17,6 +17,15 @@ module Pod
17
17
  installer = Installer.new(sandbox, podfile)
18
18
  installer.install!
19
19
 
20
+ unless installer.nil?
21
+ installer.pods_project.targets.each do |target|
22
+ target.build_configurations.each do |config|
23
+ config.build_settings['CLANG_MODULES_AUTOLINK'] = 'NO'
24
+ end
25
+ end
26
+ installer.pods_project.save
27
+ end
28
+
20
29
  sandbox
21
30
  end
22
31
 
@@ -1,6 +1,6 @@
1
1
  module Symbols
2
2
  def symbols_from_library(library)
3
- syms = `nm -g #{library}`.split("\n")
3
+ syms = `nm -gU #{library}`.split("\n")
4
4
 
5
5
  result = classes_from_symbols(syms)
6
6
  result + constants_from_symbols(syms)
@@ -12,7 +12,6 @@ module Symbols
12
12
 
13
13
  def classes_from_symbols(syms)
14
14
  classes = syms.select { |klass| klass[/OBJC_CLASS_\$_/] }
15
- classes = classes.select { |klass| klass !~ /_NS|_UI/ }
16
15
  classes = classes.uniq
17
16
  classes.map! { |klass| klass.gsub(/^.*\$_/, '') }
18
17
  end
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  module Packager
3
- VERSION = '1.1.0'
3
+ VERSION = '1.1.1'
4
4
  end
5
5
  end
@@ -54,7 +54,7 @@ module Pod
54
54
  target_dir, work_dir = create_working_directory
55
55
  return if target_dir.nil?
56
56
  build_package
57
- `mv #{work_dir} #{target_dir}`
57
+ `mv "#{work_dir}" "#{target_dir}"`
58
58
  Dir.chdir(@source_dir)
59
59
  end
60
60
 
@@ -6,6 +6,7 @@ module Pod
6
6
  Dir.glob("CPDColors-*").each { |dir| Pathname.new(dir).rmtree }
7
7
  Dir.glob("layer-client-messaging-schema-*").each { |dir| Pathname.new(dir).rmtree }
8
8
  Dir.glob("OpenSans-*").each { |dir| Pathname.new(dir).rmtree }
9
+ Dir.glob("Weakly-*").each { |dir| Pathname.new(dir).rmtree }
9
10
  end
10
11
 
11
12
  it 'presents the help if a directory is provided' do
@@ -48,5 +49,12 @@ module Pod
48
49
  bundles = Dir.glob('OpenSans-*/ios/OpenSans.framework/Versions/A/Resources/*.bundle')
49
50
  bundles.count.should == 1
50
51
  end
52
+
53
+ it 'can package a podspec with weak frameworks without strong linking' do
54
+ command = Command.parse(%w{ package spec/fixtures/Weakly.podspec })
55
+ command.run
56
+
57
+ `otool -l Weakly-*/ios/Weakly.framework/Weakly`.should.not.match /AssetsLibrary/
58
+ end
51
59
  end
52
60
  end
@@ -65,6 +65,17 @@ module Pod
65
65
  symbols.should == []
66
66
  end
67
67
 
68
+ it "includes the correct architectures when packaging an iOS Pod" do
69
+ SourcesManager.stubs(:search).returns(nil)
70
+
71
+ command = Command.parse(%w{ package spec/fixtures/NikeKit.podspec })
72
+ command.run
73
+
74
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
75
+ `lipo #{lib} -verify_arch armv7 armv7s arm64`
76
+ $?.success?.should == true
77
+ end
78
+
68
79
  it "does not fail when the pod name contains a dash" do
69
80
  SourcesManager.stubs(:search).returns(nil)
70
81
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'KFData'
3
- s.version = '1.0.1'
3
+ s.version = '1.0.5'
4
4
  s.license = 'BSD'
5
5
  s.summary = 'Lightweight Core Data wrapper.'
6
6
  s.homepage = 'https://github.com/kylef/KFData'
@@ -17,10 +17,17 @@ Pod::Spec.new do |s|
17
17
  s.header_dir = 'KFData'
18
18
 
19
19
  s.subspec 'Attribute' do |attribute_spec|
20
+ attribute_spec.dependency 'QueryKit', '~> 0.8.3'
20
21
  attribute_spec.ios.source_files = 'KFData/Attribute/*.{h,m}'
21
22
  attribute_spec.osx.source_files = 'KFData/Attribute/*.{h,m}'
22
23
  end
23
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
+
24
31
  s.subspec 'Core' do |corespec|
25
32
  corespec.ios.frameworks = 'CoreData'
26
33
  corespec.ios.source_files = 'KFData/KFData.h', 'KFData/Core/*.{h,m}'
@@ -42,7 +49,7 @@ Pod::Spec.new do |s|
42
49
  end
43
50
 
44
51
  s.subspec 'UI' do |uispec|
45
- uispec.dependency 'KFData/Essentials'
52
+ uispec.dependency 'KFData/Manager'
46
53
  uispec.platform = :ios
47
54
  uispec.ios.frameworks = 'UIKit'
48
55
  uispec.ios.source_files = 'KFData/UI/*.{h,m}'
@@ -52,11 +59,13 @@ Pod::Spec.new do |s|
52
59
  essentialsspec.dependency 'KFData/Core'
53
60
  essentialsspec.dependency 'KFData/Store'
54
61
  essentialsspec.dependency 'KFData/Attribute'
62
+ essentialsspec.dependency 'KFData/Manager'
55
63
  essentialsspec.ios.dependency 'KFData/UI'
56
64
  end
57
65
 
58
66
  s.subspec 'Compatibility' do |cspec|
59
67
  cspec.dependency 'KFData/Core'
68
+ cspec.dependency 'KFData/Manager'
60
69
  cspec.header_dir = 'KFData/Compatibility'
61
70
  cspec.source_files = 'KFData/Compatibility/*.{h,m}'
62
71
  end
@@ -0,0 +1,22 @@
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