guard-xcode 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/guard-xcode.gemspec +1 -1
- data/lib/guard/xcode.rb +21 -11
- data/test/test_build_lines.rb +6 -0
- metadata +49 -34
data/guard-xcode.gemspec
CHANGED
data/lib/guard/xcode.rb
CHANGED
@@ -18,9 +18,11 @@ module Guard
|
|
18
18
|
@config = options[:configuration]
|
19
19
|
@scheme = options[:scheme]
|
20
20
|
@arch = options[:arch]
|
21
|
+
@sdk = options[:sdk]
|
21
22
|
@suppress_all_output = options[:suppress_all_output] or false
|
22
23
|
@all = options[:all] or false
|
23
24
|
@target = options[:target] unless @all
|
25
|
+
@workspace = options[:workspace] unless @all
|
24
26
|
@quiet = options[:quiet] or false
|
25
27
|
@clean = options[:clean] or false
|
26
28
|
|
@@ -39,6 +41,10 @@ module Guard
|
|
39
41
|
build_line += "-target #{@target} "
|
40
42
|
end
|
41
43
|
|
44
|
+
unless nil == @workspace
|
45
|
+
build_line += "-workspace #{@workspace} "
|
46
|
+
end
|
47
|
+
|
42
48
|
if @all
|
43
49
|
build_line += "-alltargets "
|
44
50
|
end
|
@@ -51,6 +57,10 @@ module Guard
|
|
51
57
|
build_line += "-arch #{@arch} "
|
52
58
|
end
|
53
59
|
|
60
|
+
unless nil == @sdk
|
61
|
+
build_line += "-sdk #{@sdk} "
|
62
|
+
end
|
63
|
+
|
54
64
|
if @clean
|
55
65
|
build_line += "clean "
|
56
66
|
end
|
@@ -70,15 +80,15 @@ module Guard
|
|
70
80
|
|
71
81
|
unless @quiet or @suppress_all_output
|
72
82
|
UI.info "guard-xcode: starting build"
|
73
|
-
Notifier.notify("kicking off build with:\n#{build_line}")
|
83
|
+
Notifier.notify("kicking off build with:\n#{build_line}", :image => :pending)
|
74
84
|
end
|
75
85
|
|
76
86
|
output = `#{build_line} 2>&1`
|
77
87
|
res = $?
|
78
88
|
|
79
|
-
|
80
|
-
UI.info "guard-xcode:
|
81
|
-
Notifier.notify("
|
89
|
+
if not ((not 0 == res or output =~ /errors? generated/) or (output =~ /warnings? generated/))
|
90
|
+
UI.info "guard-xcode: Build succeeded!" unless @quiet or @suppress_all_output
|
91
|
+
Notifier.notify("Build succeeded!") unless @quiet or @suppress_all_output
|
82
92
|
end
|
83
93
|
|
84
94
|
unless @quiet or @suppress_all_output
|
@@ -86,14 +96,14 @@ module Guard
|
|
86
96
|
end
|
87
97
|
|
88
98
|
if not 0 == res or output =~ /errors? generated/
|
89
|
-
UI.info "guard-xcode:
|
90
|
-
Notifier.notify("
|
99
|
+
UI.info "guard-xcode: Errors in build." unless @suppress_all_output
|
100
|
+
Notifier.notify("Errors in build.", :image => :failed) unless @suppress_all_output
|
91
101
|
alerts.push :errors
|
92
102
|
end
|
93
103
|
|
94
|
-
if output =~ /
|
95
|
-
UI.info "guard-xcode:
|
96
|
-
Notifier.notify("
|
104
|
+
if output =~ /warnings? generated/
|
105
|
+
UI.info "guard-xcode: Warnings in build." unless @suppress_all_output
|
106
|
+
Notifier.notify("Warnings in build.", :image => :failed) unless @suppress_all_output
|
97
107
|
alerts.push :warnings
|
98
108
|
end
|
99
109
|
|
@@ -127,14 +137,14 @@ module Guard
|
|
127
137
|
# Called on file(s) modifications that the Guard watches.
|
128
138
|
# @param [Array<String>] paths the changes files or paths
|
129
139
|
# @raise [:task_has_failed] when run_on_change has failed
|
130
|
-
def
|
140
|
+
def run_on_changes(paths)
|
131
141
|
run_build(get_build_line)
|
132
142
|
end
|
133
143
|
|
134
144
|
# Called on file(s) deletions that the Guard watches.
|
135
145
|
# @param [Array<String>] paths the deleted files or paths
|
136
146
|
# @raise [:task_has_failed] when run_on_change has failed
|
137
|
-
def
|
147
|
+
def run_on_removals(paths)
|
138
148
|
run_build(get_build_line)
|
139
149
|
end
|
140
150
|
|
data/test/test_build_lines.rb
CHANGED
@@ -8,6 +8,12 @@ class XcodeTestBuildLines < Test::Unit::TestCase
|
|
8
8
|
assert target == targetGuard.get_build_line
|
9
9
|
end
|
10
10
|
|
11
|
+
def test_workspace_build_line
|
12
|
+
workspace = 'xcodebuild -workspace MyApp build'
|
13
|
+
workspaceGuard = Guard::Xcode.new [], :workspace =>'MyApp'
|
14
|
+
assert workspace == workspaceGuard.get_build_line
|
15
|
+
end
|
16
|
+
|
11
17
|
def test_config_build_line
|
12
18
|
config = 'xcodebuild -configuration MyConfig build'
|
13
19
|
configGuard = Guard::Xcode.new [], :configuration => 'MyConfig'
|
metadata
CHANGED
@@ -1,37 +1,46 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-xcode
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 0
|
8
|
+
- 6
|
9
|
+
version: 1.0.6
|
6
10
|
platform: ruby
|
7
|
-
authors:
|
11
|
+
authors:
|
8
12
|
- Kyle Isom
|
9
13
|
autorequire:
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
16
|
+
|
17
|
+
date: 2013-02-04 00:00:00 -07:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: guard
|
16
|
-
requirement: &70200171504460 !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ! '>='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: '0'
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
25
32
|
description: Build an Xcode project when source files change.
|
26
|
-
email:
|
33
|
+
email:
|
27
34
|
- coder@kyleisom.net
|
28
35
|
executables: []
|
36
|
+
|
29
37
|
extensions: []
|
30
|
-
|
38
|
+
|
39
|
+
extra_rdoc_files:
|
31
40
|
- CHANGELOG.md
|
32
41
|
- LICENSE.md
|
33
42
|
- README.md
|
34
|
-
files:
|
43
|
+
files:
|
35
44
|
- .gitignore
|
36
45
|
- CHANGELOG.md
|
37
46
|
- Gemfile
|
@@ -59,30 +68,36 @@ files:
|
|
59
68
|
- test/data/main_warnings_error.m
|
60
69
|
- test/test_build.rb
|
61
70
|
- test/test_build_lines.rb
|
71
|
+
has_rdoc: true
|
62
72
|
homepage: https://github.com/kisom/guard-xcode
|
63
|
-
licenses:
|
73
|
+
licenses:
|
64
74
|
- ISC
|
65
75
|
- public domain
|
66
76
|
post_install_message:
|
67
77
|
rdoc_options: []
|
68
|
-
|
78
|
+
|
79
|
+
require_paths:
|
69
80
|
- lib
|
70
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
requirements:
|
79
|
-
- -
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
segments:
|
86
|
+
- 0
|
87
|
+
version: "0"
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">="
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
version: "0"
|
82
95
|
requirements: []
|
96
|
+
|
83
97
|
rubyforge_project:
|
84
|
-
rubygems_version: 1.
|
98
|
+
rubygems_version: 1.3.6
|
85
99
|
signing_key:
|
86
100
|
specification_version: 3
|
87
101
|
summary: Run Xcode builds when source files change.
|
88
102
|
test_files: []
|
103
|
+
|