gym 1.2.0 → 1.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.rb +1 -0
- data/lib/gym/commands_generator.rb +1 -1
- data/lib/gym/detect_values.rb +6 -3
- data/lib/gym/error_handler.rb +16 -3
- data/lib/gym/generators/build_command_generator.rb +1 -0
- data/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
- data/lib/gym/manager.rb +3 -7
- data/lib/gym/options.rb +1 -1
- data/lib/gym/runner.rb +15 -13
- data/lib/gym/version.rb +1 -1
- data/lib/gym/xcodebuild_fixes/package_application_fix.rb +1 -1
- data/lib/gym/xcodebuild_fixes/swift_fix.rb +2 -2
- data/lib/gym/xcodebuild_fixes/watchkit2_fix.rb +2 -2
- data/lib/gym/xcodebuild_fixes/watchkit_fix.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b10cc2e463895aae84301abdfff342aecdfd98ff
|
4
|
+
data.tar.gz: b7032609daac7cca71fb70ced86a7df2bb5fd555
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 013a309cb2f63cb0662c895afc71028e12f5e2f34fc4172f95823c49b746f29dc65378010f2fd8fccc0e882ddd6c7615b6f5bc37b4559558e3a7f0490463b60b
|
7
|
+
data.tar.gz: ff749e5ec91d619bfde150c445717f9a5319ec7c3e301a55b33be74dc230aa99bf4cb18b4dcf7987df05e8226defc3435dcbab2097f7d226abefabb304fc14b3
|
data/lib/gym.rb
CHANGED
@@ -51,7 +51,7 @@ module Gym
|
|
51
51
|
raise "Gymfile already exists".yellow if File.exist?(path)
|
52
52
|
template = File.read("#{Helper.gem_path('gym')}/lib/assets/GymfileTemplate")
|
53
53
|
File.write(path, template)
|
54
|
-
|
54
|
+
UI.success "Successfully created '#{path}'. Open the file using a code editor."
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
data/lib/gym/detect_values.rb
CHANGED
@@ -6,12 +6,15 @@ module Gym
|
|
6
6
|
def self.set_additional_default_values
|
7
7
|
config = Gym.config
|
8
8
|
|
9
|
-
|
9
|
+
# First, try loading the Gymfile from the current directory
|
10
|
+
config.load_configuration_file(Gym.gymfile_name)
|
10
11
|
|
12
|
+
# Detect the project
|
13
|
+
FastlaneCore::Project.detect_projects(config)
|
11
14
|
Gym.project = FastlaneCore::Project.new(config)
|
12
15
|
detect_provisioning_profile
|
13
16
|
|
14
|
-
# Go into the project's folder
|
17
|
+
# Go into the project's folder, as there might be a Gymfile there
|
15
18
|
Dir.chdir(File.expand_path("..", Gym.project.path)) do
|
16
19
|
config.load_configuration_file(Gym.gymfile_name)
|
17
20
|
end
|
@@ -73,7 +76,7 @@ module Gym
|
|
73
76
|
if config[:configuration]
|
74
77
|
# Verify the configuration is available
|
75
78
|
unless configurations.include?(config[:configuration])
|
76
|
-
|
79
|
+
UI.error "Couldn't find specified configuration '#{config[:configuration]}'."
|
77
80
|
config[:configuration] = nil
|
78
81
|
end
|
79
82
|
end
|
data/lib/gym/error_handler.rb
CHANGED
@@ -49,7 +49,7 @@ module Gym
|
|
49
49
|
print "For more information visit this stackoverflow answer:"
|
50
50
|
print "https://stackoverflow.com/a/17031697/445598"
|
51
51
|
end
|
52
|
-
|
52
|
+
UI.user_error!("Error building the application - see the log above")
|
53
53
|
end
|
54
54
|
|
55
55
|
# @param [Array] The output of the errored build (line by line)
|
@@ -83,11 +83,14 @@ module Gym
|
|
83
83
|
print "https://openradar.appspot.com/radar?id=4952000420642816"
|
84
84
|
print "You can temporary use the :use_legacy_build_api option to get the build to work again"
|
85
85
|
when /IDEDistributionErrorDomain error 1/
|
86
|
+
when /Error Domain=IDEDistributionErrorDomain Code=/
|
87
|
+
standard_output = read_standard_output output
|
88
|
+
print standard_output if standard_output
|
86
89
|
print "There was an error exporting your application"
|
87
90
|
print "Unfortunately the new Xcode export API is unstable and causes problems on some project"
|
88
91
|
print "You can temporary use the :use_legacy_build_api option to get the build to work again"
|
89
92
|
end
|
90
|
-
|
93
|
+
UI.user_error!("Error packaging up the application")
|
91
94
|
end
|
92
95
|
|
93
96
|
def handle_empty_archive
|
@@ -99,11 +102,21 @@ module Gym
|
|
99
102
|
raise "Archive invalid"
|
100
103
|
end
|
101
104
|
|
105
|
+
def find_standard_output_path(output)
|
106
|
+
m = /Created bundle at path '(.*)'/.match(output)
|
107
|
+
return File.join(m[1], 'IDEDistribution.standard.log') unless m.nil?
|
108
|
+
end
|
109
|
+
|
102
110
|
private
|
103
111
|
|
112
|
+
def read_standard_output(output)
|
113
|
+
path = find_standard_output_path output
|
114
|
+
return File.read(path) if File.exist?(path)
|
115
|
+
end
|
116
|
+
|
104
117
|
# Just to make things easier
|
105
118
|
def print(text)
|
106
|
-
|
119
|
+
UI.error text
|
107
120
|
end
|
108
121
|
end
|
109
122
|
end
|
@@ -78,8 +78,8 @@ module Gym
|
|
78
78
|
|
79
79
|
def print_legacy_information
|
80
80
|
if Gym.config[:provisioning_profile_path]
|
81
|
-
|
82
|
-
|
81
|
+
UI.important "You're using Xcode 7, the `provisioning_profile_path` value will be ignored"
|
82
|
+
UI.important "Please follow the Code Signing Guide: https://github.com/KrauseFx/fastlane/blob/master/docs/CodeSigning.md"
|
83
83
|
end
|
84
84
|
end
|
85
85
|
end
|
data/lib/gym/manager.rb
CHANGED
@@ -3,15 +3,11 @@ module Gym
|
|
3
3
|
def work(options)
|
4
4
|
Gym.config = options
|
5
5
|
|
6
|
-
|
6
|
+
FastlaneCore::PrintTable.print_values(config: Gym.config,
|
7
|
+
hide_keys: [],
|
8
|
+
title: "Summary for gym #{Gym::VERSION}")
|
7
9
|
|
8
10
|
return Runner.new.run
|
9
11
|
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def print_summary
|
14
|
-
FastlaneCore::PrintTable.print_values(config: Gym.config, hide_keys: [], title: "Summary for gym #{Gym::VERSION}")
|
15
|
-
end
|
16
12
|
end
|
17
13
|
end
|
data/lib/gym/options.rb
CHANGED
@@ -92,7 +92,7 @@ module Gym
|
|
92
92
|
is_string: false,
|
93
93
|
verify_block: proc do |value|
|
94
94
|
if value
|
95
|
-
|
95
|
+
UI.important "Using legacy build system - waiting for radar to be fixed: https://openradar.appspot.com/radar?id=4952000420642816"
|
96
96
|
end
|
97
97
|
end),
|
98
98
|
FastlaneCore::ConfigItem.new(key: :export_method,
|
data/lib/gym/runner.rb
CHANGED
@@ -7,6 +7,11 @@ module Gym
|
|
7
7
|
# @return (String) The path to the resulting ipa
|
8
8
|
def run
|
9
9
|
clear_old_files
|
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
|
+
|
10
15
|
build_app
|
11
16
|
verify_archive
|
12
17
|
|
@@ -81,8 +86,8 @@ module Gym
|
|
81
86
|
ErrorHandler.handle_build_error(output)
|
82
87
|
end)
|
83
88
|
|
84
|
-
|
85
|
-
|
89
|
+
UI.success "Successfully stored the archive. You can find it in the Xcode Organizer."
|
90
|
+
UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
|
86
91
|
end
|
87
92
|
|
88
93
|
# Makes sure the archive is there and valid
|
@@ -112,18 +117,15 @@ module Gym
|
|
112
117
|
containing_directory = File.expand_path("..", PackageCommandGenerator.dsym_path)
|
113
118
|
|
114
119
|
available_dsyms = Dir.glob("#{containing_directory}/*.dSYM")
|
115
|
-
|
116
|
-
Helper.log.info "Compressing #{available_dsyms.count} dSYM(s)"
|
120
|
+
UI.message "Compressing #{available_dsyms.count} dSYM(s)" unless Gym.config[:silent]
|
117
121
|
|
118
122
|
output_path = File.expand_path(File.join(Gym.config[:output_directory], Gym.config[:output_name] + ".app.dSYM.zip"))
|
119
123
|
command = "cd '#{containing_directory}' && zip -r '#{output_path}' *.dSYM"
|
120
|
-
Helper.
|
121
|
-
command_result = `#{command}`
|
122
|
-
Helper.log.info command_result if $verbose
|
124
|
+
Helper.backticks(command, print: !Gym.config[:silent])
|
123
125
|
|
124
126
|
puts "" # new line
|
125
127
|
|
126
|
-
|
128
|
+
UI.success "Successfully exported and compressed dSYM file"
|
127
129
|
end
|
128
130
|
|
129
131
|
# Moves over the binary and dsym file to the output directory
|
@@ -132,21 +134,21 @@ module Gym
|
|
132
134
|
FileUtils.mv(PackageCommandGenerator.ipa_path, File.expand_path(Gym.config[:output_directory]), force: true)
|
133
135
|
ipa_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.ipa_path)))
|
134
136
|
|
135
|
-
|
136
|
-
|
137
|
+
UI.success "Successfully exported and signed the ipa file:"
|
138
|
+
UI.message ipa_path
|
137
139
|
ipa_path
|
138
140
|
end
|
139
141
|
|
140
142
|
# Move the .app from the archive into the output directory
|
141
143
|
def move_mac_app
|
142
144
|
app_path = Dir[File.join(BuildCommandGenerator.archive_path, "Products/Applications/*.app")].last
|
143
|
-
|
145
|
+
UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless app_path
|
144
146
|
|
145
147
|
FileUtils.mv(app_path, File.expand_path(Gym.config[:output_directory]), force: true)
|
146
148
|
app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
|
147
149
|
|
148
|
-
|
149
|
-
|
150
|
+
UI.success "Successfully exported the .app file:"
|
151
|
+
UI.message app_path
|
150
152
|
app_path
|
151
153
|
end
|
152
154
|
|
data/lib/gym/version.rb
CHANGED
@@ -27,7 +27,7 @@ module Gym
|
|
27
27
|
|
28
28
|
# Apply patches to PackageApplication4Gym from patches folder
|
29
29
|
Dir[File.join(Helper.gem_path("gym"), "lib/assets/package_application_patches/*.diff")].each do |patch|
|
30
|
-
|
30
|
+
UI.verbose "Applying Package Application patch: #{File.basename(patch)}"
|
31
31
|
command = ["patch '#{@patched_package_application_path}' < '#{patch}'"]
|
32
32
|
Runner.new.print_command(command, "Applying Package Application patch: #{File.basename(patch)}") if $verbose
|
33
33
|
|
@@ -14,7 +14,7 @@ module Gym
|
|
14
14
|
|
15
15
|
return if check_for_swift PackageCommandGenerator
|
16
16
|
|
17
|
-
|
17
|
+
UI.verbose "Packaging up the Swift Framework as the current app is a Swift app"
|
18
18
|
ipa_swift_frameworks = Dir["#{PackageCommandGenerator.appfile_path}/Frameworks/libswift*"]
|
19
19
|
|
20
20
|
Dir.mktmpdir do |tmpdir|
|
@@ -49,7 +49,7 @@ module Gym
|
|
49
49
|
# @param the PackageCommandGenerator
|
50
50
|
# @return true if swift
|
51
51
|
def check_for_swift(pcg)
|
52
|
-
|
52
|
+
UI.verbose "Checking for Swift framework"
|
53
53
|
default_swift_libs = "#{pcg.appfile_path}/Frameworks/libswift.*" # note the extra ., this is a string representation of a regexp
|
54
54
|
zip_entries_matching(pcg.ipa_path, /#{default_swift_libs}/).count > 0
|
55
55
|
end
|
@@ -5,7 +5,7 @@ module Gym
|
|
5
5
|
def watchkit2_fix
|
6
6
|
return unless watchkit2?
|
7
7
|
|
8
|
-
|
8
|
+
UI.verbose "Adding WatchKit2 support"
|
9
9
|
|
10
10
|
Dir.mktmpdir do |tmpdir|
|
11
11
|
# Make watchkit support directory
|
@@ -20,7 +20,7 @@ module Gym
|
|
20
20
|
abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null)
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
UI.verbose "Successfully added WatchKit2 support"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -5,7 +5,7 @@ module Gym
|
|
5
5
|
def watchkit_fix
|
6
6
|
return unless should_apply_watchkit1_fix?
|
7
7
|
|
8
|
-
|
8
|
+
UI.verbose "Adding WatchKit support"
|
9
9
|
|
10
10
|
Dir.mktmpdir do |tmpdir|
|
11
11
|
# Make watchkit support directory
|
@@ -20,7 +20,7 @@ module Gym
|
|
20
20
|
abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport" > /dev/null)
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
UI.verbose "Successfully added WatchKit support"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
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.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:
|
11
|
+
date: 2016-01-09 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.32.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.32.1
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 1.0.0
|