cocoapods-packager-clone-master 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.gitignore +4 -0
  4. data/.rubocop-cocoapods.yml +71 -0
  5. data/.rubocop.yml +38 -0
  6. data/.travis.yml +17 -0
  7. data/Gemfile +12 -0
  8. data/Gemfile.lock +129 -0
  9. data/LICENSE +22 -0
  10. data/README.md +42 -0
  11. data/Rakefile +29 -0
  12. data/cocoapods-packager.gemspec +21 -0
  13. data/lib/cocoapods-packager/builder.rb +334 -0
  14. data/lib/cocoapods-packager/framework.rb +66 -0
  15. data/lib/cocoapods-packager/mangle.rb +32 -0
  16. data/lib/cocoapods-packager/pod_utils.rb +244 -0
  17. data/lib/cocoapods-packager/spec_builder.rb +63 -0
  18. data/lib/cocoapods-packager/symbols.rb +42 -0
  19. data/lib/cocoapods-packager/user_interface/build_failed_report.rb +15 -0
  20. data/lib/cocoapods_packager.rb +5 -0
  21. data/lib/cocoapods_plugin.rb +8 -0
  22. data/lib/pod/command/package.rb +177 -0
  23. data/scripts/lstconst.sh +9 -0
  24. data/scripts/lstsym.sh +8 -0
  25. data/spec/command/error_spec.rb +81 -0
  26. data/spec/command/package_spec.rb +420 -0
  27. data/spec/command/subspecs_spec.rb +30 -0
  28. data/spec/fixtures/Archs.podspec +13 -0
  29. data/spec/fixtures/Builder.podspec +25 -0
  30. data/spec/fixtures/CPDColors.podspec +19 -0
  31. data/spec/fixtures/FH.podspec +18 -0
  32. data/spec/fixtures/KFData.podspec +73 -0
  33. data/spec/fixtures/LibraryConsumerDemo/.gitignore +22 -0
  34. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.h +17 -0
  35. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.m +27 -0
  36. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/Info.plist +40 -0
  37. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/main.m +16 -0
  38. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.pbxproj +311 -0
  39. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  40. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/xcshareddata/xcschemes/LibraryConsumer.xcscheme +100 -0
  41. data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcworkspace/contents.xcworkspacedata +10 -0
  42. data/spec/fixtures/LibraryConsumerDemo/Podfile +5 -0
  43. data/spec/fixtures/LibraryDemo.podspec +14 -0
  44. data/spec/fixtures/LocalSources/LICENSE +0 -0
  45. data/spec/fixtures/LocalSources/LocalNikeKit.h +4 -0
  46. data/spec/fixtures/LocalSources/LocalNikeKit.m +9 -0
  47. data/spec/fixtures/LocalSources/LocalNikeKit.podspec +19 -0
  48. data/spec/fixtures/NikeKit.podspec +19 -0
  49. data/spec/fixtures/OpenSans.podspec +18 -0
  50. data/spec/fixtures/PackagerTest/.gitignore +21 -0
  51. data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.h +15 -0
  52. data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.m +49 -0
  53. data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/AppIcon.appiconset/Contents.json +23 -0
  54. data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/LaunchImage.launchimage/Contents.json +23 -0
  55. data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Info.plist +38 -0
  56. data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Prefix.pch +16 -0
  57. data/spec/fixtures/PackagerTest/PackagerTest/en.lproj/InfoPlist.strings +2 -0
  58. data/spec/fixtures/PackagerTest/PackagerTest/main.m +18 -0
  59. data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.pbxproj +507 -0
  60. data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  61. data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/xcshareddata/xcschemes/PackagerTest.xcscheme +110 -0
  62. data/spec/fixtures/PackagerTest/PackagerTest.xcworkspace/contents.xcworkspacedata +1 -0
  63. data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests-Info.plist +22 -0
  64. data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests.m +34 -0
  65. data/spec/fixtures/PackagerTest/PackagerTestTests/en.lproj/InfoPlist.strings +2 -0
  66. data/spec/fixtures/PackagerTest/Podfile +10 -0
  67. data/spec/fixtures/PackagerTest/Podfile.lock +36 -0
  68. data/spec/fixtures/Weakly.podspec +13 -0
  69. data/spec/fixtures/a.podspec +19 -0
  70. data/spec/fixtures/foo-bar.podspec +19 -0
  71. data/spec/fixtures/layer-client-messaging-schema.podspec +13 -0
  72. data/spec/integration/project_spec.rb +70 -0
  73. data/spec/spec_helper.rb +79 -0
  74. data/spec/unit/pod/utils_spec.rb +58 -0
  75. data/spec/unit/specification/builder_spec.rb +62 -0
  76. data/spec/unit/specification/spec_builder_spec.rb +61 -0
  77. data/spec/unit/user_interface/build_failed_report_spec.rb +11 -0
  78. metadata +221 -0
@@ -0,0 +1,420 @@
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
+ def reject_block_symbols(symbols)
22
+ symbols
23
+ .reject { |e| e =~ /__block_descriptor.*/ }
24
+ .reject { |e| e =~ /__destroy_helper_block.*/ }
25
+ .reject { |e| e =~ /__copy_helper_block.*/ }
26
+ end
27
+
28
+ it 'registers itself' do
29
+ Command.parse(%w{ package }).should.be.instance_of Command::Package
30
+ end
31
+
32
+ it 'presents the help if no spec is provided' do
33
+ command = Command.parse(%w{ package })
34
+ should.raise CLAide::Help do
35
+ command.validate!
36
+ end.message.should.match /required/
37
+ end
38
+
39
+ it "errors if it cannot find a spec" do
40
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
41
+
42
+ command = Command.parse(%w{ package KFData })
43
+ should.raise CLAide::Help do
44
+ command.run
45
+ end.message.should.match /Unable to find/
46
+ end
47
+
48
+
49
+ it "should produce a dynamic library when dynamic is specified" do
50
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
51
+
52
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
53
+ command.run
54
+
55
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
56
+ file_command = "file #{lib}"
57
+ output = `#{file_command}`.lines.to_a
58
+
59
+ output[0].should.match /Mach-O universal binary with 5 architectures/
60
+ output[1].should.match /Mach-O dynamically linked shared library i386/
61
+ end
62
+
63
+ it "should produce a dSYM when dynamic is specified" do
64
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
65
+
66
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
67
+ command.run
68
+
69
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework.dSYM/Contents/Resources/DWARF/NikeKit").first
70
+ file_command = "file #{lib}"
71
+ output = `#{file_command}`.lines.to_a
72
+
73
+ output[0].should.match /Mach-O universal binary with 3 architectures/
74
+ output[1].should.match /Mach-O dSYM companion file arm/
75
+ end
76
+
77
+ it "should link category symbols when dynamic is specified" do
78
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
79
+
80
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
81
+ command.run
82
+
83
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
84
+ file_command = "nm #{lib}"
85
+ output = `#{file_command}`.lines.to_a
86
+
87
+ match = output.detect { |line| line =~ /UIButton\(AFNetworking\)/ }
88
+ match.should.not.be.empty
89
+ end
90
+
91
+ it "should produce a dynamic library for OSX when dynamic is specified" do
92
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
93
+
94
+ command = Command.parse(['package', fixture('KFData.podspec'), '--dynamic'])
95
+ command.run
96
+
97
+ lib = Dir.glob("KFData-*/osx/KFData.framework/KFData").first
98
+ file_command = "file #{lib}"
99
+ output = `#{file_command}`.lines.to_a
100
+
101
+ output[0].should.match /Mach-O 64-bit dynamically linked shared library x86_64/
102
+ end
103
+
104
+ it "should produce a dSYM for OSX when dynamic is specified" do
105
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
106
+
107
+ command = Command.parse(['package', fixture('KFData.podspec'), '--dynamic'])
108
+ command.run
109
+
110
+ lib = Dir.glob("KFData-*/osx/KFData.framework.dSYM/Contents/Resources/DWARF/KFData").first
111
+ file_command = "file #{lib}"
112
+ output = `#{file_command}`.lines.to_a
113
+
114
+ output[0].should.match /Mach-O 64-bit dSYM companion file x86_64/
115
+ end
116
+
117
+ it "should produce the default plist for iOS and OSX when --dynamic is specified but --bundle-identifier is not" do
118
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
119
+
120
+ command = Command.parse(['package', fixture('KFData.podspec'), '--dynamic'])
121
+ command.run
122
+
123
+ ios_plist = File.expand_path(Dir.glob("KFData-*/ios/KFData.framework/Info.plist").first)
124
+ osx_plist = File.expand_path(Dir.glob("KFData-*/osx/KFData.framework/Resources/Info.plist").first)
125
+
126
+ ios_bundle_id = `defaults read #{ios_plist} CFBundleIdentifier`
127
+ osx_bundle_id = `defaults read #{osx_plist} CFBundleIdentifier`
128
+
129
+ ios_bundle_id.should.match /org.cocoapods.KFData/
130
+ osx_bundle_id.should.match /org.cocoapods.KFData/
131
+ end
132
+
133
+ it "should produce the correct plist for iOS and OSX when --dynamic and --bundle-identifier are specified" do
134
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
135
+
136
+ command = Command.parse(['package', fixture('KFData.podspec'), '--dynamic', '--bundle-identifier=com.example.KFData'])
137
+ command.run
138
+
139
+ ios_plist = File.expand_path(Dir.glob("KFData-*/ios/KFData.framework/Info.plist").first)
140
+ osx_plist = File.expand_path(Dir.glob("KFData-*/osx/KFData.framework/Resources/Info.plist").first)
141
+
142
+ ios_bundle_id = `defaults read #{ios_plist} CFBundleIdentifier`
143
+ osx_bundle_id = `defaults read #{osx_plist} CFBundleIdentifier`
144
+
145
+ ios_bundle_id.should.match /com.example.KFData/
146
+ osx_bundle_id.should.match /com.example.KFData/
147
+ end
148
+
149
+ it "should produce a static library when dynamic is not specified" do
150
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
151
+
152
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
153
+ command.run
154
+
155
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
156
+ file_command = "file #{lib}"
157
+ output = `#{file_command}`.lines.to_a
158
+
159
+ output[0].should.match /Mach-O universal binary with 5 architectures/
160
+ output[1].should.match /current ar archive/
161
+ end
162
+
163
+ it "produces package using local sources when --local is specified" do
164
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
165
+
166
+ command = Command.parse(['package', fixture('LocalSources/LocalNikeKit.podspec'), '--local'])
167
+ command.run
168
+
169
+ lib = Dir.glob("LocalNikeKit-*/ios/LocalNikeKit.framework/LocalNikeKit").first
170
+ symbols = Symbols.symbols_from_library(lib)
171
+ symbols.should.include('LocalNikeKit')
172
+ symbols.should.not.include('BBUNikePlusActivity')
173
+ end
174
+
175
+ it "includes vendor symbols both from itself and pod dependencies" do
176
+ command = Command.parse(%w{ package FirebaseAnalytics --no-mangle })
177
+ command.run
178
+
179
+ lib = Dir.glob("FirebaseAnalytics-*/ios/FirebaseAnalytics.framework/FirebaseAnalytics").first
180
+ symbols = Symbols.symbols_from_library(lib)
181
+ # from itself
182
+ symbols.should.include('FIRAnalytics')
183
+ # from pod dependency
184
+ symbols.should.include('FIRApp')
185
+ end
186
+
187
+ it "does not include vendor symbols from pod dependencies if option --exclude-deps is specified" do
188
+ command = Command.parse(%w{ package FirebaseAnalytics --no-mangle --exclude-deps})
189
+ command.run
190
+
191
+ lib = Dir.glob("FirebaseAnalytics-*/ios/FirebaseAnalytics.framework/FirebaseAnalytics").first
192
+ symbols = Symbols.symbols_from_library(lib)
193
+ # from itself
194
+ symbols.should.include('FIRAnalytics')
195
+ # from pod dependency
196
+ symbols.should.not.include('FIRApp')
197
+ end
198
+
199
+ it "includes only available architectures when packaging an iOS Pod with binary dependencies" do
200
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
201
+
202
+ command = Command.parse(['package', fixture('Archs.podspec'), '--no-mangle'])
203
+ command.run
204
+
205
+ lib = Dir.glob("Archs-*/ios/Archs.framework/Archs").first
206
+ `lipo #{lib} -verify_arch x86_64 i386 armv7 arm64`
207
+ $?.success?.should == true
208
+ end
209
+
210
+ it "mangles symbols if the Pod has dependencies" do
211
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
212
+
213
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
214
+ command.run
215
+
216
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
217
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /PodNikeKit/ }
218
+ symbols = reject_block_symbols(symbols)
219
+
220
+ symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager
221
+ BBUNikePlusTag }
222
+ end
223
+
224
+ it "mangles symbols if the Pod has dependencies and framework is dynamic" do
225
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
226
+
227
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
228
+ command.run
229
+
230
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
231
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /PodNikeKit/ }
232
+ symbols = reject_block_symbols(symbols)
233
+
234
+ symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager
235
+ BBUNikePlusTag NikeKitVersionNumber NikeKitVersionString }
236
+ end
237
+
238
+ it "mangles symbols if the Pod has dependencies regardless of name" do
239
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
240
+
241
+ command = Command.parse(['package', fixture('a.podspec')])
242
+ command.run
243
+
244
+ lib = Dir.glob("a-*/ios/a.framework/a").first
245
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.reject { |e| e =~ /Poda/ }
246
+ symbols = reject_block_symbols(symbols)
247
+ symbols.should == %w{ BBUNikePlusActivity BBUNikePlusSessionManager
248
+ BBUNikePlusTag }
249
+ end
250
+
251
+ it "does not mangle symbols if option --no-mangle is specified" do
252
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
253
+
254
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--no-mangle'])
255
+ command.run
256
+
257
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
258
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /PodNikeKit/ }
259
+ symbols.should == []
260
+ end
261
+
262
+ it "does not mangle symbols if option --no-mangle and --dynamic are specified" do
263
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
264
+
265
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--no-mangle', '--dynamic'])
266
+ command.run
267
+
268
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
269
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /PodNikeKit/ }
270
+ symbols.should == []
271
+ end
272
+
273
+ it "does not include symbols from dependencies if option --exclude-deps is specified" do
274
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
275
+
276
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--exclude-deps'])
277
+ command.run
278
+
279
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
280
+ symbols = Symbols.symbols_from_library(lib).uniq.sort.select { |e| e =~ /AFNetworking|ISO8601DateFormatter|KZPropertyMapper/ }
281
+ symbols.should == []
282
+ end
283
+
284
+ it "includes the correct architectures when packaging an iOS Pod" do
285
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
286
+
287
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
288
+ command.run
289
+
290
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
291
+ `lipo #{lib} -verify_arch x86_64 i386 armv7 armv7s arm64`
292
+ $?.success?.should == true
293
+ end
294
+
295
+ it "includes the correct architectures when packaging an iOS Pod as --dynamic" do
296
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
297
+
298
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
299
+ command.run
300
+
301
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
302
+ `lipo #{lib} -verify_arch armv7 armv7s arm64`
303
+ $?.success?.should == true
304
+ end
305
+
306
+ it "includes Bitcode for device arch slices when packaging an iOS Pod" do
307
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
308
+
309
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
310
+ command.run
311
+
312
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
313
+
314
+ #Check for __LLVM segment in each device architecture
315
+ `lipo -extract armv7 #{lib} -o armv7.a && otool -l armv7.a`.should.match /__LLVM/
316
+ `lipo -extract armv7s #{lib} -o armv7s.a && otool -l armv7s.a`.should.match /__LLVM/
317
+ `lipo -extract arm64 #{lib} -o arm64.a && otool -l arm64.a`.should.match /__LLVM/
318
+ `rm armv7.a armv7s.a arm64.a`
319
+ end
320
+
321
+ it "includes Bitcode for device arch slices when packaging an dynamic iOS Pod" do
322
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
323
+
324
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
325
+ command.run
326
+
327
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
328
+
329
+ #Check for __LLVM segment in each device architecture
330
+ `lipo -extract armv7 #{lib} -o armv7.a && otool -l armv7.a`.should.match /__LLVM/
331
+ `lipo -extract armv7s #{lib} -o armv7s.a && otool -l armv7s.a`.should.match /__LLVM/
332
+ `lipo -extract arm64 #{lib} -o arm64.a && otool -l arm64.a`.should.match /__LLVM/
333
+ `rm armv7.a armv7s.a arm64.a`
334
+ end
335
+
336
+ it "does not include Bitcode for simulator arch slices when packaging an iOS Pod" do
337
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
338
+
339
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
340
+ command.run
341
+
342
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
343
+
344
+ #Check for __LLVM segment in each simulator architecture
345
+ `lipo -extract i386 #{lib} -o i386.a && otool -l i386.a`.should.not.match /__LLVM/
346
+ `lipo -extract x86_64 #{lib} -o x86_64.a && otool -l x86_64.a`.should.not.match /__LLVM/
347
+ `rm i386.a x86_64.a`
348
+ end
349
+
350
+ it "does not include Bitcode for simulator arch slices when packaging an dynamic iOS Pod" do
351
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
352
+
353
+ command = Command.parse(['package', fixture('NikeKit.podspec'), '--dynamic'])
354
+ command.run
355
+
356
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
357
+
358
+ #Check for __LLVM segment in each simulator architecture
359
+ `lipo -extract i386 #{lib} -o i386.a && otool -l i386.a`.should.not.match /__LLVM/
360
+ `lipo -extract x86_64 #{lib} -o x86_64.a && otool -l x86_64.a`.should.not.match /__LLVM/
361
+ `rm i386.a x86_64.a`
362
+ end
363
+
364
+ it "does not include local ModuleCache references" do
365
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
366
+
367
+ command = Command.parse(['package', fixture('NikeKit.podspec')])
368
+ command.run
369
+
370
+ lib = Dir.glob("NikeKit-*/ios/NikeKit.framework/NikeKit").first
371
+
372
+ #Check for ModuleCache references
373
+ `strings #{lib}`.should.not.match /ModuleCache/
374
+ end
375
+
376
+ it "does not fail when the pod name contains a dash" do
377
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
378
+
379
+ command = Command.parse(['package', fixture('foo-bar.podspec')])
380
+ command.run
381
+
382
+ true.should == true # To make the test pass without any shoulds
383
+ end
384
+
385
+ it "runs with a path to a spec" do
386
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
387
+
388
+ command = Command.parse(['package', fixture('KFData.podspec')])
389
+ command.run
390
+
391
+ true.should == true # To make the test pass without any shoulds
392
+ end
393
+
394
+ it "it respects module_map directive" do
395
+ Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
396
+
397
+ command = Command.parse(['package', fixture('FH.podspec')])
398
+ command.run
399
+
400
+ modulemap_contents = File.read(Dir.glob("FH-*/ios/FH.framework/Modules/module.modulemap").first)
401
+ module_map = <<MAP
402
+ framework module FH {
403
+ umbrella header "FeedHenry.h"
404
+
405
+ export *
406
+ module * { export * }
407
+ }
408
+ MAP
409
+ modulemap_contents.should == module_map
410
+ end
411
+
412
+ it "runs with a spec in the master repository" do
413
+ command = Command.parse(%w{ package KFData })
414
+ command.run
415
+
416
+ true.should == true # To make the test pass without any shoulds
417
+ end
418
+ end
419
+ end
420
+ end
@@ -0,0 +1,30 @@
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
+
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,25 @@
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
@@ -0,0 +1,19 @@
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
@@ -0,0 +1,18 @@
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
@@ -0,0 +1,73 @@
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
+
@@ -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
@@ -0,0 +1,17 @@
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 <UIKit/UIKit.h>
10
+
11
+ @interface AppDelegate : UIResponder <UIApplicationDelegate>
12
+
13
+ @property (strong, nonatomic) UIWindow *window;
14
+
15
+
16
+ @end
17
+
@@ -0,0 +1,27 @@
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 <LibraryDemo/MyDemoClass.h>
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