xcjobs 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xcjobs/version.rb +1 -1
- data/lib/xcjobs/xcodebuild.rb +26 -13
- data/spec/xcodebuild_spec.rb +141 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d55bb96a8d15b7cfb189f0cb8b55b971b83066cf
|
4
|
+
data.tar.gz: bab8f956c58e238a7ca8da889b18d03e3146ecd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8009f8194b4ae4890ecd77af17d664a5ae4754bf02af0be3a0ae297b6f826874872545d1166b9c99dca863239f32011ca1d6a9bd741d58834a72179496d5f03e
|
7
|
+
data.tar.gz: 33d3000abf7185916fa8e2dfaa7b3fd2758b91b0b74bbcf7f9762f76961136c9a29d72297e710d00017ef61427657e1a95a818dec84fa1e932e4679c4b6647f1
|
data/lib/xcjobs/version.rb
CHANGED
data/lib/xcjobs/xcodebuild.rb
CHANGED
@@ -28,6 +28,18 @@ module XCJobs
|
|
28
28
|
@build_settings = {}
|
29
29
|
end
|
30
30
|
|
31
|
+
def project
|
32
|
+
if @project
|
33
|
+
File.extname(@project).empty? ? "#{@project}.xcodeproj" : @project
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def workspace
|
38
|
+
if @workspace
|
39
|
+
File.extname(@workspace).empty? ? "#{@workspace}.xcworkspace" : @workspace
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
31
43
|
def before_action(&block)
|
32
44
|
@before_action = block
|
33
45
|
end
|
@@ -153,9 +165,10 @@ module XCJobs
|
|
153
165
|
if sdk == 'iphonesimulator'
|
154
166
|
add_build_setting('CODE_SIGN_IDENTITY', '""')
|
155
167
|
add_build_setting('CODE_SIGNING_REQUIRED', 'NO')
|
156
|
-
add_build_setting('GCC_SYMBOLS_PRIVATE_EXTERN', 'NO')
|
157
168
|
end
|
158
169
|
|
170
|
+
add_build_setting('GCC_SYMBOLS_PRIVATE_EXTERN', 'NO')
|
171
|
+
|
159
172
|
run(['xcodebuild', 'test'] + options)
|
160
173
|
end
|
161
174
|
end
|
@@ -174,8 +187,8 @@ module XCJobs
|
|
174
187
|
raise 'the scheme is required when specifying build_dir' if build_dir && !scheme
|
175
188
|
raise 'cannot specify both a scheme and targets' if scheme && target
|
176
189
|
|
177
|
-
CLEAN.include(build_dir)
|
178
|
-
CLOBBER.include(build_dir)
|
190
|
+
CLEAN.include(build_dir) if build_dir
|
191
|
+
CLOBBER.include(build_dir) if build_dir
|
179
192
|
|
180
193
|
desc 'build application'
|
181
194
|
task @name do
|
@@ -203,8 +216,8 @@ module XCJobs
|
|
203
216
|
raise 'archive action requires specifying a scheme' unless scheme
|
204
217
|
raise 'cannot specify both a scheme and targets' if scheme && target
|
205
218
|
|
206
|
-
CLEAN.include(build_dir)
|
207
|
-
CLOBBER.include(build_dir)
|
219
|
+
CLEAN.include(build_dir) if build_dir
|
220
|
+
CLOBBER.include(build_dir) if build_dir
|
208
221
|
|
209
222
|
desc 'make xcarchive'
|
210
223
|
namespace :build do
|
@@ -247,6 +260,14 @@ module XCJobs
|
|
247
260
|
define
|
248
261
|
end
|
249
262
|
|
263
|
+
def archive_path
|
264
|
+
@archive_path || (build_dir && scheme ? File.join(build_dir, scheme) : nil)
|
265
|
+
end
|
266
|
+
|
267
|
+
def export_format
|
268
|
+
@export_format || 'IPA'
|
269
|
+
end
|
270
|
+
|
250
271
|
private
|
251
272
|
|
252
273
|
def define
|
@@ -258,14 +279,6 @@ module XCJobs
|
|
258
279
|
end
|
259
280
|
end
|
260
281
|
|
261
|
-
def archive_path
|
262
|
-
@archive_path || (build_dir && scheme ? File.join(build_dir, scheme) : nil)
|
263
|
-
end
|
264
|
-
|
265
|
-
def export_format
|
266
|
-
@export_format || 'IPA'
|
267
|
-
end
|
268
|
-
|
269
282
|
def options
|
270
283
|
[].tap do |opts|
|
271
284
|
opts.concat(['-archivePath', archive_path]) if archive_path
|
data/spec/xcodebuild_spec.rb
CHANGED
@@ -48,6 +48,32 @@ describe XCJobs::Xcodebuild do
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
context 'When no file extension (project)' do
|
52
|
+
let!(:task) do
|
53
|
+
XCJobs::Test.new do |t|
|
54
|
+
t.project = 'Project'
|
55
|
+
t.scheme = 'Scheme'
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'Automatically complemented' do
|
60
|
+
expect(task.project).to eq 'Project.xcodeproj'
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context 'When no file extension (workspace)' do
|
65
|
+
let!(:task) do
|
66
|
+
XCJobs::Test.new do |t|
|
67
|
+
t.workspace = 'Workspace'
|
68
|
+
t.scheme = 'Scheme'
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it 'Automatically complemented' do
|
73
|
+
expect(task.workspace).to eq 'Workspace.xcworkspace'
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
51
77
|
describe 'test project with simulator' do
|
52
78
|
let!(:task) do
|
53
79
|
XCJobs::Test.new do |t|
|
@@ -163,7 +189,7 @@ describe XCJobs::Xcodebuild do
|
|
163
189
|
|
164
190
|
it 'executes the appropriate commands' do
|
165
191
|
subject.invoke
|
166
|
-
expect(@commands).to eq ['xcodebuild test -project Example.xcodeproj -scheme Example -sdk iphoneos -configuration Debug -destination platform=iOS,id=8d18c8c4d1a6988ac4a70d370bfcbe99fef3f7b5']
|
192
|
+
expect(@commands).to eq ['xcodebuild test -project Example.xcodeproj -scheme Example -sdk iphoneos -configuration Debug -destination platform=iOS,id=8d18c8c4d1a6988ac4a70d370bfcbe99fef3f7b5 GCC_SYMBOLS_PRIVATE_EXTERN=NO']
|
167
193
|
end
|
168
194
|
end
|
169
195
|
end
|
@@ -198,6 +224,32 @@ describe XCJobs::Xcodebuild do
|
|
198
224
|
end
|
199
225
|
end
|
200
226
|
|
227
|
+
context 'When no file extension (project)' do
|
228
|
+
let!(:task) do
|
229
|
+
XCJobs::Build.new do |t|
|
230
|
+
t.project = 'Project'
|
231
|
+
t.scheme = 'Scheme'
|
232
|
+
end
|
233
|
+
end
|
234
|
+
|
235
|
+
it 'Automatically complemented' do
|
236
|
+
expect(task.project).to eq 'Project.xcodeproj'
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
context 'When no file extension (workspace)' do
|
241
|
+
let!(:task) do
|
242
|
+
XCJobs::Build.new do |t|
|
243
|
+
t.workspace = 'Workspace'
|
244
|
+
t.scheme = 'Scheme'
|
245
|
+
end
|
246
|
+
end
|
247
|
+
|
248
|
+
it 'Automatically complemented' do
|
249
|
+
expect(task.workspace).to eq 'Workspace.xcworkspace'
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
201
253
|
describe 'simple task with a project' do
|
202
254
|
let!(:task) do
|
203
255
|
XCJobs::Build.new do |t|
|
@@ -419,4 +471,92 @@ describe XCJobs::Xcodebuild do
|
|
419
471
|
end
|
420
472
|
end
|
421
473
|
end
|
474
|
+
|
475
|
+
describe XCJobs::Export do
|
476
|
+
describe 'export task for IPA' do
|
477
|
+
let!(:task) do
|
478
|
+
XCJobs::Export.new do |t|
|
479
|
+
t.archive_path = 'build/Example'
|
480
|
+
t.export_format = 'IPA'
|
481
|
+
t.export_path = 'build/Example.ipa'
|
482
|
+
t.export_provisioning_profile = 'Ad_Hoc.mobileprovision'
|
483
|
+
t.export_signing_identity = 'iPhone Distribution: kishikawa katsumi'
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
it 'configures the archive path' do
|
488
|
+
expect(task.archive_path).to eq 'build/Example'
|
489
|
+
end
|
490
|
+
|
491
|
+
it 'configures the export format' do
|
492
|
+
expect(task.export_format).to eq 'IPA'
|
493
|
+
end
|
494
|
+
|
495
|
+
it 'configures the export path' do
|
496
|
+
expect(task.export_path).to eq 'build/Example.ipa'
|
497
|
+
end
|
498
|
+
|
499
|
+
it 'configures the export provisioning profile' do
|
500
|
+
expect(task.export_provisioning_profile).to eq 'Ad_Hoc.mobileprovision'
|
501
|
+
end
|
502
|
+
|
503
|
+
it 'configures the export signing identity' do
|
504
|
+
expect(task.export_signing_identity).to eq 'iPhone Distribution: kishikawa katsumi'
|
505
|
+
end
|
506
|
+
|
507
|
+
describe 'tasks' do
|
508
|
+
describe 'export' do
|
509
|
+
subject { Rake.application['build:export'] }
|
510
|
+
|
511
|
+
it 'executes the appropriate commands' do
|
512
|
+
subject.invoke
|
513
|
+
expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportFormat IPA -exportPath build/Example.ipa -exportProvisioningProfile Ad_Hoc.mobileprovision -exportSigningIdentity iPhone Distribution: kishikawa katsumi']
|
514
|
+
end
|
515
|
+
end
|
516
|
+
end
|
517
|
+
end
|
518
|
+
|
519
|
+
describe 'export task for PKG' do
|
520
|
+
let!(:task) do
|
521
|
+
XCJobs::Export.new do |t|
|
522
|
+
t.archive_path = 'build/Example'
|
523
|
+
t.export_format = 'PKG'
|
524
|
+
t.export_path = 'build/Example.pkg'
|
525
|
+
t.export_signing_identity = 'Developer ID Application'
|
526
|
+
t.export_installer_identity = 'Developer ID Installer'
|
527
|
+
end
|
528
|
+
end
|
529
|
+
|
530
|
+
it 'configures the archive path' do
|
531
|
+
expect(task.archive_path).to eq 'build/Example'
|
532
|
+
end
|
533
|
+
|
534
|
+
it 'configures the export format' do
|
535
|
+
expect(task.export_format).to eq 'PKG'
|
536
|
+
end
|
537
|
+
|
538
|
+
it 'configures the export path' do
|
539
|
+
expect(task.export_path).to eq 'build/Example.pkg'
|
540
|
+
end
|
541
|
+
|
542
|
+
it 'configures the export signing identity' do
|
543
|
+
expect(task.export_signing_identity).to eq 'Developer ID Application'
|
544
|
+
end
|
545
|
+
|
546
|
+
it 'configures the export installer identity' do
|
547
|
+
expect(task.export_installer_identity).to eq 'Developer ID Installer'
|
548
|
+
end
|
549
|
+
|
550
|
+
describe 'tasks' do
|
551
|
+
describe 'export' do
|
552
|
+
subject { Rake.application['build:export'] }
|
553
|
+
|
554
|
+
it 'executes the appropriate commands' do
|
555
|
+
subject.invoke
|
556
|
+
expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportFormat PKG -exportPath build/Example.pkg -exportSigningIdentity Developer ID Application -exportInstallerIdentity Developer ID Installer']
|
557
|
+
end
|
558
|
+
end
|
559
|
+
end
|
560
|
+
end
|
561
|
+
end
|
422
562
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcjobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kishikawa katsumi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|