ios_build_kit 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -7
- data/lib/ios_build_kit/tasks/create_ipa.rb +1 -1
- data/lib/ios_build_kit/tasks/decorate_icon.rb +4 -5
- data/lib/ios_build_kit/tasks/xcode_build.rb +1 -0
- data/lib/ios_build_kit/version.rb +1 -1
- data/spec/create_ipa_spec.rb +12 -9
- data/spec/decorate_icon_spec.rb +15 -12
- data/spec/increment_version_spec.rb +33 -18
- data/spec/reports_spec.rb +28 -4
- data/spec/run_tests_spec.rb +14 -15
- data/spec/spec_helper.rb +8 -2
- data/spec/support/config_mocker.rb +41 -11
- data/spec/support/temp_dir.rb +16 -2
- data/spec/xcode_build_spec.rb +22 -20
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5df918eb68f714f87074d768e0a12774090f67e
|
4
|
+
data.tar.gz: 4a0436a580aa7fe4b5b22c543a2fe2bb4512342b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44e6fab90482c1d9686622880c6bc10adb5f94888883c1aa52f4255e4cab9c68d42d0c93e5fe3e7354eff84127fde15a6ce21c63737f27f0f00d77934533496e
|
7
|
+
data.tar.gz: 9d31418d802f4397eb2c6c3e0d6a1b3e7614ba0482882f1f16f2626d2f4de38791b964b2748cdd91bb2308bc8a13ff3dd83b496ec37482f1dacf66be56867c8f
|
data/README.md
CHANGED
@@ -11,7 +11,7 @@ Bundled build tasks include:
|
|
11
11
|
- Run unit tests
|
12
12
|
- Generate an .ipa artefact
|
13
13
|
|
14
|
-
BuildKit is distributed as a [Ruby gem](https://rubygems.org/gems/ios_build_kit) with an executable that can be launched either in a
|
14
|
+
BuildKit is distributed as a [Ruby gem](https://rubygems.org/gems/ios_build_kit) with an executable that can be launched either in a continuous integration server environment or on your development machine. The process is configured with a simple YAML file that describes the tasks to run and your project-specific options. This means that you can tailor the build process to meet your requirements.
|
15
15
|
|
16
16
|
*Note: This repository was previosly known as Xcode-Project. It previously contained a project generator as well as a less developed build toolkit. The generator was removed due to the rapid advances in iOS technology. If you would like to continue using the previous version it's available [here](https://github.com/adamwaite/iOS-Build-Kit/releases).*
|
17
17
|
|
@@ -194,8 +194,6 @@ Runs unit tests:
|
|
194
194
|
|
195
195
|
![run_tests](resources/run_tests.png)
|
196
196
|
|
197
|
-
*Note regarding Kiwi: As of present you need to use 'edge Kiwi' due to [Kiwi issue 390](https://github.com/allending/Kiwi/issues/390). To used the latest Kiwi put `pod 'Kiwi/XCTest', git: 'https://github.com/allending/Kiwi'` in your Podfile.*
|
198
|
-
|
199
197
|
Options:
|
200
198
|
- `log`: logs the output to the console
|
201
199
|
|
@@ -236,14 +234,12 @@ An example workspace has been included in the repo if you want to try it out. Yo
|
|
236
234
|
|
237
235
|
Lots of plans for BuildKit:
|
238
236
|
|
239
|
-
-
|
240
|
-
-
|
237
|
+
- Create a build task module to enable artefact distribution by wrapping [Shenzhen](https://github.com/nomad/shenzhen) (in progress).
|
238
|
+
- Add a generator for config files (next up).
|
241
239
|
- Add a means to allow custom task modules to be added to the process.
|
242
240
|
- Add a task to email build reports.
|
243
241
|
- Make `decorate_icon` compatible with Xcode 5 asset catalogues.
|
244
|
-
- Add a generator for config files.
|
245
242
|
- Add some colour to the output.
|
246
|
-
- Beautify the reports.
|
247
243
|
|
248
244
|
## Contributing
|
249
245
|
|
@@ -43,7 +43,7 @@ module BuildKit
|
|
43
43
|
if @runner.has_completed_task? :increment_version
|
44
44
|
name << @runner.store[:new_version_number][:full]
|
45
45
|
else
|
46
|
-
name << BuildKit::Utilities::VersionNumber.plist_version_number[:full]
|
46
|
+
name << BuildKit::Utilities::VersionNumber.plist_version_number(@config.info_plist)[:full]
|
47
47
|
end
|
48
48
|
end
|
49
49
|
name << "-"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BuildKit
|
2
2
|
|
3
3
|
require 'rmagick'
|
4
|
-
|
4
|
+
|
5
5
|
module Tasks
|
6
6
|
|
7
7
|
def self.decorate_icon runner, task_opts
|
@@ -42,7 +42,7 @@ module BuildKit
|
|
42
42
|
|
43
43
|
def icon_files_to_decorate
|
44
44
|
to_decorate = []
|
45
|
-
Dir.glob("#{
|
45
|
+
Dir.glob("#{@config.icon_dir}/*.png").each do |filename|
|
46
46
|
next if filename.include? "Decorated"
|
47
47
|
to_decorate << filename
|
48
48
|
end
|
@@ -58,7 +58,6 @@ module BuildKit
|
|
58
58
|
def create_decorated_version_of icon_path
|
59
59
|
original = Magick::ImageList.new icon_path
|
60
60
|
decorated_icon = original.copy
|
61
|
-
|
62
61
|
icon_dimension = original.rows
|
63
62
|
|
64
63
|
background = Magick::Draw.new
|
@@ -66,7 +65,7 @@ module BuildKit
|
|
66
65
|
background.rectangle(0, icon_dimension - (icon_dimension * 0.225), icon_dimension, icon_dimension)
|
67
66
|
background.draw decorated_icon
|
68
67
|
|
69
|
-
annotation_params = {
|
68
|
+
annotation_params = {
|
70
69
|
gravity: Magick::SouthGravity,
|
71
70
|
pointsize: icon_dimension * 0.11 ,
|
72
71
|
stroke: 'transparent',
|
@@ -96,7 +95,7 @@ module BuildKit
|
|
96
95
|
|
97
96
|
def complete_task!
|
98
97
|
message = "Icons have been decorated with #{version_number_to_draw}. They are here: " + @decorated_icons.join(",")
|
99
|
-
@runner.task_completed! :
|
98
|
+
@runner.task_completed! :decorate_icon, message, message
|
100
99
|
end
|
101
100
|
|
102
101
|
end
|
@@ -26,6 +26,7 @@ module BuildKit
|
|
26
26
|
|
27
27
|
def assert_requirements
|
28
28
|
BuildKit::Utilities::Assertions.assert_required_config [:app_name, :workspace, :sdk, :build_configuration, :build_dir, :scheme], @runner
|
29
|
+
BuildKit::Utilities::Assertions.assert_files_exist [@config.absolute_build_dir, @config.workspace]
|
29
30
|
end
|
30
31
|
|
31
32
|
def create_build_directory
|
data/spec/create_ipa_spec.rb
CHANGED
@@ -1,26 +1,29 @@
|
|
1
1
|
require_relative 'spec_helper'
|
2
2
|
|
3
|
-
describe "
|
3
|
+
describe "create_ipa task" do
|
4
4
|
|
5
5
|
describe "invalid config handling" do
|
6
|
-
|
7
6
|
context "missing previous tasks" do
|
8
|
-
|
9
7
|
context "xcode_build" do
|
10
|
-
|
8
|
+
let(:runner) { mock_runner vc.enable_create_ipa! }
|
9
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
11
10
|
end
|
12
|
-
|
13
11
|
end
|
14
|
-
|
15
12
|
end
|
16
13
|
|
17
14
|
describe "ipa creation" do
|
18
|
-
|
15
|
+
let!(:existing_ipa_exists) { (Dir["#{runner.config.build_dir}/*"].reject{ |f| !f.include? ".ipa" }.count > 0) }
|
16
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.enable_create_ipa! }
|
17
|
+
before { runner.run_tasks! }
|
18
|
+
specify { existing_ipa_exists.should be_false }
|
19
|
+
specify { Dir["#{runner.config.build_dir}/*"].reject{ |f| !f.include? ".ipa" }.count.should == 1 }
|
19
20
|
end
|
20
21
|
|
21
22
|
describe "task completion" do
|
22
|
-
|
23
|
-
|
23
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.enable_create_ipa! }
|
24
|
+
before { runner.run_tasks! }
|
25
|
+
specify { runner.tasks[:completed].include?(:create_ipa).should be_true }
|
26
|
+
specify { runner.outputs[:create_ipa].should_not be_nil }
|
24
27
|
end
|
25
28
|
|
26
29
|
end
|
data/spec/decorate_icon_spec.rb
CHANGED
@@ -1,34 +1,37 @@
|
|
1
1
|
require_relative 'spec_helper'
|
2
|
+
require 'fileutils'
|
2
3
|
|
3
4
|
describe "decorate_icon task" do
|
4
5
|
|
5
6
|
describe "invalid config handling" do
|
6
|
-
|
7
7
|
context "missing configuration" do
|
8
|
-
|
9
8
|
context "icon_dir" do
|
10
|
-
|
9
|
+
let(:runner) { mock_runner vc.enable_decorate_icon!.remove_config! :icon_dir }
|
10
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
11
11
|
end
|
12
|
-
|
13
12
|
end
|
14
13
|
|
15
14
|
context "non-existent files" do
|
16
|
-
|
17
15
|
context "icon_dir" do
|
18
|
-
|
16
|
+
let(:runner) { mock_runner vc.enable_decorate_icon!.invalid_location! :icon_dir }
|
17
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
|
-
|
23
20
|
end
|
24
21
|
|
25
|
-
describe "new icons" do
|
26
|
-
|
22
|
+
describe "new icons" do
|
23
|
+
let!(:existing_icon_file_count) { Dir["#{temp_icon_dir_path}/*.png"].count }
|
24
|
+
let(:runner) { mock_runner vc.enable_decorate_icon!.modify_config!(:icon_dir, temp_icon_dir_path) }
|
25
|
+
before { runner.run_tasks! }
|
26
|
+
specify { Dir["#{temp_icon_dir_path}/*.png"].count.should == existing_icon_file_count * 2 }
|
27
|
+
specify { Dir["#{temp_icon_dir_path}/*.png"].reject{ |f| !f.include? "Decorated" }.count.should == existing_icon_file_count }
|
27
28
|
end
|
28
29
|
|
29
30
|
describe "task completion" do
|
30
|
-
|
31
|
-
|
31
|
+
let(:runner) { mock_runner vc.enable_decorate_icon! }
|
32
|
+
before { runner.run_tasks! }
|
33
|
+
specify { runner.tasks[:completed].include?(:decorate_icon).should be_true }
|
34
|
+
specify { runner.outputs[:decorate_icon].should_not be_nil }
|
32
35
|
end
|
33
36
|
|
34
37
|
end
|
@@ -3,46 +3,61 @@ require_relative 'spec_helper'
|
|
3
3
|
describe "xcode_build task" do
|
4
4
|
|
5
5
|
describe "invalid config handling" do
|
6
|
-
|
7
6
|
context "missing configuration" do
|
8
|
-
|
9
7
|
context "info_plist" do
|
10
|
-
|
8
|
+
let(:runner) { mock_runner vc.enable_increment_version!.remove_config! :info_plist }
|
9
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
11
10
|
end
|
12
|
-
|
13
11
|
end
|
14
|
-
|
15
12
|
context "non-existent files" do
|
16
|
-
|
17
13
|
context "info_plist" do
|
18
|
-
|
14
|
+
let(:runner) { mock_runner vc.enable_increment_version!.missing_file! :info_plist }
|
15
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
19
16
|
end
|
20
|
-
|
21
17
|
end
|
22
|
-
|
23
18
|
end
|
24
19
|
|
25
|
-
describe "plist reading" do
|
26
|
-
|
27
|
-
|
20
|
+
describe "plist reading" do
|
21
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
22
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist).should be_kind_of Hash }
|
23
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:major].should be_kind_of Integer }
|
24
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:minor].should be_kind_of Integer }
|
25
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:revision].should be_kind_of Integer }
|
26
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:build].should be_kind_of Integer }
|
28
27
|
end
|
29
28
|
|
30
29
|
describe "existing version" do
|
31
|
-
|
30
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
31
|
+
let!(:existing_version) { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist) }
|
32
|
+
before { runner.run_tasks! }
|
33
|
+
specify { runner.store[:existing_version_number].should == existing_version }
|
32
34
|
end
|
33
35
|
|
34
36
|
describe "new version" do
|
35
|
-
|
37
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
38
|
+
before { runner.run_tasks! }
|
39
|
+
specify { runner.store[:new_version_number].should_not be_nil }
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "it increments the build number" do
|
43
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
44
|
+
let!(:existing_build_number) { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:build] }
|
45
|
+
before { runner.run_tasks! }
|
46
|
+
specify { runner.store[:new_version_number][:build].should == existing_build_number + 1 }
|
36
47
|
end
|
37
48
|
|
38
49
|
describe "writing the new version to the plist" do
|
39
|
-
|
40
|
-
|
50
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
51
|
+
let!(:existing_build_number) { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:build] }
|
52
|
+
before { runner.run_tasks! }
|
53
|
+
specify { BuildKit::Utilities::VersionNumber.plist_version_number(runner.config.info_plist)[:build].should == existing_build_number + 1 }
|
41
54
|
end
|
42
55
|
|
43
56
|
describe "task completion" do
|
44
|
-
|
45
|
-
|
57
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
58
|
+
before { runner.run_tasks! }
|
59
|
+
specify { runner.tasks[:completed].include?(:increment_version).should be_true }
|
60
|
+
specify { runner.outputs[:increment_version].should_not be_nil }
|
46
61
|
end
|
47
62
|
|
48
63
|
end
|
data/spec/reports_spec.rb
CHANGED
@@ -2,12 +2,36 @@ require_relative 'spec_helper'
|
|
2
2
|
|
3
3
|
describe "report generation" do
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
let(:run_task) { :increment_version.to_s }
|
6
|
+
let(:report_path) { vc[:preferences][:reports] }
|
7
|
+
let(:report_count) { Dir["#{report_path}/*.json"].count }
|
8
|
+
|
9
|
+
context "reports on" do
|
10
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
11
|
+
before { runner.run_tasks! }
|
12
|
+
specify { report_count.should == 1 }
|
7
13
|
end
|
8
14
|
|
9
|
-
context "
|
10
|
-
|
15
|
+
context "reports off" do
|
16
|
+
let(:runner) { mock_runner vc.enable_increment_version!.modify_preference! :reports, nil }
|
17
|
+
before { runner.run_tasks! }
|
18
|
+
specify { report_count.should == 0 }
|
11
19
|
end
|
12
20
|
|
21
|
+
context "JSON" do
|
22
|
+
let(:runner) { mock_runner vc.enable_increment_version! }
|
23
|
+
let(:report) { Dir["#{report_path}/*.json"].first }
|
24
|
+
let(:report_json_string) { File.read(Dir["#{report_path}/*.json"].first) }
|
25
|
+
let(:report_content_hash) { JSON.parse(report_json_string) }
|
26
|
+
before { runner.run_tasks! }
|
27
|
+
specify { report_json_string.should be_kind_of String }
|
28
|
+
specify { report_content_hash.should be_kind_of Hash }
|
29
|
+
specify { report_content_hash[:time.to_s].should_not be_nil }
|
30
|
+
specify { report_content_hash[:config.to_s].should_not be_nil }
|
31
|
+
specify { report_content_hash[:preferences.to_s].should_not be_nil }
|
32
|
+
specify { report_content_hash[:runtime_store.to_s].should_not be_nil }
|
33
|
+
specify { report_content_hash[:outputs.to_s].should_not be_nil }
|
34
|
+
specify { report_content_hash[:outputs.to_s][run_task].should_not be_nil }
|
35
|
+
end
|
36
|
+
|
13
37
|
end
|
data/spec/run_tests_spec.rb
CHANGED
@@ -3,40 +3,39 @@ require_relative 'spec_helper'
|
|
3
3
|
describe "run_tests task" do
|
4
4
|
|
5
5
|
describe "invalid config handling" do
|
6
|
-
|
7
6
|
context "missing configuration" do
|
8
|
-
|
9
7
|
context "workspace" do
|
10
|
-
|
8
|
+
let(:runner) { mock_runner vc.enable_run_tests!.remove_config! :workspace }
|
9
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
11
10
|
end
|
12
|
-
|
13
11
|
context "scheme" do
|
14
|
-
|
12
|
+
let(:runner) { mock_runner vc.enable_run_tests!.remove_config! :scheme }
|
13
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
15
14
|
end
|
16
|
-
|
17
15
|
end
|
18
|
-
|
19
16
|
context "non-existent files" do
|
20
|
-
|
21
17
|
context "workspace" do
|
22
|
-
|
18
|
+
let(:runner) { mock_runner vc.enable_run_tests!.invalid_location! :workspace }
|
19
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
23
20
|
end
|
24
|
-
|
25
21
|
end
|
26
|
-
|
27
22
|
end
|
28
23
|
|
29
24
|
describe "passing tests" do
|
30
|
-
|
25
|
+
let(:runner) { mock_runner vc.enable_run_tests! }
|
26
|
+
before { runner.run_tasks! }
|
27
|
+
specify { runner.store[:tests_passed].should be_true }
|
31
28
|
end
|
32
29
|
|
33
30
|
describe "failing tests" do
|
34
|
-
pending "
|
31
|
+
pending "Create a failing test target, compare YES to NO or something"
|
35
32
|
end
|
36
33
|
|
37
34
|
describe "task completion" do
|
38
|
-
|
39
|
-
|
35
|
+
let(:runner) { mock_runner vc.enable_run_tests! }
|
36
|
+
before { runner.run_tasks! }
|
37
|
+
specify { runner.tasks[:completed].include?(:run_tests).should be_true }
|
38
|
+
specify { runner.outputs[:run_tests].should_not be_nil }
|
40
39
|
end
|
41
40
|
|
42
41
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -14,7 +14,13 @@ RSpec.configure do |config|
|
|
14
14
|
config.formatter = :documentation
|
15
15
|
config.fail_fast = true
|
16
16
|
|
17
|
-
config.before(:each)
|
18
|
-
|
17
|
+
config.before(:each) do
|
18
|
+
create_spec_temp_dir
|
19
|
+
clone_and_modify_icons
|
20
|
+
end
|
21
|
+
|
22
|
+
config.after(:each) do
|
23
|
+
destroy_spec_temp_dir
|
24
|
+
end
|
19
25
|
|
20
26
|
end
|
@@ -2,24 +2,54 @@ require 'yaml'
|
|
2
2
|
|
3
3
|
class Hash
|
4
4
|
|
5
|
-
def enable_increment_version
|
5
|
+
def enable_increment_version!
|
6
6
|
self[:tasks][:increment_version][:run] = true
|
7
|
+
self
|
7
8
|
end
|
8
9
|
|
9
|
-
def enable_decorate_icon
|
10
|
+
def enable_decorate_icon!
|
10
11
|
self[:tasks][:decorate_icon][:run] = true
|
12
|
+
self
|
11
13
|
end
|
12
14
|
|
13
|
-
def enable_xcode_build
|
15
|
+
def enable_xcode_build!
|
14
16
|
self[:tasks][:xcode_build][:run] = true
|
17
|
+
self
|
15
18
|
end
|
16
19
|
|
17
|
-
def enable_run_tests
|
20
|
+
def enable_run_tests!
|
18
21
|
self[:tasks][:run_tests][:run] = true
|
22
|
+
self
|
19
23
|
end
|
20
24
|
|
21
|
-
def enable_create_ipa
|
25
|
+
def enable_create_ipa!
|
22
26
|
self[:tasks][:create_ipa][:run] = true
|
27
|
+
self
|
28
|
+
end
|
29
|
+
|
30
|
+
def modify_config! key, value
|
31
|
+
self[:configuration][key] = value
|
32
|
+
self
|
33
|
+
end
|
34
|
+
|
35
|
+
def remove_config! key
|
36
|
+
self[:configuration][key] = nil
|
37
|
+
self
|
38
|
+
end
|
39
|
+
|
40
|
+
def missing_file! key
|
41
|
+
self[:configuration][key] = "/path/to/nowhere/missing.file"
|
42
|
+
self
|
43
|
+
end
|
44
|
+
|
45
|
+
def invalid_location! key
|
46
|
+
self[:configuration][key] = "/path/to/nowhere/"
|
47
|
+
self
|
48
|
+
end
|
49
|
+
|
50
|
+
def modify_preference! key, value
|
51
|
+
self[:preferences][key] = value
|
52
|
+
self
|
23
53
|
end
|
24
54
|
|
25
55
|
end
|
@@ -68,19 +98,19 @@ def valid_config_file_data
|
|
68
98
|
|
69
99
|
configuration: {
|
70
100
|
app_name: "BuildKit",
|
71
|
-
workspace: "/Users/adamwaite/iOS/Lib/
|
72
|
-
info_plist: "/Users/adamwaite/iOS/Lib/
|
101
|
+
workspace: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/example/BuildKit.xcworkspace",
|
102
|
+
info_plist: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/example/BuildKit/BuildKit-Info.plist",
|
73
103
|
build_configuration: "Release",
|
74
104
|
scheme: "BuildKit",
|
75
105
|
sdk: "iphoneos",
|
76
|
-
provisioning_profile: "/Users/adamwaite/iOS/Lib/
|
106
|
+
provisioning_profile: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/example/Provisioning/BuildKitTest.mobileprovision",
|
77
107
|
code_sign: "iPhone Distribution: Alpaca Labs",
|
78
|
-
icon_dir: "/Users/adamwaite/iOS/Lib/
|
79
|
-
build_dir: "/Users/adamwaite/iOS/Lib/
|
108
|
+
icon_dir: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/example/BuildKit/Icon/",
|
109
|
+
build_dir: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/spec/temp/",
|
80
110
|
},
|
81
111
|
|
82
112
|
preferences: {
|
83
|
-
reports: "/Users/adamwaite/iOS/Lib/
|
113
|
+
reports: "/Users/adamwaite/iOS/Lib/iOS-Build-Kit/spec/temp/",
|
84
114
|
}
|
85
115
|
|
86
116
|
}
|
data/spec/support/temp_dir.rb
CHANGED
@@ -1,9 +1,23 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
|
3
3
|
def create_spec_temp_dir
|
4
|
-
FileUtils.mkdir_p
|
4
|
+
FileUtils.mkdir_p temp_dir_path
|
5
5
|
end
|
6
6
|
|
7
7
|
def destroy_spec_temp_dir
|
8
|
-
FileUtils.rm_rf
|
8
|
+
FileUtils.rm_rf temp_dir_path
|
9
|
+
end
|
10
|
+
|
11
|
+
def temp_dir_path
|
12
|
+
"spec/temp"
|
13
|
+
end
|
14
|
+
|
15
|
+
def clone_and_modify_icons
|
16
|
+
icons_dir = vc[:configuration][:icon_dir]
|
17
|
+
FileUtils.mkdir_p temp_icon_dir_path
|
18
|
+
FileUtils.cp_r(Dir["#{icons_dir}/*.png"].reject { |f| f.include? "Decorated" }, temp_icon_dir_path)
|
19
|
+
end
|
20
|
+
|
21
|
+
def temp_icon_dir_path
|
22
|
+
"#{temp_dir_path}/icons/"
|
9
23
|
end
|
data/spec/xcode_build_spec.rb
CHANGED
@@ -5,54 +5,56 @@ describe "xcode_build task" do
|
|
5
5
|
describe "invalid config handling" do
|
6
6
|
|
7
7
|
context "missing configuration" do
|
8
|
-
|
9
8
|
context "app_name" do
|
10
|
-
|
9
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.remove_config! :app_name }
|
10
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
11
11
|
end
|
12
|
-
|
13
12
|
context "workspace" do
|
14
|
-
|
13
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.remove_config! :workspace }
|
14
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
15
15
|
end
|
16
|
-
|
17
16
|
context "build_configuration" do
|
18
|
-
|
17
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.remove_config! :build_configuration }
|
18
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
19
19
|
end
|
20
|
-
|
21
20
|
context "build_dir" do
|
22
|
-
|
21
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.remove_config! :build_dir }
|
22
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
23
23
|
end
|
24
|
-
|
25
24
|
context "scheme" do
|
26
|
-
|
25
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.remove_config! :scheme }
|
26
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
27
27
|
end
|
28
|
-
|
29
28
|
end
|
30
29
|
|
31
30
|
context "non-existent files" do
|
32
|
-
|
33
31
|
context "workspace" do
|
34
|
-
|
32
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.missing_file!(:workspace) }
|
33
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
35
34
|
end
|
36
|
-
|
37
35
|
context "build_dir" do
|
38
|
-
|
36
|
+
let(:runner) { mock_runner vc.enable_xcode_build!.invalid_location!(:build_dir) }
|
37
|
+
specify { expect { runner.run_tasks! }.to raise_error }
|
39
38
|
end
|
40
|
-
|
41
39
|
end
|
42
40
|
|
43
41
|
end
|
44
42
|
|
45
43
|
describe "successful build" do
|
46
|
-
|
44
|
+
let(:runner) { mock_runner(vc.enable_xcode_build!) }
|
45
|
+
before { runner.run_tasks! }
|
46
|
+
specify { runner.store[:xcode_build_succeeded].should be_true }
|
47
47
|
end
|
48
48
|
|
49
49
|
describe "failing build" do
|
50
|
-
pending "
|
50
|
+
pending "create a target that fails to build, spelling mistake or something"
|
51
51
|
end
|
52
52
|
|
53
53
|
describe "task completion" do
|
54
|
-
|
55
|
-
|
54
|
+
let(:runner) { mock_runner(vc.enable_xcode_build!) }
|
55
|
+
before { runner.run_tasks! }
|
56
|
+
specify { runner.tasks[:completed].include?(:xcode_build).should be_true }
|
57
|
+
specify { runner.outputs[:xcode_build].should_not be_nil }
|
56
58
|
end
|
57
59
|
|
58
60
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ios_build_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Waite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: commander
|
@@ -196,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
196
196
|
version: '0'
|
197
197
|
requirements: []
|
198
198
|
rubyforge_project:
|
199
|
-
rubygems_version: 2.
|
199
|
+
rubygems_version: 2.1.11
|
200
200
|
signing_key:
|
201
201
|
specification_version: 4
|
202
202
|
summary: iOS Build Kit
|
@@ -211,4 +211,3 @@ test_files:
|
|
211
211
|
- spec/support/config_mocker.rb
|
212
212
|
- spec/support/temp_dir.rb
|
213
213
|
- spec/xcode_build_spec.rb
|
214
|
-
has_rdoc:
|