fastlane 2.136.0 → 2.141.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 +85 -72
- data/cert/lib/cert/options.rb +12 -5
- data/cert/lib/cert/runner.rb +13 -0
- data/deliver/lib/deliver/options.rb +2 -2
- data/deliver/lib/deliver/runner.rb +13 -2
- data/deliver/lib/deliver/submit_for_review.rb +7 -1
- data/fastlane/lib/fastlane/action.rb +2 -2
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +1 -1
- data/fastlane/lib/fastlane/actions/build_app.rb +157 -6
- data/fastlane/lib/fastlane/actions/build_ios_app.rb +28 -132
- data/fastlane/lib/fastlane/actions/build_mac_app.rb +46 -0
- data/fastlane/lib/fastlane/actions/create_pull_request.rb +71 -2
- data/fastlane/lib/fastlane/actions/docs/{build_ios_app.md → build_app.md} +1 -1
- data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +19 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +10 -0
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +4 -2
- data/fastlane/lib/fastlane/actions/ensure_bundle_exec.rb +3 -3
- data/fastlane/lib/fastlane/actions/get_version_number.rb +7 -2
- data/fastlane/lib/fastlane/actions/gradle.rb +54 -3
- data/fastlane/lib/fastlane/actions/gym.rb +3 -7
- data/fastlane/lib/fastlane/actions/import_from_git.rb +4 -0
- data/fastlane/lib/fastlane/actions/increment_version_number.rb +6 -3
- data/fastlane/lib/fastlane/actions/last_git_tag.rb +14 -5
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -2
- data/fastlane/lib/fastlane/actions/register_devices.rb +5 -1
- data/fastlane/lib/fastlane/actions/ruby_version.rb +1 -1
- data/fastlane/lib/fastlane/actions/run_tests.rb +5 -22
- data/fastlane/lib/fastlane/actions/set_github_release.rb +1 -1
- data/fastlane/lib/fastlane/actions/setup_ci.rb +14 -8
- data/fastlane/lib/fastlane/actions/testfairy.rb +8 -1
- data/fastlane/lib/fastlane/actions/update_plist.rb +37 -2
- data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +1 -0
- data/fastlane/lib/fastlane/actions/upload_to_play_store_internal_app_sharing.rb +78 -0
- data/fastlane/lib/fastlane/actions/verify_build.rb +1 -1
- data/fastlane/lib/fastlane/actions/xcode_select.rb +6 -1
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +2 -2
- data/fastlane/lib/fastlane/commands_generator.rb +1 -1
- data/fastlane/lib/fastlane/fast_file.rb +13 -3
- data/fastlane/lib/fastlane/helper/adb_helper.rb +13 -4
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +2 -0
- data/fastlane/lib/fastlane/runner.rb +23 -18
- data/fastlane/lib/fastlane/version.rb +1 -1
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +3 -3
- data/fastlane/swift/Fastlane.swift +342 -66
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +17 -1
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +12 -4
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +17 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -9
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +6 -2
- data/fastlane_core/lib/fastlane_core/cert_checker.rb +28 -0
- data/fastlane_core/lib/fastlane_core/device_manager.rb +20 -0
- data/fastlane_core/lib/fastlane_core/helper.rb +7 -1
- data/fastlane_core/lib/fastlane_core/project.rb +23 -0
- data/frameit/lib/frameit/editor.rb +3 -0
- data/gym/lib/gym/code_signing_mapping.rb +32 -3
- data/gym/lib/gym/detect_values.rb +34 -2
- data/gym/lib/gym/generators/build_command_generator.rb +1 -0
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +47 -17
- data/gym/lib/gym/module.rb +8 -0
- data/gym/lib/gym/options.rb +25 -1
- data/gym/lib/gym/runner.rb +63 -23
- data/match/lib/match/encryption/openssl.rb +1 -1
- data/match/lib/match/generator.rb +17 -3
- data/match/lib/match/module.rb +4 -1
- data/match/lib/match/nuke.rb +54 -16
- data/match/lib/match/options.rb +28 -15
- data/match/lib/match/runner.rb +21 -8
- data/match/lib/match/spaceship_ensure.rb +19 -9
- data/match/lib/match/storage/git_storage.rb +11 -3
- data/pilot/lib/pilot/build_manager.rb +46 -12
- data/pilot/lib/pilot/options.rb +3 -1
- data/scan/lib/scan/detect_values.rb +6 -1
- data/scan/lib/scan/manager.rb +18 -1
- data/scan/lib/scan/options.rb +23 -1
- data/scan/lib/scan/runner.rb +6 -0
- data/scan/lib/scan/slack_poster.rb +1 -1
- data/scan/lib/scan/test_command_generator.rb +1 -1
- data/screengrab/lib/screengrab/options.rb +1 -10
- data/screengrab/lib/screengrab/runner.rb +16 -19
- data/snapshot/lib/snapshot/options.rb +12 -1
- data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +11 -0
- data/spaceship/lib/spaceship/client.rb +9 -4
- data/spaceship/lib/spaceship/connect_api.rb +2 -0
- data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_feedback.rb +75 -0
- data/spaceship/lib/spaceship/connect_api/models/beta_screenshot.rb +18 -0
- data/spaceship/lib/spaceship/connect_api/models/build.rb +5 -0
- data/spaceship/lib/spaceship/connect_api/models/build_beta_detail.rb +5 -0
- data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +15 -0
- data/spaceship/lib/spaceship/portal/app.rb +11 -2
- data/spaceship/lib/spaceship/tunes/iap.rb +11 -11
- data/spaceship/lib/spaceship/tunes/iap_detail.rb +7 -3
- data/spaceship/lib/spaceship/tunes/iap_families.rb +12 -1
- data/spaceship/lib/spaceship/tunes/iap_family_details.rb +26 -17
- data/spaceship/lib/spaceship/tunes/iap_status.rb +5 -1
- data/spaceship/lib/spaceship/tunes/tunes_client.rb +4 -7
- data/supply/lib/supply/client.rb +27 -0
- data/supply/lib/supply/options.rb +8 -2
- data/supply/lib/supply/uploader.rb +55 -26
- metadata +44 -25
- data/supply/lib/supply/.uploader.rb.swp +0 -0
@@ -262,6 +262,9 @@ module Frameit
|
|
262
262
|
left_space = (background.width / 2.0 - image.width / 2.0).round
|
263
263
|
|
264
264
|
@image = background.composite(image, "png") do |c|
|
265
|
+
colorspace = image.data["colorspace"]
|
266
|
+
c.colorspace(colorspace) if colorspace
|
267
|
+
|
265
268
|
c.compose("Over")
|
266
269
|
c.geometry("+#{left_space}+#{device_top(background)}")
|
267
270
|
end
|
@@ -88,6 +88,13 @@ module Gym
|
|
88
88
|
when "tvOS"
|
89
89
|
destination_sdkroot = ["appletvos"]
|
90
90
|
end
|
91
|
+
|
92
|
+
# Catalyst projects will always have an "iphoneos" sdkroot
|
93
|
+
# Need to force a same platform when trying to build as macos
|
94
|
+
if Gym.building_mac_catalyst_for_mac?
|
95
|
+
return true
|
96
|
+
end
|
97
|
+
|
91
98
|
return destination_sdkroot.include?(sdkroot)
|
92
99
|
end
|
93
100
|
|
@@ -134,10 +141,31 @@ module Gym
|
|
134
141
|
next unless same_platform?(sdkroot)
|
135
142
|
next unless specified_configuration == build_configuration.name
|
136
143
|
|
137
|
-
|
144
|
+
# Catalyst apps will have some build settings that will have a configuration
|
145
|
+
# that is specfic for macos so going to do our best to capture those
|
146
|
+
#
|
147
|
+
# There are other platform filters besides "[sdk=macosx*]" that we could use but
|
148
|
+
# this is the default that Xcode will use so this will also be our default
|
149
|
+
sdk_specifier = Gym.building_mac_catalyst_for_mac? ? "[sdk=macosx*]" : ""
|
150
|
+
|
151
|
+
# Look for sdk specific bundle identifier (if set) and fallback to general configuration if none
|
152
|
+
bundle_identifier = build_configuration.resolve_build_setting("PRODUCT_BUNDLE_IDENTIFIER#{sdk_specifier}", target)
|
153
|
+
bundle_identifier ||= build_configuration.resolve_build_setting("PRODUCT_BUNDLE_IDENTIFIER", target)
|
138
154
|
next unless bundle_identifier
|
139
|
-
|
140
|
-
|
155
|
+
|
156
|
+
# Xcode prefixes "maccatalyst." if building a Catalyst app for mac and
|
157
|
+
# if DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER is set to YES
|
158
|
+
if Gym.building_mac_catalyst_for_mac? && build_configuration.resolve_build_setting("DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER", target) == "YES"
|
159
|
+
bundle_identifier = "maccatalyst.#{bundle_identifier}"
|
160
|
+
end
|
161
|
+
|
162
|
+
# Look for sdk specific provisioning profile specifier (if set) and fallback to general configuration if none
|
163
|
+
provisioning_profile_specifier = build_configuration.resolve_build_setting("PROVISIONING_PROFILE_SPECIFIER#{sdk_specifier}", target)
|
164
|
+
provisioning_profile_specifier ||= build_configuration.resolve_build_setting("PROVISIONING_PROFILE_SPECIFIER", target)
|
165
|
+
|
166
|
+
# Look for sdk specific provisioning profile uuid (if set) and fallback to general configuration if none
|
167
|
+
provisioning_profile_uuid = build_configuration.resolve_build_setting("PROVISIONING_PROFILE#{sdk_specifier}", target)
|
168
|
+
provisioning_profile_uuid ||= build_configuration.resolve_build_setting("PROVISIONING_PROFILE", target)
|
141
169
|
|
142
170
|
has_profile_specifier = provisioning_profile_specifier.to_s.length > 0
|
143
171
|
has_profile_uuid = provisioning_profile_uuid.to_s.length > 0
|
@@ -177,5 +205,6 @@ module Gym
|
|
177
205
|
|
178
206
|
return provisioning_profile_mapping
|
179
207
|
end
|
208
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
180
209
|
end
|
181
210
|
end
|
@@ -33,6 +33,7 @@ module Gym
|
|
33
33
|
detect_selected_provisioning_profiles # we can only do that *after* we have the platform
|
34
34
|
detect_configuration
|
35
35
|
detect_toolchain
|
36
|
+
detect_third_party_installer
|
36
37
|
|
37
38
|
config[:output_name] ||= Gym.project.app_name
|
38
39
|
|
@@ -100,6 +101,38 @@ module Gym
|
|
100
101
|
end
|
101
102
|
end
|
102
103
|
|
104
|
+
# Detects name of a "3rd Party Mac Developer Installer" cert for the configured team id
|
105
|
+
def self.detect_third_party_installer
|
106
|
+
return if Gym.config[:installer_cert_name]
|
107
|
+
|
108
|
+
team_id = Gym.config[:export_team_id] || Gym.project.build_settings(key: "DEVELOPMENT_TEAM")
|
109
|
+
return if team_id.nil?
|
110
|
+
|
111
|
+
case Gym.config[:export_method]
|
112
|
+
when "app-store"
|
113
|
+
prefix = "3rd Party Mac Developer Installer: "
|
114
|
+
when "developer-id"
|
115
|
+
prefix = "Developer ID Installer: "
|
116
|
+
else
|
117
|
+
return
|
118
|
+
end
|
119
|
+
|
120
|
+
output = Helper.backticks("security find-certificate -a -c \"#{prefix}\"", print: false)
|
121
|
+
|
122
|
+
# Find matches, filter by team_id, prepend prefix for full cert name
|
123
|
+
certs = output.scan(/"(?:#{prefix})(.*)"/)
|
124
|
+
certs = certs.flatten.uniq.select do |cert|
|
125
|
+
cert.include?(team_id)
|
126
|
+
end.map do |cert|
|
127
|
+
prefix + cert
|
128
|
+
end
|
129
|
+
|
130
|
+
if certs.first
|
131
|
+
UI.verbose("Detected installer certificate to use: #{certs.first}")
|
132
|
+
Gym.config[:installer_cert_name] = certs.first
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
103
136
|
def self.detect_scheme
|
104
137
|
Gym.project.select_scheme
|
105
138
|
end
|
@@ -111,14 +144,13 @@ module Gym
|
|
111
144
|
# Is it an iOS device or a Mac?
|
112
145
|
def self.detect_platform
|
113
146
|
return if Gym.config[:destination]
|
114
|
-
platform = if Gym.project.mac?
|
147
|
+
platform = if Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
|
115
148
|
min_xcode8? ? "macOS" : "OS X"
|
116
149
|
elsif Gym.project.tvos?
|
117
150
|
"tvOS"
|
118
151
|
else
|
119
152
|
"iOS"
|
120
153
|
end
|
121
|
-
|
122
154
|
Gym.config[:destination] = "generic/platform=#{platform}"
|
123
155
|
end
|
124
156
|
|
@@ -58,27 +58,53 @@ module Gym
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def ipa_path
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
61
|
+
path = Gym.cache[:ipa_path]
|
62
|
+
return path if path
|
63
|
+
|
64
|
+
path = Dir[File.join(temporary_output_path, "*.ipa")].last
|
65
|
+
# We need to process generic IPA
|
66
|
+
if path
|
67
|
+
# Try to find IPA file in the output directory, used when app thinning was not set
|
68
|
+
Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
|
69
|
+
FileUtils.mv(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
|
70
|
+
elsif Dir.exist?(apps_path)
|
71
|
+
# Try to find "generic" IPA file inside "Apps" folder, used when app thinning was set
|
72
|
+
files = Dir[File.join(apps_path, "*.ipa")]
|
73
|
+
# Generic IPA file doesn't have suffix so its name is the shortest
|
74
|
+
path = files.min_by(&:length)
|
75
|
+
Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
|
76
|
+
FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:ipa_path]).downcase).zero?
|
77
|
+
else
|
78
|
+
ErrorHandler.handle_empty_archive unless path
|
78
79
|
end
|
80
|
+
|
79
81
|
Gym.cache[:ipa_path]
|
80
82
|
end
|
81
83
|
|
84
|
+
def pkg_path
|
85
|
+
path = Gym.cache[:pkg_path]
|
86
|
+
return path if path
|
87
|
+
|
88
|
+
path = Dir[File.join(temporary_output_path, "*.pkg")].last
|
89
|
+
# We need to process generic PKG
|
90
|
+
if path
|
91
|
+
# Try to find PKG file in the output directory, used when app thinning was not set
|
92
|
+
Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
|
93
|
+
FileUtils.mv(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
|
94
|
+
elsif Dir.exist?(apps_path)
|
95
|
+
# Try to find "generic" PKG file inside "Apps" folder, used when app thinning was set
|
96
|
+
files = Dir[File.join(apps_path, "*.pkg")]
|
97
|
+
# Generic PKG file doesn't have suffix so its name is the shortest
|
98
|
+
path = files.min_by(&:length)
|
99
|
+
Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
|
100
|
+
FileUtils.cp(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
|
101
|
+
else
|
102
|
+
ErrorHandler.handle_empty_archive unless path
|
103
|
+
end
|
104
|
+
|
105
|
+
Gym.cache[:pkg_path]
|
106
|
+
end
|
107
|
+
|
82
108
|
# The path the the dsym file for this app. Might be nil
|
83
109
|
def dsym_path
|
84
110
|
Dir[BuildCommandGenerator.archive_path + "/**/*.app.dSYM"].last
|
@@ -160,6 +186,10 @@ module Gym
|
|
160
186
|
hash[:signingStyle] = 'manual'
|
161
187
|
end
|
162
188
|
|
189
|
+
if Gym.config[:installer_cert_name] && (Gym.project.mac? || Gym.building_mac_catalyst_for_mac?)
|
190
|
+
hash[:installerSigningCertificate] = Gym.config[:installer_cert_name]
|
191
|
+
end
|
192
|
+
|
163
193
|
hash[:teamID] = Gym.config[:export_team_id] if Gym.config[:export_team_id]
|
164
194
|
|
165
195
|
UI.important("Generated plist file with the following values:")
|
data/gym/lib/gym/module.rb
CHANGED
@@ -24,6 +24,14 @@ module Gym
|
|
24
24
|
# Import all the fixes
|
25
25
|
require 'gym/xcodebuild_fixes/generic_archive_fix'
|
26
26
|
end
|
27
|
+
|
28
|
+
def building_mac_catalyst_for_ios?
|
29
|
+
Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "ios"
|
30
|
+
end
|
31
|
+
|
32
|
+
def building_mac_catalyst_for_mac?
|
33
|
+
Gym.project.supports_mac_catalyst? && Gym.config[:catalyst_platform] == "macos"
|
34
|
+
end
|
27
35
|
end
|
28
36
|
|
29
37
|
Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
|
data/gym/lib/gym/options.rb
CHANGED
@@ -85,6 +85,11 @@ module Gym
|
|
85
85
|
description: "Should we skip packaging the ipa?",
|
86
86
|
type: Boolean,
|
87
87
|
default_value: false),
|
88
|
+
FastlaneCore::ConfigItem.new(key: :skip_package_pkg,
|
89
|
+
env_name: "GYM_SKIP_PACKAGE_PKG",
|
90
|
+
description: "Should we skip packaging the pkg?",
|
91
|
+
type: Boolean,
|
92
|
+
default_value: false),
|
88
93
|
FastlaneCore::ConfigItem.new(key: :include_symbols,
|
89
94
|
short_option: "-m",
|
90
95
|
env_name: "GYM_INCLUDE_SYMBOLS",
|
@@ -139,6 +144,20 @@ module Gym
|
|
139
144
|
description: "Build without codesigning",
|
140
145
|
type: Boolean,
|
141
146
|
optional: true),
|
147
|
+
FastlaneCore::ConfigItem.new(key: :catalyst_platform,
|
148
|
+
env_name: "GYM_CATALYST_PLATFORM",
|
149
|
+
description: "Platform to build when using a Catalyst enabled app. Valid values are: ios, macos",
|
150
|
+
type: String,
|
151
|
+
optional: true,
|
152
|
+
verify_block: proc do |value|
|
153
|
+
av = %w(ios macos)
|
154
|
+
UI.user_error!("Unsupported export_method '#{value}', must be: #{av}") unless av.include?(value)
|
155
|
+
end),
|
156
|
+
FastlaneCore::ConfigItem.new(key: :installer_cert_name,
|
157
|
+
env_name: "GYM_INSTALLER_CERT_NAME",
|
158
|
+
description: "Full name of 3rd Party Mac Developer Installer or Deveoper ID Installer certificate. Example: `3rd Party Mac Developer Installer: Your Company (ABC1234XWYZ)`",
|
159
|
+
type: String,
|
160
|
+
optional: true),
|
142
161
|
# Very optional
|
143
162
|
FastlaneCore::ConfigItem.new(key: :build_path,
|
144
163
|
env_name: "GYM_BUILD_PATH",
|
@@ -255,7 +274,12 @@ module Gym
|
|
255
274
|
description: "Do not try to build a profile mapping from the xcodeproj. Match or a manually provided mapping should be used",
|
256
275
|
optional: true,
|
257
276
|
type: Boolean,
|
258
|
-
default_value: false)
|
277
|
+
default_value: false),
|
278
|
+
FastlaneCore::ConfigItem.new(key: :cloned_source_packages_path,
|
279
|
+
env_name: "GYM_CLONED_SOURCE_PACKAGES_PATH",
|
280
|
+
description: "Sets a custom path for Swift Package Manager dependencies",
|
281
|
+
type: String,
|
282
|
+
optional: true)
|
259
283
|
]
|
260
284
|
end
|
261
285
|
end
|
data/gym/lib/gym/runner.rb
CHANGED
@@ -18,9 +18,17 @@ module Gym
|
|
18
18
|
build_app
|
19
19
|
end
|
20
20
|
verify_archive unless Gym.config[:skip_archive]
|
21
|
+
|
22
|
+
return nil if Gym.config[:skip_archive]
|
23
|
+
|
21
24
|
FileUtils.mkdir_p(File.expand_path(Gym.config[:output_directory]))
|
22
25
|
|
23
|
-
|
26
|
+
# Determine platform to archive
|
27
|
+
is_mac = Gym.project.mac? || Gym.building_mac_catalyst_for_mac?
|
28
|
+
is_ios = !is_mac && (Gym.project.ios? || Gym.project.tvos?)
|
29
|
+
|
30
|
+
# Archive
|
31
|
+
if is_ios
|
24
32
|
fix_generic_archive # See https://github.com/fastlane/fastlane/pull/4325
|
25
33
|
return BuildCommandGenerator.archive_path if Gym.config[:skip_package_ipa]
|
26
34
|
|
@@ -31,11 +39,15 @@ module Gym
|
|
31
39
|
move_app_thinning
|
32
40
|
move_app_thinning_size_report
|
33
41
|
move_apps_folder
|
34
|
-
elsif
|
42
|
+
elsif is_mac
|
35
43
|
path = File.expand_path(Gym.config[:output_directory])
|
36
44
|
compress_and_move_dsym
|
37
|
-
if Gym.project.mac_app?
|
38
|
-
copy_mac_app
|
45
|
+
if Gym.project.mac_app? || Gym.building_mac_catalyst_for_mac?
|
46
|
+
path = copy_mac_app
|
47
|
+
return path if Gym.config[:skip_package_pkg]
|
48
|
+
|
49
|
+
package_app
|
50
|
+
path = move_pkg
|
39
51
|
return path
|
40
52
|
end
|
41
53
|
copy_files_from_path(File.join(BuildCommandGenerator.archive_path, "Products/usr/local/bin/*")) if Gym.project.command_line_tool?
|
@@ -97,9 +109,11 @@ module Gym
|
|
97
109
|
ErrorHandler.handle_build_error(output)
|
98
110
|
end)
|
99
111
|
|
100
|
-
|
101
|
-
|
102
|
-
|
112
|
+
unless Gym.config[:skip_archive]
|
113
|
+
mark_archive_as_built_by_gym(BuildCommandGenerator.archive_path)
|
114
|
+
UI.success("Successfully stored the archive. You can find it in the Xcode Organizer.") unless Gym.config[:archive_path].nil?
|
115
|
+
UI.verbose("Stored the archive in: " + BuildCommandGenerator.archive_path)
|
116
|
+
end
|
103
117
|
|
104
118
|
post_build_app
|
105
119
|
end
|
@@ -155,31 +169,45 @@ module Gym
|
|
155
169
|
dwarfdump_command << "dwarfdump"
|
156
170
|
dwarfdump_command << "--uuid #{dsym.shellescape}"
|
157
171
|
|
172
|
+
# Extract uuids
|
158
173
|
dwarfdump_result = Helper.backticks(dwarfdump_command.join(" "), print: false)
|
159
174
|
architecture_infos = dwarfdump_result.split("\n")
|
160
|
-
|
161
|
-
info_array = info.split(" ")
|
175
|
+
architecture_infos.each do |info|
|
176
|
+
info_array = info.split(" ", 4)
|
162
177
|
uuid = info_array[1]
|
178
|
+
dwarf_file_path = info_array[3]
|
163
179
|
|
164
180
|
if uuid.nil? || !uuid.match(uuid_regex)
|
165
|
-
|
166
|
-
else
|
167
|
-
uuid
|
181
|
+
next
|
168
182
|
end
|
169
|
-
end
|
170
|
-
|
171
|
-
architecture_uuids = architecture_uuids.reject(&:nil?)
|
172
|
-
|
173
|
-
symbol_map_paths = architecture_uuids.map do |uuid|
|
174
|
-
"#{bcsymbolmaps_directory.shellescape}/#{uuid}.bcsymbolmap"
|
175
|
-
end
|
176
183
|
|
177
|
-
|
178
|
-
|
179
|
-
|
184
|
+
# Find bcsymbolmap file to be used:
|
185
|
+
# - if a <uuid>.plist file exists, we will extract uuid of bcsymbolmap and use it
|
186
|
+
# - if a <uuid>.bcsymbolmap file exists, we will use it
|
187
|
+
# - otherwise let dsymutil figure it out
|
188
|
+
symbol_map_path = nil
|
189
|
+
split_dwarf_file_path = File.split(dwarf_file_path)
|
190
|
+
dsym_plist_file_path = File.join(split_dwarf_file_path[0], "..", "#{uuid}.plist")
|
191
|
+
if File.exist?(dsym_plist_file_path)
|
192
|
+
dsym_plist = Plist.parse_xml(dsym_plist_file_path)
|
193
|
+
original_uuid = dsym_plist['DBGOriginalUUID']
|
194
|
+
possible_symbol_map_path = "#{bcsymbolmaps_directory}/#{original_uuid}.bcsymbolmap"
|
195
|
+
if File.exist?(possible_symbol_map_path)
|
196
|
+
symbol_map_path = possible_symbol_map_path.shellescape
|
197
|
+
end
|
198
|
+
end
|
199
|
+
if symbol_map_path.nil?
|
200
|
+
possible_symbol_map_path = File.join(bcsymbolmaps_directory, "#{uuid}.bcsymbolmap")
|
201
|
+
if File.exist?(possible_symbol_map_path)
|
202
|
+
symbol_map_path = possible_symbol_map_path.shellescape
|
203
|
+
end
|
204
|
+
end
|
205
|
+
if symbol_map_path.nil?
|
206
|
+
symbol_map_path = bcsymbolmaps_directory.shellescape
|
207
|
+
end
|
180
208
|
command = []
|
181
209
|
command << "dsymutil"
|
182
|
-
command << "--symbol-map #{
|
210
|
+
command << "--symbol-map #{symbol_map_path}"
|
183
211
|
command << dsym.shellescape
|
184
212
|
Helper.backticks(command.join(" "), print: !Gym.config[:silent])
|
185
213
|
end
|
@@ -207,6 +235,17 @@ module Gym
|
|
207
235
|
ipa_path
|
208
236
|
end
|
209
237
|
|
238
|
+
# Moves over the binary and dsym file to the output directory
|
239
|
+
# @return (String) The path to the resulting pkg file
|
240
|
+
def move_pkg
|
241
|
+
FileUtils.mv(PackageCommandGenerator.pkg_path, File.expand_path(Gym.config[:output_directory]), force: true)
|
242
|
+
pkg_path = File.expand_path(File.join(Gym.config[:output_directory], File.basename(PackageCommandGenerator.pkg_path)))
|
243
|
+
|
244
|
+
UI.success("Successfully exported and signed the pkg file:")
|
245
|
+
UI.message(pkg_path)
|
246
|
+
pkg_path
|
247
|
+
end
|
248
|
+
|
210
249
|
# copys framework from temp folder:
|
211
250
|
|
212
251
|
def copy_files_from_path(path)
|
@@ -229,6 +268,7 @@ module Gym
|
|
229
268
|
def copy_mac_app
|
230
269
|
exe_name = Gym.project.build_settings(key: "EXECUTABLE_NAME")
|
231
270
|
app_path = File.join(BuildCommandGenerator.archive_path, "Products/Applications/#{exe_name}.app")
|
271
|
+
|
232
272
|
UI.crash!("Couldn't find application in '#{BuildCommandGenerator.archive_path}'") unless File.exist?(app_path)
|
233
273
|
FileUtils.cp_r(app_path, File.expand_path(Gym.config[:output_directory]), remove_destination: true)
|
234
274
|
app_path = File.join(Gym.config[:output_directory], File.basename(app_path))
|
@@ -71,7 +71,7 @@ module Match
|
|
71
71
|
private
|
72
72
|
|
73
73
|
def iterate(source_path)
|
74
|
-
Dir[File.join(source_path, "**", "*.{cer,p12,mobileprovision}")].each do |path|
|
74
|
+
Dir[File.join(source_path, "**", "*.{cer,p12,mobileprovision,provisionprofile}")].each do |path|
|
75
75
|
next if File.directory?(path)
|
76
76
|
yield(path)
|
77
77
|
end
|
@@ -3,14 +3,20 @@ require_relative 'module'
|
|
3
3
|
module Match
|
4
4
|
# Generate missing resources
|
5
5
|
class Generator
|
6
|
-
def self.generate_certificate(params, cert_type, working_directory)
|
6
|
+
def self.generate_certificate(params, cert_type, working_directory, specific_cert_type: nil)
|
7
7
|
require 'cert/runner'
|
8
8
|
require 'cert/options'
|
9
9
|
|
10
10
|
output_path = File.join(working_directory, "certs", cert_type.to_s)
|
11
11
|
|
12
|
+
# Mapping match option to cert option for "Developer ID Application"
|
13
|
+
if cert_type.to_sym == :developer_id_application
|
14
|
+
specific_cert_type = cert_type.to_s
|
15
|
+
end
|
16
|
+
|
12
17
|
arguments = FastlaneCore::Configuration.create(Cert::Options.available_options, {
|
13
18
|
development: params[:type] == "development",
|
19
|
+
type: specific_cert_type,
|
14
20
|
generate_apple_certs: params[:generate_apple_certs],
|
15
21
|
output_path: output_path,
|
16
22
|
force: true, # we don't need a certificate without its private key, we only care about a new certificate
|
@@ -70,8 +76,15 @@ module Match
|
|
70
76
|
}
|
71
77
|
|
72
78
|
values[:platform] = params[:platform]
|
73
|
-
|
74
|
-
|
79
|
+
|
80
|
+
# These options are all conflicting so can only set one
|
81
|
+
if params[:type] == "developer_id"
|
82
|
+
values[:developer_id] = true
|
83
|
+
elsif prov_type == :adhoc
|
84
|
+
values[:adhoc] = true
|
85
|
+
elsif prov_type == :development
|
86
|
+
values[:development] = true
|
87
|
+
end
|
75
88
|
|
76
89
|
arguments = FastlaneCore::Configuration.create(Sigh::Options.available_options, values)
|
77
90
|
|
@@ -82,6 +95,7 @@ module Match
|
|
82
95
|
|
83
96
|
# @return the name of the provisioning profile type
|
84
97
|
def self.profile_type_name(type)
|
98
|
+
return "Direct" if type == :developer_id
|
85
99
|
return "Development" if type == :development
|
86
100
|
return "AdHoc" if type == :adhoc
|
87
101
|
return "AppStore" if type == :appstore
|