shenzhen 0.2.1 → 0.2.2
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/Gemfile.lock +1 -1
- data/lib/shenzhen.rb +1 -1
- data/lib/shenzhen/commands/build.rb +19 -16
- data/lib/shenzhen/xcodebuild.rb +50 -16
- metadata +47 -19
- data/shenzhen-0.1.0.gem +0 -0
- data/shenzhen-0.2.0.gem +0 -0
data/Gemfile.lock
CHANGED
data/lib/shenzhen.rb
CHANGED
@@ -14,24 +14,18 @@ command :build do |c|
|
|
14
14
|
c.action do |args, options|
|
15
15
|
validate_xcode_version!
|
16
16
|
|
17
|
-
@xcodebuild_info = Shenzhen::XcodeBuild.info
|
18
|
-
|
19
17
|
@workspace = options.workspace
|
20
|
-
@project = options.project
|
18
|
+
@project = options.project unless @workspace
|
19
|
+
|
20
|
+
@xcodebuild_info = Shenzhen::XcodeBuild.info(:workspace => @workspace, :project => @project)
|
21
|
+
|
21
22
|
@scheme = options.scheme
|
22
23
|
@configuration = options.configuration
|
23
24
|
|
24
25
|
determine_workspace_or_project! unless @workspace || @project
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
say_warning "Configuration was not passed, defaulting to Debug" unless @configuration
|
29
|
-
@configuration = "Debug"
|
30
|
-
end
|
31
|
-
else
|
32
|
-
determine_configuration! unless @configuration
|
33
|
-
say_error "Configuration #{@configuration} not found" and abort unless @xcodebuild_info.build_configurations.include?(@configuration)
|
34
|
-
end
|
27
|
+
determine_configuration! unless @configuration
|
28
|
+
say_error "Configuration #{@configuration} not found" and abort unless @xcodebuild_info.build_configurations.include?(@configuration)
|
35
29
|
|
36
30
|
determine_scheme! unless @scheme
|
37
31
|
say_error "Scheme #{@scheme} not found" and abort unless @xcodebuild_info.schemes.include?(@scheme)
|
@@ -55,7 +49,9 @@ command :build do |c|
|
|
55
49
|
ENV['CC'] = nil # Fix for RVM
|
56
50
|
abort unless system %{xcodebuild #{flags.join(' ')} #{actions.join(' ')} 1> /dev/null}
|
57
51
|
|
58
|
-
@xcodebuild_settings = Shenzhen::XcodeBuild.settings(flags)
|
52
|
+
@target, @xcodebuild_settings = Shenzhen::XcodeBuild.settings(*flags).detect{|target, settings| settings['WRAPPER_EXTENSION'] == "app"}
|
53
|
+
say_error "App settings could not be found." and abort unless @xcodebuild_settings
|
54
|
+
|
59
55
|
@app_path = File.join(@xcodebuild_settings['BUILT_PRODUCTS_DIR'], @xcodebuild_settings['PRODUCT_NAME']) + ".app"
|
60
56
|
@dsym_path = @app_path + ".dSYM"
|
61
57
|
@dsym_filename = "#{@xcodebuild_settings['PRODUCT_NAME']}.app.dSYM"
|
@@ -108,10 +104,17 @@ command :build do |c|
|
|
108
104
|
end
|
109
105
|
|
110
106
|
def determine_configuration!
|
111
|
-
|
112
|
-
|
107
|
+
configurations = @xcodebuild_info.build_configurations
|
108
|
+
if configurations.include?("Debug")
|
109
|
+
@configuration = "Debug"
|
110
|
+
elsif configurations.length == 1
|
111
|
+
@configuration = configurations.first
|
112
|
+
end
|
113
|
+
|
114
|
+
if @configuration
|
115
|
+
say_warning "Configuration was not passed, defaulting to #{@configuration}"
|
113
116
|
else
|
114
|
-
@configuration = choose "Select a configuration:",
|
117
|
+
@configuration = choose "Select a configuration:", *configurations
|
115
118
|
end
|
116
119
|
end
|
117
120
|
end
|
data/lib/shenzhen/xcodebuild.rb
CHANGED
@@ -1,63 +1,97 @@
|
|
1
1
|
require 'ostruct'
|
2
|
+
require 'shellwords'
|
2
3
|
|
3
4
|
module Shenzhen::XcodeBuild
|
4
5
|
class Info < OpenStruct; end
|
6
|
+
class Settings < OpenStruct
|
7
|
+
include Enumerable
|
5
8
|
|
9
|
+
def initialize(hash = {})
|
10
|
+
super
|
11
|
+
self.targets = hash.keys
|
12
|
+
end
|
13
|
+
|
14
|
+
def members
|
15
|
+
self.targets
|
16
|
+
end
|
17
|
+
|
18
|
+
def each
|
19
|
+
members.each do |target|
|
20
|
+
yield target, send(target)
|
21
|
+
end
|
22
|
+
|
23
|
+
self
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
6
27
|
class Error < StandardError; end
|
7
28
|
class NilOutputError < Error; end
|
8
29
|
|
9
30
|
class << self
|
10
|
-
def info
|
11
|
-
|
31
|
+
def info(*args)
|
32
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
33
|
+
output = `xcodebuild -list #{Shellwords.join(args + args_from_options(options))} 2>&1`
|
12
34
|
raise Error.new $1 if /^xcodebuild\: error\: (.+)$/ === output
|
13
35
|
raise NilOutputError unless /\S/ === output
|
14
36
|
|
15
37
|
lines = output.split(/\n/)
|
16
|
-
|
17
|
-
group = nil
|
38
|
+
info, group = {}, nil
|
18
39
|
|
19
|
-
|
40
|
+
info[:project] = lines.shift.match(/\"(.+)\"\:/)[1]
|
20
41
|
|
21
42
|
lines.each do |line|
|
22
43
|
if /\:$/ === line
|
23
44
|
group = line.strip[0...-1].downcase.gsub(/\s+/, '_')
|
24
|
-
|
45
|
+
info[group] = []
|
25
46
|
next
|
26
47
|
end
|
27
48
|
|
28
49
|
unless group.nil? or /\.$/ === line
|
29
|
-
|
50
|
+
info[group] << line.strip
|
30
51
|
end
|
31
52
|
end
|
32
53
|
|
33
|
-
|
54
|
+
info.each do |group, values|
|
34
55
|
next unless Array === values
|
35
56
|
values.delete("") and values.uniq!
|
36
57
|
end
|
37
58
|
|
38
|
-
Info.new(
|
59
|
+
Info.new(info)
|
39
60
|
end
|
40
61
|
|
41
|
-
def settings(
|
42
|
-
|
62
|
+
def settings(*args)
|
63
|
+
options = args.last.is_a?(Hash) ? args.pop : {}
|
64
|
+
output = `xcodebuild #{(args + args_from_options(options)).join(" ")} -showBuildSettings 2> /dev/null`
|
43
65
|
raise Error.new $1 if /^xcodebuild\: error\: (.+)$/ === output
|
44
66
|
raise NilOutputError unless /\S/ === output
|
45
67
|
|
46
68
|
lines = output.split(/\n/)
|
47
69
|
lines.shift
|
48
70
|
|
49
|
-
|
71
|
+
settings, target = {}, nil
|
50
72
|
lines.each do |line|
|
51
|
-
|
52
|
-
|
73
|
+
case line
|
74
|
+
when /Build settings for action build and target (\w+)/
|
75
|
+
target = $1
|
76
|
+
settings[target] = {}
|
77
|
+
else
|
78
|
+
key, value = line.split(/\=/).collect(&:strip)
|
79
|
+
settings[target][key] = value if target
|
80
|
+
end
|
53
81
|
end
|
54
82
|
|
55
|
-
|
83
|
+
Settings.new(settings)
|
56
84
|
end
|
57
85
|
|
58
86
|
def version
|
59
87
|
output = `xcodebuild -version`
|
60
|
-
output.scan(/([\d
|
88
|
+
output.scan(/([\d+\.?]+)/).flatten.first rescue nil
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
def args_from_options(options = {})
|
94
|
+
options.reject{|key, value| value.nil?}.collect{|key, value| "-#{key} #{value}"}
|
61
95
|
end
|
62
96
|
end
|
63
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shenzhen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
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-10-
|
12
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: 0.6.1
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.6.1
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rake
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ~>
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: 0.9.2
|
33
38
|
type: :development
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.2
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: commander
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ~>
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: 4.1.2
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 4.1.2
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: json
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ~>
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: 1.7.3
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.7.3
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: faraday
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ~>
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: 0.8.0
|
66
86
|
type: :runtime
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.8.0
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: faraday_middleware
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ~>
|
@@ -76,7 +101,12 @@ dependencies:
|
|
76
101
|
version: 0.8.7
|
77
102
|
type: :runtime
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.8.7
|
80
110
|
description: CLI for Building & Distributing iOS Apps (.ipa Files)
|
81
111
|
email: m@mattt.me
|
82
112
|
executables:
|
@@ -97,8 +127,6 @@ files:
|
|
97
127
|
- ./LICENSE
|
98
128
|
- ./Rakefile
|
99
129
|
- ./README.md
|
100
|
-
- ./shenzhen-0.1.0.gem
|
101
|
-
- ./shenzhen-0.2.0.gem
|
102
130
|
- ./shenzhen.gemspec
|
103
131
|
- bin/ipa
|
104
132
|
homepage: http://github.com/mattt/shenzhen
|
@@ -115,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
115
143
|
version: '0'
|
116
144
|
segments:
|
117
145
|
- 0
|
118
|
-
hash:
|
146
|
+
hash: -365862781933133346
|
119
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
120
148
|
none: false
|
121
149
|
requirements:
|
@@ -124,10 +152,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
152
|
version: '0'
|
125
153
|
segments:
|
126
154
|
- 0
|
127
|
-
hash:
|
155
|
+
hash: -365862781933133346
|
128
156
|
requirements: []
|
129
157
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
158
|
+
rubygems_version: 1.8.24
|
131
159
|
signing_key:
|
132
160
|
specification_version: 3
|
133
161
|
summary: Shenzhen
|
data/shenzhen-0.1.0.gem
DELETED
Binary file
|
data/shenzhen-0.2.0.gem
DELETED
Binary file
|