gym 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gym/build_command_generator.rb +2 -1
- data/lib/gym/detect_values.rb +51 -15
- data/lib/gym/options.rb +18 -10
- data/lib/gym/project.rb +34 -1
- data/lib/gym/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf26634ab793249948b9e36f367550963d0b07c9
|
4
|
+
data.tar.gz: 40851f4916c70e076a92bbc1fa50381f50319a90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e91d31c0692ca53442ecf995b0c2c98628fdf2c108752d83a82013c084effc38792866c3cd6efba15aafc86406c4b11237dc344bec74f62957a098b86adbb782
|
7
|
+
data.tar.gz: 3a0bececf832ad42db19978cfa2b78d29393ee89dd823677056bc58435523664dfd9dbd82c1fe82ea938119ad628a82a45cf4d730f6c0c6af4676251aff51bf6
|
@@ -36,9 +36,10 @@ module Gym
|
|
36
36
|
|
37
37
|
options = []
|
38
38
|
options += project_path_array
|
39
|
-
options << "-configuration '#{config[:configuration]}'"
|
39
|
+
options << "-configuration '#{config[:configuration]}'" if config[:configuration]
|
40
40
|
options << "-sdk '#{config[:sdk]}'" if config[:sdk]
|
41
41
|
options << "-destination '#{config[:destination]}'" if config[:destination]
|
42
|
+
options << "-xcconfig '#{config[:xcconfig]}'" if config[:xcconfig]
|
42
43
|
options << "-archivePath '#{archive_path}'"
|
43
44
|
options << config[:xcargs] if config[:xcargs]
|
44
45
|
|
data/lib/gym/detect_values.rb
CHANGED
@@ -25,6 +25,7 @@ module Gym
|
|
25
25
|
end
|
26
26
|
|
27
27
|
detect_scheme
|
28
|
+
detect_configuration
|
28
29
|
|
29
30
|
config[:output_name] ||= Gym.project.app_name
|
30
31
|
|
@@ -96,31 +97,66 @@ module Gym
|
|
96
97
|
|
97
98
|
def self.detect_scheme
|
98
99
|
config = Gym.config
|
100
|
+
proj_schemes = Gym.project.schemes
|
101
|
+
|
99
102
|
if config[:scheme].to_s.length > 0
|
100
103
|
# Verify the scheme is available
|
101
|
-
unless
|
104
|
+
unless proj_schemes.include?(config[:scheme].to_s)
|
102
105
|
Helper.log.error "Couldn't find specified scheme '#{config[:scheme]}'.".red
|
103
106
|
config[:scheme] = nil
|
104
107
|
end
|
105
108
|
end
|
106
109
|
|
107
|
-
if config[:scheme].to_s.length
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
110
|
+
return if config[:scheme].to_s.length > 0
|
111
|
+
|
112
|
+
if proj_schemes.count == 1
|
113
|
+
config[:scheme] = proj_schemes.last
|
114
|
+
elsif proj_schemes.count > 1
|
115
|
+
if Helper.is_ci?
|
116
|
+
Helper.log.error "Multiple schemes found but you haven't specified one.".red
|
117
|
+
Helper.log.error "Since this is a CI, please pass one using the `scheme` option".red
|
118
|
+
raise "Multiple schemes found".red
|
119
|
+
else
|
120
|
+
puts "Select Scheme: "
|
121
|
+
config[:scheme] = choose(*(proj_schemes))
|
122
|
+
end
|
123
|
+
else
|
124
|
+
raise "Couldn't find any schemes in this project".red
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# Detects the available configurations (e.g. Debug, Release)
|
129
|
+
def self.detect_configuration
|
130
|
+
config = Gym.config
|
131
|
+
configurations = Gym.project.configurations
|
132
|
+
if config[:configuration]
|
133
|
+
# Verify the configuration is available
|
134
|
+
unless configurations.include?(config[:configuration])
|
135
|
+
Helper.log.error "Couldn't find specified configuration '#{config[:configuration]}'.".red
|
136
|
+
config[:configuration] = nil
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Usually we want `Release`
|
141
|
+
# We prefer `Release` to export the DSYM file as well
|
142
|
+
config[:configuration] ||= "Release" if configurations.include?("Release")
|
143
|
+
|
144
|
+
return if config[:configuration].to_s.length > 0
|
145
|
+
return if configurations.count == 0 # this is an optional value anyway
|
146
|
+
|
147
|
+
if configurations.count == 1
|
148
|
+
config[:configuration] = configurations.last
|
149
|
+
else
|
150
|
+
if Helper.is_ci?
|
151
|
+
Helper.log.error "Multiple configurations found but you haven't specified one.".red
|
152
|
+
Helper.log.error "Since this is a CI, please pass one using the `configuration` option".red
|
153
|
+
raise "Multiple configurations found".red
|
120
154
|
else
|
121
|
-
|
155
|
+
puts "Select Configuration: "
|
156
|
+
config[:configuration] = choose(*(configurations))
|
122
157
|
end
|
123
158
|
end
|
124
159
|
end
|
160
|
+
|
125
161
|
end
|
126
162
|
end
|
data/lib/gym/options.rb
CHANGED
@@ -34,14 +34,6 @@ module Gym
|
|
34
34
|
raise "Project file invalid".red unless File.directory?(v)
|
35
35
|
raise "Project file is not a project file, must end with .xcodeproj".red unless v.include?(".xcodeproj")
|
36
36
|
end),
|
37
|
-
FastlaneCore::ConfigItem.new(key: :provisioning_profile_path,
|
38
|
-
short_option: "-e",
|
39
|
-
env_name: "GYM_PROVISIONING_PROFILE_PATH",
|
40
|
-
description: "The path to the provisioning profile (found automatically when located in current folder)",
|
41
|
-
optional: true,
|
42
|
-
verify_block: proc do |value|
|
43
|
-
raise "Provisioning profile not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
|
44
|
-
end),
|
45
37
|
FastlaneCore::ConfigItem.new(key: :scheme,
|
46
38
|
short_option: "-s",
|
47
39
|
optional: true,
|
@@ -78,7 +70,7 @@ module Gym
|
|
78
70
|
short_option: "-q",
|
79
71
|
env_name: "GYM_CONFIGURATION",
|
80
72
|
description: "The configuration to use when building the app. Defaults to 'Release'",
|
81
|
-
|
73
|
+
optional: true),
|
82
74
|
FastlaneCore::ConfigItem.new(key: :silent,
|
83
75
|
short_option: "-t",
|
84
76
|
env_name: "GYM_SILENT",
|
@@ -99,7 +91,23 @@ module Gym
|
|
99
91
|
short_option: "-x",
|
100
92
|
env_name: "GYM_XCARGS",
|
101
93
|
description: "Pass additional arguments to xcodebuild when building the app. Be sure to quote the setting names and values e.g. OTHER_LDFLAGS=\"-ObjC -lstdc++\"",
|
102
|
-
optional: true)
|
94
|
+
optional: true),
|
95
|
+
FastlaneCore::ConfigItem.new(key: :xcconfig,
|
96
|
+
short_option: "-y",
|
97
|
+
env_name: "GYM_XCCONFIG",
|
98
|
+
description: "Use an extra XCCONFIG file to build your app",
|
99
|
+
optional: true,
|
100
|
+
verify_block: proc do |value|
|
101
|
+
raise "File not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
|
102
|
+
end),
|
103
|
+
FastlaneCore::ConfigItem.new(key: :provisioning_profile_path,
|
104
|
+
short_option: "-e",
|
105
|
+
env_name: "GYM_PROVISIONING_PROFILE_PATH",
|
106
|
+
description: "The path to the provisioning profile (optional)",
|
107
|
+
optional: true,
|
108
|
+
verify_block: proc do |value|
|
109
|
+
raise "Provisioning profile not found at path '#{File.expand_path(value)}'".red unless File.exist?(value)
|
110
|
+
end)
|
103
111
|
|
104
112
|
]
|
105
113
|
end
|
data/lib/gym/project.rb
CHANGED
@@ -29,6 +29,27 @@ module Gym
|
|
29
29
|
results
|
30
30
|
end
|
31
31
|
|
32
|
+
# Get all available configurations in an array
|
33
|
+
def configurations
|
34
|
+
results = []
|
35
|
+
splitted = raw_info.split("Configurations:")
|
36
|
+
return [] if splitted.count != 2 # probably a CocoaPods project
|
37
|
+
|
38
|
+
output = splitted.last.split(":").first
|
39
|
+
output.split("\n").each_with_index do |current, index|
|
40
|
+
current = current.strip
|
41
|
+
|
42
|
+
if current.length == 0
|
43
|
+
next if index == 0
|
44
|
+
break # as we want to break on the empty line
|
45
|
+
end
|
46
|
+
|
47
|
+
results << current
|
48
|
+
end
|
49
|
+
|
50
|
+
results
|
51
|
+
end
|
52
|
+
|
32
53
|
def app_name
|
33
54
|
# WRAPPER_NAME: Example.app
|
34
55
|
# WRAPPER_SUFFIX: .app
|
@@ -60,7 +81,10 @@ module Gym
|
|
60
81
|
end
|
61
82
|
|
62
83
|
def raw_info
|
63
|
-
#
|
84
|
+
# Examples:
|
85
|
+
|
86
|
+
# Standard:
|
87
|
+
#
|
64
88
|
# Information about project "Example":
|
65
89
|
# Targets:
|
66
90
|
# Example
|
@@ -76,6 +100,15 @@ module Gym
|
|
76
100
|
# Example
|
77
101
|
# ExampleUITests
|
78
102
|
|
103
|
+
# CococaPods
|
104
|
+
#
|
105
|
+
# Example.xcworkspace
|
106
|
+
# Information about workspace "Example":
|
107
|
+
# Schemes:
|
108
|
+
# Example
|
109
|
+
# HexColors
|
110
|
+
# Pods-Example
|
111
|
+
|
79
112
|
return @raw if @raw
|
80
113
|
|
81
114
|
# Unfortunately since we pass the workspace we also get all the
|
data/lib/gym/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gym
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|