gym 1.4.0 → 1.5.0
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 -0
- data/lib/gym/commands_generator.rb +2 -1
- data/lib/gym/detect_values.rb +8 -2
- data/lib/gym/error_handler.rb +1 -1
- data/lib/gym/generators/build_command_generator.rb +13 -2
- data/lib/gym/options.rb +20 -9
- data/lib/gym/runner.rb +4 -8
- data/lib/gym/version.rb +1 -1
- data/lib/gym/xcodebuild_fixes/package_application_fix.rb +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe3879a8123332988ecd29815ef12bbedb1d59a
|
4
|
+
data.tar.gz: bdf77254d90621d1fe30917b8d9d90a5cdbfbc9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb81ff95220d37fd96a521822a0b93cd3f33bcb708f44bd74e942daaf659e5bac5abf816b6af5cade11160c354a9fe8af7726b9e30261effe051ab3ca0ea64e6
|
7
|
+
data.tar.gz: d6dc93ddea1e7d0b9a203c93b8c10cd5578347fc8b0a6b73c452142071bf92dfeac2e51f5df423d2f67808e4b3143c900715d2540ff892d521fda93657655667
|
data/README.md
CHANGED
@@ -253,6 +253,9 @@ Download and install the [Provisioning Plugin](https://github.com/chockenberry/P
|
|
253
253
|
# Need help?
|
254
254
|
Please submit an issue on GitHub and provide information about your setup
|
255
255
|
|
256
|
+
# Code of Conduct
|
257
|
+
Help us keep `gym` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
|
258
|
+
|
256
259
|
# License
|
257
260
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
258
261
|
|
@@ -6,6 +6,7 @@ HighLine.track_eof = false
|
|
6
6
|
module Gym
|
7
7
|
class CommandsGenerator
|
8
8
|
include Commander::Methods
|
9
|
+
UI = FastlaneCore::UI
|
9
10
|
|
10
11
|
FastlaneCore::CommanderGenerator.new.generate(Gym::Options.available_options)
|
11
12
|
|
@@ -48,7 +49,7 @@ module Gym
|
|
48
49
|
c.action do |_args, options|
|
49
50
|
containing = (File.directory?("fastlane") ? 'fastlane' : '.')
|
50
51
|
path = File.join(containing, Gym.gymfile_name)
|
51
|
-
|
52
|
+
UI.user_error! "Gymfile already exists" if File.exist?(path)
|
52
53
|
template = File.read("#{Helper.gem_path('gym')}/lib/assets/GymfileTemplate")
|
53
54
|
File.write(path, template)
|
54
55
|
UI.success "Successfully created '#{path}'. Open the file using a code editor."
|
data/lib/gym/detect_values.rb
CHANGED
@@ -42,7 +42,7 @@ module Gym
|
|
42
42
|
if profiles.count == 1
|
43
43
|
profile = File.expand_path(profiles.last)
|
44
44
|
elsif profiles.count > 1
|
45
|
-
|
45
|
+
UI.message "Found more than one provisioning profile in the project directory:"
|
46
46
|
profile = choose(*(profiles))
|
47
47
|
end
|
48
48
|
|
@@ -62,7 +62,13 @@ module Gym
|
|
62
62
|
# Is it an iOS device or a Mac?
|
63
63
|
def self.detect_platform
|
64
64
|
return if Gym.config[:destination]
|
65
|
-
platform = Gym.project.mac?
|
65
|
+
platform = if Gym.project.mac?
|
66
|
+
"OS X"
|
67
|
+
elsif Gym.project.tvos?
|
68
|
+
"tvOS"
|
69
|
+
else
|
70
|
+
"iOS"
|
71
|
+
end
|
66
72
|
|
67
73
|
Gym.config[:destination] = "generic/platform=#{platform}"
|
68
74
|
end
|
data/lib/gym/error_handler.rb
CHANGED
@@ -99,7 +99,7 @@ module Gym
|
|
99
99
|
print "For more information visit https://developer.apple.com/library/ios/technotes/tn2215/_index.html"
|
100
100
|
print "Also, make sure to have a valid code signing identity and provisioning profile installed"
|
101
101
|
print "Follow this guide to setup code signing https://github.com/fastlane/fastlane/blob/master/docs/CodeSigning.md"
|
102
|
-
|
102
|
+
UI.user_error!("Archive invalid")
|
103
103
|
end
|
104
104
|
|
105
105
|
def find_standard_output_path(output)
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'shellwords'
|
2
|
+
|
1
3
|
module Gym
|
2
4
|
# Responsible for building the fully working xcodebuild command
|
3
5
|
class BuildCommandGenerator
|
@@ -23,7 +25,7 @@ module Gym
|
|
23
25
|
def project_path_array
|
24
26
|
proj = Gym.project.xcodebuild_parameters
|
25
27
|
return proj if proj.count > 0
|
26
|
-
|
28
|
+
UI.user_error!("No project/workspace found")
|
27
29
|
end
|
28
30
|
|
29
31
|
def options
|
@@ -36,6 +38,8 @@ module Gym
|
|
36
38
|
options << "-destination '#{config[:destination]}'" if config[:destination]
|
37
39
|
options << "-xcconfig '#{config[:xcconfig]}'" if config[:xcconfig]
|
38
40
|
options << "-archivePath '#{archive_path}'"
|
41
|
+
options << "-derivedDataPath '#{config[:derived_data_path]}'" if config[:derived_data_path]
|
42
|
+
options << "-resultBundlePath '#{result_bundle_path}'" if config[:result_bundle]
|
39
43
|
options << config[:xcargs] if config[:xcargs]
|
40
44
|
|
41
45
|
options
|
@@ -59,7 +63,7 @@ module Gym
|
|
59
63
|
|
60
64
|
def pipe
|
61
65
|
pipe = []
|
62
|
-
pipe << "| tee
|
66
|
+
pipe << "| tee #{xcodebuild_log_path.shellescape} | xcpretty"
|
63
67
|
pipe << "--no-color" if Helper.colors_disabled?
|
64
68
|
pipe << "> /dev/null" if Gym.config[:suppress_xcode_output]
|
65
69
|
|
@@ -97,6 +101,13 @@ module Gym
|
|
97
101
|
end
|
98
102
|
return Gym.cache[:archive_path]
|
99
103
|
end
|
104
|
+
|
105
|
+
def result_bundle_path
|
106
|
+
unless Gym.cache[:result_bundle_path]
|
107
|
+
Gym.cache[:result_bundle_path] = File.join(Gym.config[:output_directory], Gym.config[:output_name]) + ".result"
|
108
|
+
end
|
109
|
+
return Gym.cache[:result_bundle_path]
|
110
|
+
end
|
100
111
|
end
|
101
112
|
end
|
102
113
|
end
|
data/lib/gym/options.rb
CHANGED
@@ -18,9 +18,9 @@ module Gym
|
|
18
18
|
description: "Path the workspace file",
|
19
19
|
verify_block: proc do |value|
|
20
20
|
v = File.expand_path(value.to_s)
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
UI.user_error!("Workspace file not found at path '#{v}'") unless File.exist?(v)
|
22
|
+
UI.user_error!("Workspace file invalid") unless File.directory?(v)
|
23
|
+
UI.user_error!("Workspace file is not a workspace, must end with .xcworkspace") unless v.include?(".xcworkspace")
|
24
24
|
end),
|
25
25
|
FastlaneCore::ConfigItem.new(key: :project,
|
26
26
|
short_option: "-p",
|
@@ -29,9 +29,9 @@ module Gym
|
|
29
29
|
description: "Path the project file",
|
30
30
|
verify_block: proc do |value|
|
31
31
|
v = File.expand_path(value.to_s)
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
UI.user_error!("Project file not found at path '#{v}'") unless File.exist?(v)
|
33
|
+
UI.user_error!("Project file invalid") unless File.directory?(v)
|
34
|
+
UI.user_error!("Project file is not a project file, must end with .xcodeproj") unless v.include?(".xcodeproj")
|
35
35
|
end),
|
36
36
|
FastlaneCore::ConfigItem.new(key: :scheme,
|
37
37
|
short_option: "-s",
|
@@ -103,7 +103,7 @@ module Gym
|
|
103
103
|
optional: true,
|
104
104
|
verify_block: proc do |value|
|
105
105
|
av = %w(app-store ad-hoc package enterprise development developer-id)
|
106
|
-
|
106
|
+
UI.user_error!("Unsupported export_method, must be: #{av}") unless av.include?(value)
|
107
107
|
end),
|
108
108
|
|
109
109
|
# Very optional
|
@@ -112,6 +112,17 @@ module Gym
|
|
112
112
|
env_name: "GYM_ARCHIVE_PATH",
|
113
113
|
description: "The directory in which the archive file should be stored in",
|
114
114
|
optional: true),
|
115
|
+
FastlaneCore::ConfigItem.new(key: :derived_data_path,
|
116
|
+
short_option: "-f",
|
117
|
+
env_name: "GYM_DERIVED_DATA_PATH",
|
118
|
+
description: "The directory where build products and other derived data will go",
|
119
|
+
optional: true),
|
120
|
+
FastlaneCore::ConfigItem.new(key: :result_bundle,
|
121
|
+
short_option: "-u",
|
122
|
+
env_name: "GYM_RESULT_BUNDLE",
|
123
|
+
is_string: false,
|
124
|
+
description: "Produce the result bundle describing what occurred will be placed",
|
125
|
+
optional: true),
|
115
126
|
FastlaneCore::ConfigItem.new(key: :buildlog_path,
|
116
127
|
short_option: "-l",
|
117
128
|
env_name: "GYM_BUILDLOG_PATH",
|
@@ -128,7 +139,7 @@ module Gym
|
|
128
139
|
description: "The path to the provisioning profile (optional)",
|
129
140
|
optional: true,
|
130
141
|
verify_block: proc do |value|
|
131
|
-
|
142
|
+
UI.user_error!("Provisioning profile not found at path '#{File.expand_path(value)}'") unless File.exist?(value)
|
132
143
|
end),
|
133
144
|
FastlaneCore::ConfigItem.new(key: :destination,
|
134
145
|
short_option: "-d",
|
@@ -151,7 +162,7 @@ module Gym
|
|
151
162
|
description: "Use an extra XCCONFIG file to build your app",
|
152
163
|
optional: true,
|
153
164
|
verify_block: proc do |value|
|
154
|
-
|
165
|
+
UI.user_error!("File not found at path '#{File.expand_path(value)}'") unless File.exist?(value)
|
155
166
|
end),
|
156
167
|
FastlaneCore::ConfigItem.new(key: :suppress_xcode_output,
|
157
168
|
short_option: "-r",
|
data/lib/gym/runner.rb
CHANGED
@@ -8,10 +8,6 @@ module Gym
|
|
8
8
|
def run
|
9
9
|
clear_old_files
|
10
10
|
|
11
|
-
if Gym.project.tvos?
|
12
|
-
UI.user_error!("gym doesn't suppoort tvOS projects yet, we're working on adding this feature!")
|
13
|
-
end
|
14
|
-
|
15
11
|
build_app
|
16
12
|
verify_archive
|
17
13
|
|
@@ -24,7 +20,7 @@ module Gym
|
|
24
20
|
move_ipa
|
25
21
|
elsif Gym.project.mac?
|
26
22
|
compress_and_move_dsym
|
27
|
-
|
23
|
+
copy_mac_app
|
28
24
|
end
|
29
25
|
end
|
30
26
|
|
@@ -139,12 +135,12 @@ module Gym
|
|
139
135
|
ipa_path
|
140
136
|
end
|
141
137
|
|
142
|
-
#
|
143
|
-
def
|
138
|
+
# Copies the .app from the archive into the output directory
|
139
|
+
def copy_mac_app
|
144
140
|
app_path = Dir[File.join(BuildCommandGenerator.archive_path, "Products/Applications/*.app")].last
|
145
141
|
UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless app_path
|
146
142
|
|
147
|
-
FileUtils.
|
143
|
+
FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
|
148
144
|
app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
|
149
145
|
|
150
146
|
UI.success "Successfully exported the .app file:"
|
data/lib/gym/version.rb
CHANGED
@@ -20,7 +20,7 @@ module Gym
|
|
20
20
|
# If that location changes, search it using xcrun --sdk iphoneos -f PackageApplication
|
21
21
|
package_application_path = "#{Xcode.xcode_path}/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication"
|
22
22
|
|
23
|
-
|
23
|
+
UI.crash!("Unable to patch the `PackageApplication` script bundled in Xcode. This is not supported.") unless expected_md5 == Digest::MD5.file(package_application_path).hexdigest
|
24
24
|
|
25
25
|
# Duplicate PackageApplication script to PackageApplication4Gym
|
26
26
|
FileUtils.copy_file(package_application_path, @patched_package_application_path)
|
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: 1.
|
4
|
+
version: 1.5.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: 2016-
|
11
|
+
date: 2016-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.36.1
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 1.0.0
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 0.
|
29
|
+
version: 0.36.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|
@@ -132,16 +132,16 @@ dependencies:
|
|
132
132
|
name: rubocop
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
134
134
|
requirements:
|
135
|
-
- - "
|
135
|
+
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version:
|
137
|
+
version: 0.35.1
|
138
138
|
type: :development
|
139
139
|
prerelease: false
|
140
140
|
version_requirements: !ruby/object:Gem::Requirement
|
141
141
|
requirements:
|
142
|
-
- - "
|
142
|
+
- - "~>"
|
143
143
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
144
|
+
version: 0.35.1
|
145
145
|
- !ruby/object:Gem::Dependency
|
146
146
|
name: rspec
|
147
147
|
requirement: !ruby/object:Gem::Requirement
|