cocoapods-gd 0.0.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.
- checksums.yaml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +131 -0
- data/LICENSE +22 -0
- data/README.md +42 -0
- data/Rakefile +29 -0
- data/cocoapods-gd.gemspec +22 -0
- data/lib/cocoapods-gd.rb +5 -0
- data/lib/cocoapods-gd/builder.rb +393 -0
- data/lib/cocoapods-gd/framework.rb +66 -0
- data/lib/cocoapods-gd/install_frameworks.rb +77 -0
- data/lib/cocoapods-gd/mangle.rb +32 -0
- data/lib/cocoapods-gd/pod_utils.rb +246 -0
- data/lib/cocoapods-gd/podfile_env.rb +26 -0
- data/lib/cocoapods-gd/spec_builder.rb +72 -0
- data/lib/cocoapods-gd/symbols.rb +42 -0
- data/lib/cocoapods-gd/uploader.rb +70 -0
- data/lib/cocoapods-gd/user_interface/build_failed_report.rb +15 -0
- data/lib/cocoapods_plugin.rb +10 -0
- data/lib/pod/command/gd.rb +185 -0
- data/scripts/lstconst.sh +9 -0
- data/scripts/lstsym.sh +8 -0
- data/spec/command/error_spec.rb +81 -0
- data/spec/command/gd_spec.rb +420 -0
- data/spec/command/subspecs_spec.rb +30 -0
- data/spec/fixtures/Archs.podspec +13 -0
- data/spec/fixtures/Builder.podspec +25 -0
- data/spec/fixtures/CPDColors.podspec +19 -0
- data/spec/fixtures/FH.podspec +18 -0
- data/spec/fixtures/KFData.podspec +73 -0
- data/spec/fixtures/LibraryConsumerDemo/.gitignore +22 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.pbxproj +311 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer.xcodeproj/xcshareddata/xcschemes/LibraryConsumer.xcscheme +100 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.h +17 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/AppDelegate.m +27 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/Info.plist +40 -0
- data/spec/fixtures/LibraryConsumerDemo/LibraryConsumer/main.m +16 -0
- data/spec/fixtures/LibraryConsumerDemo/Podfile +5 -0
- data/spec/fixtures/LibraryDemo.podspec +14 -0
- data/spec/fixtures/LocalSources/LICENSE +0 -0
- data/spec/fixtures/LocalSources/LocalNikeKit.h +4 -0
- data/spec/fixtures/LocalSources/LocalNikeKit.m +9 -0
- data/spec/fixtures/LocalSources/LocalNikeKit.podspec +19 -0
- data/spec/fixtures/NikeKit.podspec +19 -0
- data/spec/fixtures/OpenSans.podspec +18 -0
- data/spec/fixtures/PackagerTest/.gitignore +21 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.pbxproj +507 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcodeproj/xcshareddata/xcschemes/PackagerTest.xcscheme +110 -0
- data/spec/fixtures/PackagerTest/PackagerTest.xcworkspace/contents.xcworkspacedata +1 -0
- data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.h +15 -0
- data/spec/fixtures/PackagerTest/PackagerTest/CPDAppDelegate.m +49 -0
- data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/AppIcon.appiconset/Contents.json +23 -0
- data/spec/fixtures/PackagerTest/PackagerTest/Images.xcassets/LaunchImage.launchimage/Contents.json +23 -0
- data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Info.plist +38 -0
- data/spec/fixtures/PackagerTest/PackagerTest/PackagerTest-Prefix.pch +16 -0
- data/spec/fixtures/PackagerTest/PackagerTest/en.lproj/InfoPlist.strings +2 -0
- data/spec/fixtures/PackagerTest/PackagerTest/main.m +18 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests-Info.plist +22 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/PackagerTestTests.m +34 -0
- data/spec/fixtures/PackagerTest/PackagerTestTests/en.lproj/InfoPlist.strings +2 -0
- data/spec/fixtures/PackagerTest/Podfile +10 -0
- data/spec/fixtures/PackagerTest/Podfile.lock +36 -0
- data/spec/fixtures/Weakly.podspec +13 -0
- data/spec/fixtures/a.podspec +19 -0
- data/spec/fixtures/foo-bar.podspec +19 -0
- data/spec/fixtures/layer-client-messaging-schema.podspec +13 -0
- data/spec/integration/project_spec.rb +70 -0
- data/spec/spec_helper.rb +79 -0
- data/spec/unit/pod/utils_spec.rb +58 -0
- data/spec/unit/specification/builder_spec.rb +62 -0
- data/spec/unit/specification/spec_builder_spec.rb +61 -0
- data/spec/unit/user_interface/build_failed_report_spec.rb +11 -0
- metadata +217 -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::Gd 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{ gd }).should.be.instance_of Command::Gd
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'presents the help if no spec is provided' do
|
33
|
+
command = Command.parse(%w{ gd })
|
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{ gd 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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 gd using local sources when --local is specified" do
|
164
|
+
Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
|
165
|
+
|
166
|
+
command = Command.parse(['gd', 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{ gd 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{ gd 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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(['gd', 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{ gd 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::Gd do
|
5
|
+
describe 'Subspecs' do
|
6
|
+
after do
|
7
|
+
Dir.glob("KFData-*").each { |dir| Pathname.new(dir).rmtree }
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'can gd a single subspec' do
|
11
|
+
Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
|
12
|
+
|
13
|
+
command = Command.parse(%w{ gd 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 gd a list of subspecs' do
|
20
|
+
Pod::Config.instance.sources_manager.stubs(:search).returns(nil)
|
21
|
+
|
22
|
+
command = Command.parse(%w{ gd 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
|