xcjobs 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d55bb96a8d15b7cfb189f0cb8b55b971b83066cf
4
- data.tar.gz: bab8f956c58e238a7ca8da889b18d03e3146ecd7
3
+ metadata.gz: eac32d8569de052550d96593eff82cd0a763869a
4
+ data.tar.gz: 34e41ea1409433f0c7c10e5e463f75e3fe6b23f1
5
5
  SHA512:
6
- metadata.gz: 8009f8194b4ae4890ecd77af17d664a5ae4754bf02af0be3a0ae297b6f826874872545d1166b9c99dca863239f32011ca1d6a9bd741d58834a72179496d5f03e
7
- data.tar.gz: 33d3000abf7185916fa8e2dfaa7b3fd2758b91b0b74bbcf7f9762f76961136c9a29d72297e710d00017ef61427657e1a95a818dec84fa1e932e4679c4b6647f1
6
+ metadata.gz: da839be27a65f45ae32383785cb749dce1d5c5a63b12d79c6873c3a5ade2bdef79a07fc25c27fc609526588a5b9ec557bf11a4022ab6482ecfdbee46071a87fc
7
+ data.tar.gz: 161aaf870817f335ee57b0940bfd501ec6695339ddf7a7d238ac14dd356dd5e8026547fc853160966227b88d9c55dd93b1c6d1085d16cef6ec6aa04300f27314
data/README.md CHANGED
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  ```ruby
28
28
  XCJobs::Test.new do |t|
29
- t.workspace = "Example.xcworkspace"
29
+ t.workspace = "Example"
30
30
  t.scheme = "Example"
31
31
  t.configuration = "Release"
32
32
  t.add_destination("name=iPad 2,OS=7.1")
@@ -51,7 +51,7 @@ xcodebuild test -workspace Example.xcworkspace -scheme Example -sdk iphonesimula
51
51
 
52
52
  ```ruby
53
53
  XCJobs::Build.new do |t|
54
- t.workspace = "Example.xcworkspace"
54
+ t.workspace = "Example"
55
55
  t.scheme = "Example"
56
56
  t.configuration = "Release"
57
57
  t.signing_identity = "iPhone Distribution: kishikawa katsumi"
@@ -76,7 +76,7 @@ xcodebuild build -workspace Example.xcworkspace -scheme Example -configuration R
76
76
 
77
77
  ```ruby
78
78
  XCJobs::Archive.new do |t|
79
- t.workspace = "Example.xcworkspace"
79
+ t.workspace = "Example"
80
80
  t.scheme = "Example"
81
81
  t.configuration = "Release"
82
82
  t.signing_identity = "iPhone Distribution: kishikawa katsumi"
@@ -108,7 +108,7 @@ xcodebuild archive -workspace Example.xcworkspace -scheme Example -configuration
108
108
  ```shell
109
109
  $ bundle exec rake build:export
110
110
 
111
- xcodebuild -exportArchive -exportFormat IPA -archivePath build/Example.xcarchive -exportPath build/Example.ipa -exportProvisioningProfile Ad Hoc
111
+ xcodebuild -exportArchive -exportFormat IPA -archivePath build/Example.xcarchive -exportPath build/Example.ipa -exportProvisioningProfile Ad Hoc Provisioning Profile
112
112
  ```
113
113
 
114
114
  ### Distribute (Upload to Testfligh/Crittercism)
@@ -0,0 +1,24 @@
1
+ module XCJobs
2
+ module Helper
3
+ def self.extract_provisioning_profile(provisioning_profile)
4
+ if File.file?(provisioning_profile)
5
+ provisioning_profile_path = provisioning_profile
6
+ else
7
+ path = File.join("#{Dir.home}/Library/MobileDevice/Provisioning Profiles/", provisioning_profile)
8
+ if File.file?(path)
9
+ provisioning_profile_path = path
10
+ end
11
+ end
12
+ if provisioning_profile_path
13
+ out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:UUID /dev/stdin <<< $(security cms -D -i "#{provisioning_profile_path}")]
14
+ provisioning_profile_uuid = out.strip if status.success?
15
+
16
+ out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:Name /dev/stdin <<< $(security cms -D -i "#{provisioning_profile_path}")]
17
+ provisioning_profile_name = out.strip if status.success?
18
+ else
19
+ provisioning_profile_name = provisioning_profile
20
+ end
21
+ [provisioning_profile_path, provisioning_profile_uuid, provisioning_profile_name]
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module XCJobs
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require 'rake/tasklib'
2
2
  require 'rake/clean'
3
3
  require 'open3'
4
+ require_relative 'helper'
4
5
 
5
6
  module XCJobs
6
7
  class Xcodebuild < Rake::TaskLib
@@ -50,24 +51,7 @@ module XCJobs
50
51
 
51
52
  def provisioning_profile=(provisioning_profile)
52
53
  @provisioning_profile = provisioning_profile
53
-
54
- if File.file?(provisioning_profile)
55
- @provisioning_profile_path = provisioning_profile
56
- else
57
- path = File.join("#{Dir.home}/Library/MobileDevice/Provisioning Profiles/", provisioning_profile)
58
- if File.file?(path)
59
- @provisioning_profile_path = path
60
- end
61
- end
62
- if @provisioning_profile_path
63
- out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:UUID /dev/stdin <<< $(security cms -D -i "#{@provisioning_profile_path}")]
64
- @provisioning_profile_uuid = out.strip if status.success?
65
-
66
- out, status = Open3.capture2 %[/usr/libexec/PlistBuddy -c Print:Name /dev/stdin <<< $(security cms -D -i "#{@provisioning_profile_path}")]
67
- @provisioning_profile_name = out.strip if status.success?
68
- else
69
- @provisioning_profile_name = provisioning_profile
70
- end
54
+ @provisioning_profile_path, @provisioning_profile_uuid, @provisioning_profile_name = XCJobs::Helper.extract_provisioning_profile(provisioning_profile)
71
55
  end
72
56
 
73
57
  def add_destination(destination)
@@ -268,6 +252,15 @@ module XCJobs
268
252
  @export_format || 'IPA'
269
253
  end
270
254
 
255
+ def export_provisioning_profile=(provisioning_profile)
256
+ provisioning_profile_path, provisioning_profile_uuid, provisioning_profile_name = XCJobs::Helper.extract_provisioning_profile(provisioning_profile)
257
+ if provisioning_profile_name
258
+ @export_provisioning_profile = provisioning_profile_name
259
+ else
260
+ @export_provisioning_profile = provisioning_profile
261
+ end
262
+ end
263
+
271
264
  private
272
265
 
273
266
  def define
@@ -479,7 +479,54 @@ describe XCJobs::Xcodebuild do
479
479
  t.archive_path = 'build/Example'
480
480
  t.export_format = 'IPA'
481
481
  t.export_path = 'build/Example.ipa'
482
- t.export_provisioning_profile = 'Ad_Hoc.mobileprovision'
482
+ if ENV['CI']
483
+ t.export_provisioning_profile = 'Ad Hoc Provisioning Profile'
484
+ else
485
+ t.export_provisioning_profile = './spec/profiles/adhoc.mobileprovision'
486
+ end
487
+ t.export_signing_identity = 'iPhone Distribution: kishikawa katsumi'
488
+ end
489
+ end
490
+
491
+ it 'configures the archive path' do
492
+ expect(task.archive_path).to eq 'build/Example'
493
+ end
494
+
495
+ it 'configures the export format' do
496
+ expect(task.export_format).to eq 'IPA'
497
+ end
498
+
499
+ it 'configures the export path' do
500
+ expect(task.export_path).to eq 'build/Example.ipa'
501
+ end
502
+
503
+ it 'configures the export provisioning profile' do
504
+ expect(task.export_provisioning_profile).to eq 'Ad Hoc Provisioning Profile'
505
+ end
506
+
507
+ it 'configures the export signing identity' do
508
+ expect(task.export_signing_identity).to eq 'iPhone Distribution: kishikawa katsumi'
509
+ end
510
+
511
+ describe 'tasks' do
512
+ describe 'export' do
513
+ subject { Rake.application['build:export'] }
514
+
515
+ it 'executes the appropriate commands' do
516
+ subject.invoke
517
+ expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportFormat IPA -exportPath build/Example.ipa -exportProvisioningProfile Ad Hoc Provisioning Profile -exportSigningIdentity iPhone Distribution: kishikawa katsumi']
518
+ end
519
+ end
520
+ end
521
+ end
522
+
523
+ describe 'export task for IPA' do
524
+ let!(:task) do
525
+ XCJobs::Export.new do |t|
526
+ t.archive_path = 'build/Example'
527
+ t.export_format = 'IPA'
528
+ t.export_path = 'build/Example.ipa'
529
+ t.export_provisioning_profile = 'Ad Hoc Provisioning Profile'
483
530
  t.export_signing_identity = 'iPhone Distribution: kishikawa katsumi'
484
531
  end
485
532
  end
@@ -497,7 +544,7 @@ describe XCJobs::Xcodebuild do
497
544
  end
498
545
 
499
546
  it 'configures the export provisioning profile' do
500
- expect(task.export_provisioning_profile).to eq 'Ad_Hoc.mobileprovision'
547
+ expect(task.export_provisioning_profile).to eq 'Ad Hoc Provisioning Profile'
501
548
  end
502
549
 
503
550
  it 'configures the export signing identity' do
@@ -510,7 +557,7 @@ describe XCJobs::Xcodebuild do
510
557
 
511
558
  it 'executes the appropriate commands' do
512
559
  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']
560
+ expect(@commands).to eq ['xcodebuild -exportArchive -archivePath build/Example -exportFormat IPA -exportPath build/Example.ipa -exportProvisioningProfile Ad Hoc Provisioning Profile -exportSigningIdentity iPhone Distribution: kishikawa katsumi']
514
561
  end
515
562
  end
516
563
  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.3
4
+ version: 0.0.4
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-12-16 00:00:00.000000000 Z
11
+ date: 2014-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -83,6 +83,7 @@ files:
83
83
  - lib/xcjobs.rb
84
84
  - lib/xcjobs/certificate.rb
85
85
  - lib/xcjobs/distribute.rb
86
+ - lib/xcjobs/helper.rb
86
87
  - lib/xcjobs/info_plist.rb
87
88
  - lib/xcjobs/version.rb
88
89
  - lib/xcjobs/xcodebuild.rb