fastlane 2.194.0 → 2.198.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +90 -90
  3. data/cert/lib/cert/runner.rb +5 -2
  4. data/deliver/lib/assets/ScreenshotsHelp +29 -6
  5. data/deliver/lib/deliver/app_screenshot.rb +4 -4
  6. data/deliver/lib/deliver/runner.rb +1 -1
  7. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  8. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +12 -6
  9. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +1 -1
  10. data/fastlane/lib/fastlane/actions/download_dsyms.rb +47 -30
  11. data/fastlane/lib/fastlane/actions/get_push_certificate.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/get_version_number.rb +6 -2
  13. data/fastlane/lib/fastlane/actions/gradle.rb +15 -2
  14. data/fastlane/lib/fastlane/actions/last_git_commit.rb +1 -1
  15. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +2 -3
  16. data/fastlane/lib/fastlane/actions/notarize.rb +29 -11
  17. data/fastlane/lib/fastlane/actions/prompt.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/set_github_release.rb +11 -5
  19. data/fastlane/lib/fastlane/version.rb +1 -1
  20. data/fastlane/swift/Deliverfile.swift +1 -1
  21. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  22. data/fastlane/swift/Fastlane.swift +77 -82
  23. data/fastlane/swift/Gymfile.swift +1 -1
  24. data/fastlane/swift/GymfileProtocol.swift +1 -1
  25. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  26. data/fastlane/swift/Matchfile.swift +1 -1
  27. data/fastlane/swift/MatchfileProtocol.swift +9 -1
  28. data/fastlane/swift/Precheckfile.swift +1 -1
  29. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  30. data/fastlane/swift/Runner.swift +1 -1
  31. data/fastlane/swift/Scanfile.swift +1 -1
  32. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  33. data/fastlane/swift/Screengrabfile.swift +1 -1
  34. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  35. data/fastlane/swift/Snapshotfile.swift +1 -1
  36. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  37. data/fastlane/swift/formatting/Brewfile.lock.json +27 -22
  38. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +31 -7
  39. data/frameit/lib/frameit/editor.rb +16 -18
  40. data/frameit/lib/frameit/trim_box.rb +6 -0
  41. data/match/lib/match/generator.rb +2 -1
  42. data/match/lib/match/nuke.rb +79 -1
  43. data/match/lib/match/options.rb +10 -0
  44. data/match/lib/match/runner.rb +94 -10
  45. data/match/lib/match/spaceship_ensure.rb +1 -0
  46. data/pem/lib/pem/manager.rb +31 -7
  47. data/pem/lib/pem/options.rb +10 -1
  48. data/pilot/lib/pilot/build_manager.rb +1 -1
  49. data/scan/lib/scan/runner.rb +1 -1
  50. data/screengrab/lib/screengrab/options.rb +2 -2
  51. data/sigh/lib/assets/resign.sh +8 -5
  52. data/sigh/lib/sigh/options.rb +5 -0
  53. data/sigh/lib/sigh/runner.rb +2 -2
  54. data/snapshot/lib/snapshot/options.rb +1 -1
  55. data/snapshot/lib/snapshot/reports_generator.rb +8 -0
  56. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +7 -0
  57. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -2
  58. data/spaceship/lib/spaceship/connect_api/models/build_bundle.rb +59 -0
  59. data/spaceship/lib/spaceship/connect_api/models/certificate.rb +3 -0
  60. data/{fastlane/lib/fastlane/actions/.notarize.rb.swp → spaceship/lib/spaceship/connect_api/testflight/.testflight.rb.swp} +0 -0
  61. data/spaceship/lib/spaceship/connect_api/token.rb +1 -1
  62. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  63. data/supply/lib/supply/client.rb +3 -3
  64. data/supply/lib/supply/uploader.rb +1 -1
  65. metadata +38 -35
  66. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -207
  67. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +0 -157
@@ -1,207 +0,0 @@
1
- module Fastlane
2
- module Actions
3
- class CrashlyticsAction < Action
4
- def self.run(params)
5
- params.values # to validate all inputs before looking for the ipa/apk
6
- tempfiles = []
7
-
8
- # We need to store notes in a file, because the crashlytics CLI (iOS) says so
9
- if params[:notes]
10
- UI.error("Overwriting :notes_path, because you specified :notes") if params[:notes_path]
11
-
12
- changelog = Helper::CrashlyticsHelper.write_to_tempfile(params[:notes], 'changelog')
13
- tempfiles << changelog
14
- params[:notes_path] = changelog.path
15
- elsif Actions.lane_context[SharedValues::FL_CHANGELOG] && !params[:notes_path]
16
- UI.message("Sending FL_CHANGELOG as release notes to Beta by Crashlytics")
17
-
18
- changelog = Helper::CrashlyticsHelper.write_to_tempfile(
19
- Actions.lane_context[SharedValues::FL_CHANGELOG], 'changelog'
20
- )
21
- tempfiles << changelog
22
- params[:notes_path] = changelog.path
23
- end
24
-
25
- if params[:ipa_path]
26
- command = Helper::CrashlyticsHelper.generate_ios_command(params)
27
- elsif params[:apk_path]
28
- android_manifest = Helper::CrashlyticsHelper.generate_android_manifest_tempfile
29
- tempfiles << android_manifest
30
- command = Helper::CrashlyticsHelper.generate_android_command(params, android_manifest.path)
31
- else
32
- UI.user_error!("You have to either pass an ipa or an apk file to the Crashlytics action")
33
- end
34
-
35
- UI.success('Uploading the build to Crashlytics Beta. Time for some ☕️.')
36
-
37
- sanitizer = proc do |message|
38
- message.gsub(params[:api_token], '[[API_TOKEN]]')
39
- .gsub(params[:build_secret], '[[BUILD_SECRET]]')
40
- end
41
-
42
- UI.verbose(sanitizer.call(command.join(' '))) if FastlaneCore::Globals.verbose?
43
-
44
- error_callback = proc do |error|
45
- clean_error = sanitizer.call(error)
46
- UI.user_error!(clean_error)
47
- end
48
-
49
- result = Actions.sh_control_output(
50
- command.join(" "),
51
- print_command: false,
52
- print_command_output: false,
53
- error_callback: error_callback
54
- )
55
-
56
- tempfiles.each(&:unlink)
57
- return command if Helper.test?
58
-
59
- UI.verbose(sanitizer.call(result)) if FastlaneCore::Globals.verbose?
60
-
61
- UI.success('Build successfully uploaded to Crashlytics Beta 🌷')
62
- UI.success('Visit https://fabric.io/_/beta to add release notes and notify testers.')
63
- end
64
-
65
- def self.description
66
- "Refer to [Firebase App Distribution](https://appdistro.page.link/fastlane-repo)"
67
- end
68
-
69
- def self.available_options
70
- platform = Actions.lane_context[Actions::SharedValues::PLATFORM_NAME]
71
-
72
- if platform == :ios || platform.nil?
73
- ipa_path_default = Dir["*.ipa"].sort_by { |x| File.mtime(x) }.last
74
- end
75
-
76
- if platform == :android
77
- apk_path_default = Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-release.apk")].last
78
- end
79
-
80
- [
81
- # iOS Specific
82
- FastlaneCore::ConfigItem.new(key: :ipa_path,
83
- env_name: "CRASHLYTICS_IPA_PATH",
84
- description: "Path to your IPA file. Optional if you use the _gym_ or _xcodebuild_ action",
85
- default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || ipa_path_default,
86
- default_value_dynamic: true,
87
- optional: true,
88
- verify_block: proc do |value|
89
- UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
90
- end),
91
- # Android Specific
92
- FastlaneCore::ConfigItem.new(key: :apk_path,
93
- env_name: "CRASHLYTICS_APK_PATH",
94
- description: "Path to your APK file",
95
- default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || apk_path_default,
96
- default_value_dynamic: true,
97
- optional: true,
98
- verify_block: proc do |value|
99
- UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
100
- end),
101
- # General
102
- FastlaneCore::ConfigItem.new(key: :crashlytics_path,
103
- env_name: "CRASHLYTICS_FRAMEWORK_PATH",
104
- description: "Path to the submit binary in the Crashlytics bundle (iOS) or `crashlytics-devtools.jar` file (Android)",
105
- optional: true,
106
- verify_block: proc do |value|
107
- UI.user_error!("Couldn't find crashlytics at path '#{File.expand_path(value)}'`") unless File.exist?(File.expand_path(value))
108
- end),
109
- FastlaneCore::ConfigItem.new(key: :api_token,
110
- env_name: "CRASHLYTICS_API_TOKEN",
111
- description: "Crashlytics API Key",
112
- sensitive: true,
113
- verify_block: proc do |value|
114
- UI.user_error!("No API token for Crashlytics given, pass using `api_token: 'token'`") unless value && !value.empty?
115
- end),
116
- FastlaneCore::ConfigItem.new(key: :build_secret,
117
- env_name: "CRASHLYTICS_BUILD_SECRET",
118
- description: "Crashlytics Build Secret",
119
- sensitive: true,
120
- verify_block: proc do |value|
121
- UI.user_error!("No build secret for Crashlytics given, pass using `build_secret: 'secret'`") unless value && !value.empty?
122
- end),
123
- FastlaneCore::ConfigItem.new(key: :notes_path,
124
- env_name: "CRASHLYTICS_NOTES_PATH",
125
- description: "Path to the release notes",
126
- optional: true,
127
- verify_block: proc do |value|
128
- UI.user_error!("Path '#{value}' not found") unless File.exist?(value)
129
- end),
130
- FastlaneCore::ConfigItem.new(key: :notes,
131
- env_name: "CRASHLYTICS_NOTES",
132
- description: "The release notes as string - uses :notes_path under the hood",
133
- optional: true),
134
- FastlaneCore::ConfigItem.new(key: :groups,
135
- env_name: "CRASHLYTICS_GROUPS",
136
- description: "The groups used for distribution, separated by commas",
137
- type: Array,
138
- optional: true),
139
- FastlaneCore::ConfigItem.new(key: :emails,
140
- env_name: "CRASHLYTICS_EMAILS",
141
- description: "Pass email addresses of testers, separated by commas",
142
- type: Array,
143
- optional: true),
144
- FastlaneCore::ConfigItem.new(key: :notifications,
145
- env_name: "CRASHLYTICS_NOTIFICATIONS",
146
- description: "Crashlytics notification option (true/false)",
147
- default_value: true,
148
- type: Boolean),
149
- FastlaneCore::ConfigItem.new(key: :debug,
150
- env_name: "CRASHLYTICS_DEBUG",
151
- description: "Crashlytics debug option (true/false)",
152
- default_value: false,
153
- type: Boolean)
154
-
155
- ]
156
- end
157
-
158
- def self.is_supported?(platform)
159
- [:ios, :mac, :android].include?(platform)
160
- end
161
-
162
- def self.author
163
- ["KrauseFx", "pedrogimenez"]
164
- end
165
-
166
- def self.details
167
- [
168
- "Additionally, you can specify `notes`, `emails`, `groups` and `notifications`.",
169
- "Distributing to Groups: When using the `groups` parameter, it's important to use the group **alias** names for each group you'd like to distribute to. A group's alias can be found in the web UI. If you're viewing the Beta page, you can open the groups dialog by clicking the 'Manage Groups' button.",
170
- "This action uses the `submit` binary provided by the Crashlytics framework. If the binary is not found in its usual path, you'll need to specify the path manually by using the `crashlytics_path` option."
171
- ].join("\n")
172
- end
173
-
174
- def self.example_code
175
- [
176
- 'crashlytics',
177
- '# If you installed Crashlytics via CocoaPods
178
- crashlytics(
179
- crashlytics_path: "./Pods/Crashlytics/submit", # path to your Crashlytics submit binary.
180
- api_token: "...",
181
- build_secret: "...",
182
- ipa_path: "./app.ipa"
183
- )',
184
- '# If you installed Crashlytics via Carthage for iOS platform
185
- crashlytics(
186
- crashlytics_path: "./Carthage/Build/iOS/Crashlytics.framework/submit", # path to your Crashlytics submit binary.
187
- api_token: "...",
188
- build_secret: "...",
189
- ipa_path: "./app.ipa"
190
- )'
191
- ]
192
- end
193
-
194
- def self.category
195
- :deprecated
196
- end
197
-
198
- def self.deprecated_notes
199
- [
200
- "Crashlytics Beta has been deprecated and replaced with Firebase App Distribution.",
201
- "Beta will continue working until May 4, 2020.",
202
- "Check out the [Firebase App Distribution docs](https://github.com/fastlane/fastlane-plugin-firebase_app_distribution) to get started."
203
- ].join("\n")
204
- end
205
- end
206
- end
207
- end
@@ -1,157 +0,0 @@
1
- require 'shellwords'
2
-
3
- module Fastlane
4
- module Helper
5
- class CrashlyticsHelper
6
- class << self
7
- def discover_crashlytics_path(params)
8
- path = params[:crashlytics_path]
9
-
10
- # Finding submit binary inside of given Crashlytics path (for backwards compatibility)
11
- if path
12
- if File.basename(path) != "submit"
13
- path = Dir[File.join(path, '**', 'submit')].last
14
- UI.verbose(":crashlytics_path passed through parameters did not point to a submit binary. Using this submit binary on that path instead: '#{path}'")
15
- else
16
- UI.verbose("Using :crashlytics_path passed in through parameters: '#{path}'")
17
- end
18
- end
19
-
20
- # Check for submit binary outside of Crashlytics.framework (for Crashlytics 3.4.1 and over)
21
- path ||= Dir["./Pods/Crashlytics/submit"].first
22
-
23
- # Check for submit binary in Crashlytics.framework (for Crashlytics 3.4.1 and under)
24
- path ||= Dir["./Pods/iOS/Crashlytics/Crashlytics.framework/submit"].last
25
- path ||= Dir["./**/Crashlytics.framework/submit"].last
26
-
27
- downcase_path = path ? path.downcase : nil
28
- if downcase_path && downcase_path.include?("pods") && downcase_path.include?("crashlytics.framework")
29
- UI.deprecated("Crashlytics has moved the submit binary outside of Crashlytics.framework directory as of 3.4.1. Please change :crashlytics_path to `<PODS_ROOT>/Crashlytics/submit`")
30
- end
31
-
32
- return path
33
- end
34
-
35
- def generate_ios_command(params)
36
- submit_binary = discover_crashlytics_path(params)
37
- unless submit_binary
38
- UI.user_error!("Couldn't find Crashlytics' submit binary in current directory. Make sure to add the 'Crashlytics' pod to your 'Podfile' and run `pod update`")
39
- end
40
- if File.basename(submit_binary) != "submit"
41
- UI.user_error!("Invalid crashlytics path was detected with '#{submit_binary}'. Path must point to the `submit` binary (example: './Pods/Crashlytics/submit')")
42
- end
43
- submit_binary = "Crashlytics.framework/submit" if Helper.test?
44
-
45
- command = []
46
- command << submit_binary.shellescape
47
- command << params[:api_token]
48
- command << params[:build_secret]
49
- command << "-ipaPath '#{params[:ipa_path]}'"
50
- command << "-emails '#{params[:emails].join(',')}'" if params[:emails]
51
- command << "-notesPath '#{params[:notes_path]}'" if params[:notes_path]
52
- command << "-groupAliases '#{params[:groups].join(',')}'" if params[:groups]
53
- command << "-notifications #{(params[:notifications] ? 'YES' : 'NO')}"
54
- command << "-debug #{(params[:debug] ? 'YES' : 'NO')}"
55
-
56
- return command
57
- end
58
-
59
- def generate_android_command(params, android_manifest_path)
60
- params[:crashlytics_path] = download_android_tools unless params[:crashlytics_path]
61
-
62
- UI.user_error!("The `crashlytics_path` must be a jar file for Android") unless params[:crashlytics_path].end_with?(".jar") || Helper.test?
63
-
64
- if ENV['JAVA_HOME'].nil?
65
- command = ["java"]
66
- else
67
- command = [File.join(ENV['JAVA_HOME'], "/bin/java").shellescape]
68
- end
69
- command << "-jar #{File.expand_path(params[:crashlytics_path])}"
70
- command << "-androidRes ."
71
- command << "-apiKey #{params[:api_token]}"
72
- command << "-apiSecret #{params[:build_secret]}"
73
- command << "-uploadDist #{File.expand_path(params[:apk_path]).shellescape}"
74
- command << "-androidManifest #{File.expand_path(android_manifest_path).shellescape}"
75
-
76
- # Optional
77
- command << "-betaDistributionEmails #{params[:emails].join(',').shellescape}" if params[:emails]
78
- command << "-betaDistributionReleaseNotesFilePath #{File.expand_path(params[:notes_path]).shellescape}" if params[:notes_path]
79
- command << "-betaDistributionGroupAliases #{params[:groups].join(',').shellescape}" if params[:groups]
80
- command << "-betaDistributionNotifications #{(params[:notifications] ? 'true' : 'false')}"
81
-
82
- return command
83
- end
84
-
85
- def download_android_tools
86
- containing = File.join(File.expand_path("~/Library"), "CrashlyticsAndroid")
87
- zip_path = File.join(containing, "crashlytics-devtools.zip")
88
- jar_path = File.join(containing, "crashlytics-devtools.jar")
89
-
90
- url = "https://ssl-download-crashlytics-com.s3.amazonaws.com/android/ant/crashlytics.zip"
91
- require 'net/http'
92
-
93
- FileUtils.mkdir_p(containing)
94
-
95
- begin
96
- # Work around ruby defect, where HTTP#get_response and HTTP#post_form don't use ENV proxy settings
97
- # https://bugs.ruby-lang.org/issues/12724
98
- uri = URI(url)
99
- http_conn = Net::HTTP.new(uri.host, uri.port)
100
- http_conn.use_ssl = true
101
- result = http_conn.request_head(uri.path)
102
-
103
- # ETag is returned with quotes, which net/http does not handle. Clean that up
104
- etag = result['ETag'] && result['ETag'].tr('"', '')
105
-
106
- # This is a no-op if the current version on disk matches the file on S3
107
- return jar_path if File.exist?(zip_path) && etag == Digest::MD5.file(zip_path).hexdigest
108
-
109
- UI.important("Downloading Crashlytics Support Library - this might take a minute...")
110
- result = http_conn.request_get(uri.path)
111
- UI.error("#{result.message} (#{result.code})") unless result.kind_of?(Net::HTTPSuccess)
112
- File.write(zip_path, result.body)
113
-
114
- # Now unzip the file
115
- Action.sh("unzip -o '#{zip_path}' -d '#{containing}'")
116
-
117
- UI.user_error!("Couldn't find 'crashlytics-devtools.jar'") unless File.exist?(jar_path)
118
-
119
- UI.success("Successfully downloaded Crashlytics Support Library to '#{jar_path}'")
120
- rescue => ex
121
- UI.user_error!("Error fetching remote file: #{ex}")
122
- end
123
-
124
- return jar_path
125
- end
126
-
127
- def generate_android_manifest_tempfile
128
- # We have to generate an empty XML file to make the crashlytics CLI happy :)
129
- write_to_tempfile('<?xml version="1.0" encoding="utf-8"?><manifest></manifest>', 'xml')
130
- end
131
-
132
- def write_to_tempfile(value, tempfilename)
133
- require 'tempfile'
134
-
135
- Tempfile.new(tempfilename).tap do |t|
136
- t.write(value)
137
- t.close
138
- end
139
- end
140
- end
141
- end
142
- end
143
- end
144
-
145
- # java \
146
- # -jar ~/Desktop/crashlytics-devtools.jar \
147
- # -androidRes . \
148
- # -uploadDist /Users/fkrause/AndroidStudioProjects/AppName/app/build/outputs/apk/app-release.apk \
149
- # -androidManifest /Users/fkrause/Downloads/manifest.xml \
150
- # -apiKey api_key \
151
- # -apiSecret secret_key \
152
-
153
- # -betaDistributionReleaseNotes "Yeah" \
154
- # -betaDistributionEmails "something11@krausefx.com" \
155
- # -betaDistributionGroupAliases "testgroup" \
156
- # -betaDistributionNotifications false
157
- # -projectPath . \