xcjobs 0.2.5 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 948f6e3c8ee8b50dad1e1f24d955bc59d9e9884f
4
- data.tar.gz: 196cd3e5c69c34090b4cfe1cd08b8a528d603e9a
3
+ metadata.gz: e4c4306b452320be5d2c072f1698f3c7d8f7a4fb
4
+ data.tar.gz: d6a07bf56db736e8930823b9ab9ac2b9bcada113
5
5
  SHA512:
6
- metadata.gz: d9c8139fa4f033a24ce4a0d98c7da1894ca272675c6d469c1bc9dcc0fadf9e5863ea54cd25a75a5f5a715f8de068e741c37e25528d02c2d2b716de81e6231436
7
- data.tar.gz: c129ea3a349370964038ac642b94a3bcf6b85ce5aac7c002253ed1b4c6ee90e524a7b91ea8832b13c6ac27dcdea27f75dd6b28609c0ff96537b011bd8b8bd554
6
+ metadata.gz: 09b03987ce8067398f09a528f910b0312af2f9fd6b6e94d9d84d66e135795da91da749453159645e78d2a73e415024c3b9fae2b0b16db79e3bb590303f73554a
7
+ data.tar.gz: 1e14499775964041a9d4ddad1a25fbc224228953c8118df02bb4ec4478437e71e68ec112b41b776de91fca999f347a5800588e2fecb7b2f9d068b3acc3e6a90f
@@ -1,3 +1,3 @@
1
1
  module XCJobs
2
- VERSION = "0.2.5"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -26,12 +26,15 @@ module XCJobs
26
26
  attr_reader :provisioning_profile_name
27
27
  attr_reader :provisioning_profile_uuid
28
28
 
29
+ attr_accessor :unsetenv_others
30
+
29
31
  def initialize(name)
30
32
  $stdout.sync = $stderr.sync = true
31
33
 
32
34
  @name = name
33
35
  @destinations = []
34
36
  @build_settings = {}
37
+ @unsetenv_others = false
35
38
  end
36
39
 
37
40
  def project
@@ -82,8 +85,11 @@ module XCJobs
82
85
  puts cmd.join(" ")
83
86
  end
84
87
 
88
+ env = {}
89
+ options = { unsetenv_others: unsetenv_others }
90
+
85
91
  if @formatter
86
- Open3.pipeline_r(cmd, [@formatter]) do |stdout, wait_thrs|
92
+ Open3.pipeline_r([env] + cmd + [options], [@formatter]) do |stdout, wait_thrs|
87
93
  output = []
88
94
  while line = stdout.gets
89
95
  puts line
@@ -98,7 +104,7 @@ module XCJobs
98
104
  end
99
105
  end
100
106
  else
101
- Open3.popen2e(*cmd) do |stdin, stdout_err, wait_thr|
107
+ Open3.popen2e(env, *cmd, options) do |stdin, stdout_err, wait_thr|
102
108
  output = []
103
109
  while line = stdout_err.gets
104
110
  puts line
@@ -207,7 +213,7 @@ module XCJobs
207
213
  targetSettings.each do |target, settings|
208
214
  if settings['PRODUCT_TYPE'] == 'com.apple.product-type.framework'
209
215
  if sdk.start_with?('iphone') && settings['ONLY_ACTIVE_ARCH'] == 'NO'
210
- target_dir = settings['OBJECT_FILE_DIR_normal'].gsub('Build/Intermediates', "Build/Intermediates/CodeCoverage/#{target}/Intermediates")
216
+ target_dir = settings['OBJECT_FILE_DIR_normal'].gsub('Build/Intermediates', "Build/Intermediates/CodeCoverage/Intermediates")
211
217
  executable_name = settings['EXECUTABLE_NAME']
212
218
  target_path = File.join(File.join(target_dir, settings['CURRENT_ARCH']), executable_name)
213
219
  else
@@ -219,7 +225,7 @@ module XCJobs
219
225
 
220
226
  end
221
227
 
222
- code_coverage_dir = settings['BUILD_DIR'].gsub('Build/Products', "Build/Intermediates/CodeCoverage/#{target}/")
228
+ code_coverage_dir = settings['BUILD_DIR'].gsub('Build/Products', "/Build/Intermediates/CodeCoverage/")
223
229
  profdata_path = File.join(code_coverage_dir, 'Coverage.profdata')
224
230
 
225
231
  show_coverage(profdata_path, target_path)
@@ -351,9 +357,12 @@ module XCJobs
351
357
  attr_accessor :export_signing_identity
352
358
  attr_accessor :export_installer_identity
353
359
  attr_accessor :export_with_original_signing_identity
360
+ attr_accessor :options_plist
354
361
 
355
362
  def initialize(name = :export)
356
363
  super
364
+ self.unsetenv_others = true
365
+ @export_format = 'IPA'
357
366
  yield self if block_given?
358
367
  define
359
368
  end
@@ -363,7 +372,7 @@ module XCJobs
363
372
  end
364
373
 
365
374
  def export_format
366
- @export_format || 'IPA'
375
+ @export_format
367
376
  end
368
377
 
369
378
  def export_provisioning_profile=(provisioning_profile)
@@ -388,6 +397,7 @@ module XCJobs
388
397
 
389
398
  def options
390
399
  [].tap do |opts|
400
+ opts.concat(['-exportOptionsPlist', options_plist]) if options_plist
391
401
  opts.concat(['-archivePath', archive_path]) if archive_path
392
402
  opts.concat(['-exportFormat', export_format]) if export_format
393
403
  opts.concat(['-exportPath', export_path]) if export_path
@@ -334,6 +334,29 @@ describe XCJobs::Xcodebuild do
334
334
  end
335
335
  end
336
336
  end
337
+
338
+ describe 'unsetenv_others' do
339
+ it 'defaults to false' do
340
+ task = XCJobs::Build.new do |t|
341
+ t.project = 'Example.xcodeproj'
342
+ t.target = 'Example'
343
+ t.configuration = 'Release'
344
+ end
345
+
346
+ expect(task.unsetenv_others).to eq false
347
+ end
348
+
349
+ it 'can be configured' do
350
+ task = XCJobs::Build.new do |t|
351
+ t.project = 'Example.xcodeproj'
352
+ t.target = 'Example'
353
+ t.configuration = 'Release'
354
+ t.unsetenv_others = true
355
+ end
356
+
357
+ expect(task.unsetenv_others).to eq true
358
+ end
359
+ end
337
360
  end
338
361
 
339
362
  describe XCJobs::Archive do
@@ -512,6 +535,10 @@ describe XCJobs::Xcodebuild do
512
535
  expect(task.export_signing_identity).to eq 'iPhone Distribution: kishikawa katsumi'
513
536
  end
514
537
 
538
+ it 'configures unsetenv_others to true by default' do
539
+ expect(task.unsetenv_others).to be_truthy
540
+ end
541
+
515
542
  describe 'tasks' do
516
543
  describe 'export' do
517
544
  subject { Rake.application['build:export'] }
@@ -567,6 +594,81 @@ describe XCJobs::Xcodebuild do
567
594
  end
568
595
  end
569
596
 
597
+ describe 'export task for IPA' do
598
+ let!(:task) do
599
+ XCJobs::Export.new do |t|
600
+ t.archive_path = 'build/Example'
601
+ t.export_format = nil
602
+ t.export_path = 'build'
603
+ end
604
+ end
605
+
606
+ it 'configures the export_format to be nil' do
607
+ expect(task.export_format).to be_nil
608
+ end
609
+
610
+ describe 'tasks' do
611
+ describe 'export' do
612
+ subject { Rake.application['build:export'] }
613
+
614
+ it 'executes the appropriate commands' do
615
+ subject.invoke
616
+ expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportPath build']
617
+ end
618
+ end
619
+ end
620
+ end
621
+
622
+ describe 'export task for IPA' do
623
+ let!(:task) do
624
+ XCJobs::Export.new do |t|
625
+ t.archive_path = 'build/Example'
626
+ t.export_path = 'build'
627
+ end
628
+ end
629
+
630
+ it 'has default export_format default to be IPA' do
631
+ expect(task.export_format).to eq 'IPA'
632
+ end
633
+
634
+ describe 'tasks' do
635
+ describe 'export' do
636
+ subject { Rake.application['build:export'] }
637
+
638
+ it 'executes the appropriate commands' do
639
+ subject.invoke
640
+ expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportFormat IPA -exportPath build']
641
+ end
642
+ end
643
+ end
644
+ end
645
+
646
+ describe 'export task for IPA' do
647
+ let!(:task) do
648
+ XCJobs::Export.new do |t|
649
+ t.archive_path = 'build/Example'
650
+ t.export_format = nil
651
+ t.export_path = 'build'
652
+ t.options_plist = 'options.plist'
653
+ end
654
+ end
655
+
656
+ it 'configures the export options plist' do
657
+ expect(task.options_plist).to eq 'options.plist'
658
+ end
659
+
660
+ describe 'tasks' do
661
+ describe 'export' do
662
+ subject { Rake.application['build:export'] }
663
+
664
+ it 'executes the appropriate commands' do
665
+ subject.invoke
666
+ expect(@commands).to eq ['xcodebuild -exportArchive -exportOptionsPlist options.plist -archivePath build/Example -exportPath build']
667
+ end
668
+ end
669
+ end
670
+ end
671
+
570
672
  describe 'export task for PKG' do
571
673
  let!(:task) do
572
674
  XCJobs::Export.new do |t|
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.2.5
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kishikawa katsumi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-23 00:00:00.000000000 Z
11
+ date: 2016-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.4.5.1
123
+ rubygems_version: 2.5.1
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Support the automation of release process of iOS/OSX apps with CI