xcodebuild-rb 0.1.0 → 0.2.0
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.
- data/CHANGES.md +11 -0
- data/README.md +4 -2
- data/bin/rbxcb +7 -1
- data/lib/xcode_build.rb +8 -5
- data/lib/xcode_build/build_action.rb +10 -2
- data/lib/xcode_build/build_step.rb +8 -0
- data/lib/xcode_build/formatters.rb +1 -1
- data/lib/xcode_build/formatters/progress_formatter.rb +14 -10
- data/lib/xcode_build/output_translator.rb +4 -3
- data/lib/xcode_build/reporter.rb +10 -2
- data/lib/xcode_build/reporting/build_reporting.rb +43 -14
- data/lib/xcode_build/reporting/clean_reporting.rb +5 -1
- data/lib/xcode_build/tasks.rb +6 -0
- data/lib/xcode_build/tasks/build_task.rb +66 -16
- data/lib/xcode_build/translations.rb +2 -2
- data/lib/xcode_build/translations/building.rb +30 -18
- data/lib/xcode_build/translations/cleaning.rb +11 -11
- data/lib/xcodebuild.rb +1 -1
- data/spec/build_task_spec.rb +147 -39
- data/spec/output_translator_spec.rb +1 -1
- data/spec/reporting/build_reporting_spec.rb +61 -8
- data/spec/translations/building_translations_spec.rb +48 -32
- data/spec/translations/cleaning_translations_spec.rb +18 -18
- metadata +22 -19
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe XcodeBuild::Translations::Building do
|
4
4
|
let(:delegate) { mock('delegate', :respond_to? => true) }
|
5
|
-
let(:translator) { XcodeBuild::OutputTranslator.new(delegate, ignore_global_translations
|
5
|
+
let(:translator) { XcodeBuild::OutputTranslator.new(delegate, :ignore_global_translations => true) }
|
6
6
|
let(:translation) { translator.translations[0] }
|
7
7
|
|
8
8
|
before do
|
@@ -22,10 +22,10 @@ describe XcodeBuild::Translations::Building do
|
|
22
22
|
it "notifies the delegate of the start of a build with the default configuration" do
|
23
23
|
delegate.stub(:beginning_translation_of_line)
|
24
24
|
delegate.should_receive(:build_started).with(
|
25
|
-
target
|
26
|
-
project
|
27
|
-
configuration
|
28
|
-
default
|
25
|
+
:target => "ExampleProject",
|
26
|
+
:project => "ExampleProject",
|
27
|
+
:configuration => "Release",
|
28
|
+
:default => true
|
29
29
|
)
|
30
30
|
translator << "=== BUILD NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE DEFAULT CONFIGURATION (Release) ==="
|
31
31
|
end
|
@@ -33,17 +33,17 @@ describe XcodeBuild::Translations::Building do
|
|
33
33
|
it "notifies the delegate of the start of a build with a non-default configuration" do
|
34
34
|
delegate.stub(:beginning_translation_of_line)
|
35
35
|
delegate.should_receive(:build_started).with(
|
36
|
-
target
|
37
|
-
project
|
38
|
-
configuration
|
39
|
-
default
|
36
|
+
:target => "ExampleProject",
|
37
|
+
:project => "ExampleProject",
|
38
|
+
:configuration => "Debug",
|
39
|
+
:default => false
|
40
40
|
)
|
41
41
|
translator << "=== BUILD NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE CONFIGURATION Debug ==="
|
42
42
|
end
|
43
43
|
|
44
44
|
it "treats :build_started as a required delegate message and raise if it doesn't respond" do
|
45
45
|
delegate_should_not_respond_to(:build_started)
|
46
|
-
|
46
|
+
lambda {
|
47
47
|
translator << "=== BUILD NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE CONFIGURATION Debug ==="
|
48
48
|
|
49
49
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
@@ -56,16 +56,15 @@ describe XcodeBuild::Translations::Building do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
it "notifies the delegate of a single build step" do
|
59
|
-
delegate.stub(:beginning_translation_of_line)
|
60
59
|
delegate.should_receive(:build_step).with(
|
61
|
-
type
|
62
|
-
arguments
|
60
|
+
:type => "CodeSign",
|
61
|
+
:arguments => ["build/Debug-iphoneos/ExampleProject.app"]
|
63
62
|
)
|
64
63
|
translator << "\n"
|
65
64
|
translator << "CodeSign build/Debug-iphoneos/ExampleProject.app"
|
66
65
|
end
|
67
66
|
|
68
|
-
it "treats :
|
67
|
+
it "treats :build_step as an optional delegate message" do
|
69
68
|
delegate_should_not_respond_to(:build_step)
|
70
69
|
delegate.should_not_receive(:build_step)
|
71
70
|
translator << "\n"
|
@@ -73,7 +72,6 @@ describe XcodeBuild::Translations::Building do
|
|
73
72
|
end
|
74
73
|
|
75
74
|
it "notifies the delegate when the build failed" do
|
76
|
-
delegate.stub(:beginning_translation_of_line)
|
77
75
|
delegate.should_receive(:build_failed)
|
78
76
|
translator << "\n\n\n"
|
79
77
|
translator << "** BUILD FAILED **"
|
@@ -81,14 +79,13 @@ describe XcodeBuild::Translations::Building do
|
|
81
79
|
|
82
80
|
it "treats :build_failed as a required delegate message and raise if it doesn't respond" do
|
83
81
|
delegate_should_not_respond_to(:build_failed)
|
84
|
-
|
82
|
+
lambda {
|
85
83
|
translator << "** BUILD FAILED **"
|
86
84
|
|
87
85
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
88
86
|
end
|
89
87
|
|
90
88
|
it "notifies the delegate when the build succeeded" do
|
91
|
-
delegate.stub(:beginning_translation_of_line)
|
92
89
|
delegate.should_receive(:build_succeeded)
|
93
90
|
translator << "\n\n\n"
|
94
91
|
translator << "** BUILD SUCCEEDED **"
|
@@ -96,7 +93,7 @@ describe XcodeBuild::Translations::Building do
|
|
96
93
|
|
97
94
|
it "treats :build_succeeded as a required delegate message and raise if it doesn't respond" do
|
98
95
|
delegate_should_not_respond_to(:build_succeeded)
|
99
|
-
|
96
|
+
lambda {
|
100
97
|
translator << "** BUILD SUCCEEDED **"
|
101
98
|
|
102
99
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
@@ -104,8 +101,8 @@ describe XcodeBuild::Translations::Building do
|
|
104
101
|
|
105
102
|
it "notifies the delegate of build step failures" do
|
106
103
|
delegate.should_receive(:build_step_failed).with(
|
107
|
-
type
|
108
|
-
arguments
|
104
|
+
:type => "CodeSign",
|
105
|
+
:arguments => ["build/Debug-iphoneos/ExampleProject.app"]
|
109
106
|
)
|
110
107
|
translator << "The following build commands failed:"
|
111
108
|
translator << "\tCodeSign build/Debug-iphoneos/ExampleProject.app"
|
@@ -121,20 +118,20 @@ describe XcodeBuild::Translations::Building do
|
|
121
118
|
|
122
119
|
it "notifies the delegate of errors that occur throughout the build" do
|
123
120
|
delegate.should_receive(:build_error_detected).with(
|
124
|
-
file
|
125
|
-
line
|
126
|
-
char
|
127
|
-
message
|
121
|
+
:file => "/ExampleProject/main.m",
|
122
|
+
:line => 16,
|
123
|
+
:char => 42,
|
124
|
+
:message => "expected ';' after expression [1]"
|
128
125
|
)
|
129
126
|
translator << "/ExampleProject/main.m:16:42: error: expected ';' after expression [1]"
|
130
127
|
end
|
131
128
|
|
132
129
|
it "notifies the delegate of errors for different build steps" do
|
133
130
|
delegate.should_receive(:build_error_detected).with(
|
134
|
-
file
|
135
|
-
line
|
136
|
-
char
|
137
|
-
message
|
131
|
+
:file => "/ExampleProject/main.m",
|
132
|
+
:line => 16,
|
133
|
+
:char => 42,
|
134
|
+
:message => "expected ';' after expression [1]"
|
138
135
|
)
|
139
136
|
|
140
137
|
translator << "CompileC ExampleProject/main.m normal"
|
@@ -144,10 +141,10 @@ describe XcodeBuild::Translations::Building do
|
|
144
141
|
|
145
142
|
it "notifies the delegate of multiple errors for the same build step" do
|
146
143
|
delegate.should_receive(:build_error_detected).with(
|
147
|
-
file
|
148
|
-
line
|
149
|
-
char
|
150
|
-
message
|
144
|
+
:file => "/ExampleProject/main.m",
|
145
|
+
:line => 16,
|
146
|
+
:char => 42,
|
147
|
+
:message => "expected ';' after expression [1]"
|
151
148
|
).twice
|
152
149
|
|
153
150
|
translator << "CompileC ExampleProject/main.m normal"
|
@@ -158,10 +155,29 @@ describe XcodeBuild::Translations::Building do
|
|
158
155
|
translator << "2 errors generated."
|
159
156
|
end
|
160
157
|
|
158
|
+
it "notifies the delegate of errors that occur when a command within a step fails" do
|
159
|
+
delegate.should_receive(:build_error_detected).with(
|
160
|
+
:command => "/bin/sh",
|
161
|
+
:exit_code => 1
|
162
|
+
)
|
163
|
+
translator << "Command /bin/sh failed with exit code 1"
|
164
|
+
end
|
165
|
+
|
161
166
|
it "treats :build_error_detected as an optional delegate message" do
|
162
167
|
delegate_should_not_respond_to(:build_error_detected)
|
163
168
|
delegate.should_not_receive(:build_error_detected)
|
164
169
|
translator << "/ExampleProject/main.m:16:42: error: expected ';' after expression [1]"
|
165
170
|
end
|
171
|
+
|
172
|
+
it "notifies the delegate of any environment variables that the build outputs" do
|
173
|
+
delegate.should_receive(:build_env_variable_detected).with("ARCHS", "armv7")
|
174
|
+
translator << " setenv ARCHS armv7"
|
175
|
+
end
|
176
|
+
|
177
|
+
it "treats :build_env_variable_detected as an optional delegate message" do
|
178
|
+
delegate_should_not_respond_to(:build_env_variable_detected)
|
179
|
+
delegate.should_not_receive(:build_env_variable_detected)
|
180
|
+
translator << " setenv ARCHS armv7"
|
181
|
+
end
|
166
182
|
end
|
167
183
|
end
|
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe XcodeBuild::OutputTranslator do
|
4
4
|
let(:delegate) { mock('delegate', :respond_to? => true) }
|
5
|
-
let(:translator) { XcodeBuild::OutputTranslator.new(delegate, ignore_global_translations
|
5
|
+
let(:translator) { XcodeBuild::OutputTranslator.new(delegate, :ignore_global_translations => true) }
|
6
6
|
let(:translation) { translator.translations[0] }
|
7
7
|
|
8
8
|
before do
|
@@ -21,27 +21,27 @@ describe XcodeBuild::OutputTranslator do
|
|
21
21
|
|
22
22
|
it "notifies the delegate of the start of a clean with the default configuration" do
|
23
23
|
delegate.should_receive(:clean_started).with(
|
24
|
-
target
|
25
|
-
project
|
26
|
-
configuration
|
27
|
-
default
|
24
|
+
:target => "ExampleProject",
|
25
|
+
:project => "ExampleProject",
|
26
|
+
:configuration => "Release",
|
27
|
+
:default => true
|
28
28
|
)
|
29
29
|
translator << "=== CLEAN NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE DEFAULT CONFIGURATION (Release) ==="
|
30
30
|
end
|
31
31
|
|
32
32
|
it "notifies the delegate of the start of a clean with a non-default configuration" do
|
33
33
|
delegate.should_receive(:clean_started).with(
|
34
|
-
target
|
35
|
-
project
|
36
|
-
configuration
|
37
|
-
default
|
34
|
+
:target => "ExampleProject",
|
35
|
+
:project => "ExampleProject",
|
36
|
+
:configuration => "Debug",
|
37
|
+
:default => false
|
38
38
|
)
|
39
39
|
translator << "=== CLEAN NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE CONFIGURATION Debug ==="
|
40
40
|
end
|
41
41
|
|
42
42
|
it "treats :clean_started as a required delegate message and raise if it doesn't respond" do
|
43
43
|
delegate_should_not_respond_to(:clean_started)
|
44
|
-
|
44
|
+
lambda {
|
45
45
|
translator << "=== CLEAN NATIVE TARGET ExampleProject OF PROJECT ExampleProject WITH THE CONFIGURATION Debug ==="
|
46
46
|
|
47
47
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
@@ -55,8 +55,8 @@ describe XcodeBuild::OutputTranslator do
|
|
55
55
|
|
56
56
|
it "notifies the delegate of a single clean step" do
|
57
57
|
delegate.should_receive(:clean_step).with(
|
58
|
-
type
|
59
|
-
arguments
|
58
|
+
:type => "Clean.Remove",
|
59
|
+
:arguments => ["clean", "build/Release-iphoneos/ExampleProject.app"]
|
60
60
|
)
|
61
61
|
translator << "\n"
|
62
62
|
translator << "Clean.Remove clean build/Release-iphoneos/ExampleProject.app"
|
@@ -70,7 +70,7 @@ describe XcodeBuild::OutputTranslator do
|
|
70
70
|
|
71
71
|
it "treats :clean_failed as a required delegate message and raise if it doesn't respond" do
|
72
72
|
delegate_should_not_respond_to(:clean_failed)
|
73
|
-
|
73
|
+
lambda {
|
74
74
|
translator << "** CLEAN FAILED **"
|
75
75
|
|
76
76
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
@@ -84,7 +84,7 @@ describe XcodeBuild::OutputTranslator do
|
|
84
84
|
|
85
85
|
it "treats :clean_succeeded as a required delegate message and raise if it doesn't respond" do
|
86
86
|
delegate_should_not_respond_to(:clean_succeeded)
|
87
|
-
|
87
|
+
lambda {
|
88
88
|
translator << "** CLEAN SUCCEEDED **"
|
89
89
|
|
90
90
|
}.should raise_error(XcodeBuild::OutputTranslator::MissingDelegateMethodError)
|
@@ -92,8 +92,8 @@ describe XcodeBuild::OutputTranslator do
|
|
92
92
|
|
93
93
|
it "notifies the delegate of clean step failures" do
|
94
94
|
delegate.should_receive(:clean_step_failed).with(
|
95
|
-
type
|
96
|
-
arguments
|
95
|
+
:type => "Clean.Remove",
|
96
|
+
:arguments => ["clean", "build/Release-iphoneos/ExampleProject.app"]
|
97
97
|
)
|
98
98
|
translator << "The following build commands failed:"
|
99
99
|
translator << "\tClean.Remove clean build/Release-iphoneos/ExampleProject.app"
|
@@ -110,7 +110,7 @@ describe XcodeBuild::OutputTranslator do
|
|
110
110
|
|
111
111
|
it "notifies the delegate of errors for different clean steps" do
|
112
112
|
delegate.should_receive(:clean_error_detected).with(
|
113
|
-
message
|
113
|
+
:message => "Error Domain=NSCocoaErrorDomain Code=513 ExampleProject couldn't be removed"
|
114
114
|
)
|
115
115
|
|
116
116
|
translator << "Clean.Remove clean build/Release-iphoneos/ExampleProject.app"
|
@@ -121,7 +121,7 @@ describe XcodeBuild::OutputTranslator do
|
|
121
121
|
|
122
122
|
it "notifies the delegate of multiple errors for the same clean step" do
|
123
123
|
delegate.should_receive(:clean_error_detected).with(
|
124
|
-
message
|
124
|
+
:message => "Error Domain=NSCocoaErrorDomain Code=513 ExampleProject couldn't be removed"
|
125
125
|
).twice
|
126
126
|
|
127
127
|
translator << "Clean.Remove clean build/Release-iphoneos/ExampleProject.app"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcodebuild-rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-02 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: state_machine
|
16
|
-
requirement: &
|
16
|
+
requirement: &2171080080 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.1.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2171080080
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &2171079680 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2171079680
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &2171079140 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2171079140
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdoc
|
49
|
-
requirement: &
|
49
|
+
requirement: &2171078640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '3.12'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2171078640
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: guard-rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &2171078260 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *2171078260
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: growl
|
71
|
-
requirement: &
|
71
|
+
requirement: &2171022220 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *2171022220
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: timecop
|
82
|
-
requirement: &
|
82
|
+
requirement: &2171021800 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *2171021800
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: chronic
|
93
|
-
requirement: &
|
93
|
+
requirement: &2171021380 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,7 +98,7 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *2171021380
|
102
102
|
description:
|
103
103
|
email: luke@lukeredpath.co.uk
|
104
104
|
executables:
|
@@ -106,6 +106,7 @@ executables:
|
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files:
|
108
108
|
- README.md
|
109
|
+
- CHANGES.md
|
109
110
|
files:
|
110
111
|
- LICENSE
|
111
112
|
- README.md
|
@@ -126,12 +127,14 @@ files:
|
|
126
127
|
- lib/xcode_build/reporting/build_reporting.rb
|
127
128
|
- lib/xcode_build/reporting/clean_reporting.rb
|
128
129
|
- lib/xcode_build/tasks/build_task.rb
|
130
|
+
- lib/xcode_build/tasks.rb
|
129
131
|
- lib/xcode_build/translations/building.rb
|
130
132
|
- lib/xcode_build/translations/cleaning.rb
|
131
133
|
- lib/xcode_build/translations.rb
|
132
134
|
- lib/xcode_build/utilities/colorize.rb
|
133
135
|
- lib/xcode_build.rb
|
134
136
|
- lib/xcodebuild.rb
|
137
|
+
- CHANGES.md
|
135
138
|
homepage: http://github.com/lukeredpath/xcodebuild-rb
|
136
139
|
licenses: []
|
137
140
|
post_install_message:
|
@@ -148,7 +151,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
148
151
|
version: '0'
|
149
152
|
segments:
|
150
153
|
- 0
|
151
|
-
hash:
|
154
|
+
hash: 2470516518150277683
|
152
155
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
153
156
|
none: false
|
154
157
|
requirements:
|