fastlane 2.193.0 → 2.196.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +86 -86
  3. data/cert/lib/cert/options.rb +1 -1
  4. data/deliver/lib/deliver/options.rb +1 -1
  5. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +13 -7
  6. data/fastlane/lib/fastlane/actions/gradle.rb +16 -3
  7. data/fastlane/lib/fastlane/actions/last_git_commit.rb +1 -1
  8. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +3 -4
  9. data/fastlane/lib/fastlane/actions/notarize.rb +27 -18
  10. data/fastlane/lib/fastlane/actions/prompt.rb +1 -1
  11. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  12. data/fastlane/lib/fastlane/actions/register_devices.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/set_changelog.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/slather.rb +6 -0
  15. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +11 -5
  16. data/fastlane/lib/fastlane/version.rb +1 -1
  17. data/fastlane/swift/Deliverfile.swift +1 -1
  18. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  19. data/fastlane/swift/Fastlane.swift +79 -100
  20. data/fastlane/swift/Gymfile.swift +1 -1
  21. data/fastlane/swift/GymfileProtocol.swift +1 -1
  22. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  23. data/fastlane/swift/Matchfile.swift +1 -1
  24. data/fastlane/swift/MatchfileProtocol.swift +11 -3
  25. data/fastlane/swift/Precheckfile.swift +1 -1
  26. data/fastlane/swift/PrecheckfileProtocol.swift +2 -2
  27. data/fastlane/swift/Runner.swift +1 -1
  28. data/fastlane/swift/Scanfile.swift +1 -1
  29. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  30. data/fastlane/swift/Screengrabfile.swift +1 -1
  31. data/fastlane/swift/ScreengrabfileProtocol.swift +3 -3
  32. data/fastlane/swift/Snapshotfile.swift +1 -1
  33. data/fastlane/swift/SnapshotfileProtocol.swift +2 -2
  34. data/fastlane/swift/formatting/Brewfile.lock.json +17 -17
  35. data/fastlane_core/lib/fastlane_core/build_watcher.rb +1 -1
  36. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +5 -0
  37. data/match/lib/match/generator.rb +2 -1
  38. data/match/lib/match/options.rb +12 -2
  39. data/match/lib/match/runner.rb +95 -10
  40. data/pem/lib/pem/manager.rb +2 -1
  41. data/pem/lib/pem/options.rb +1 -1
  42. data/pilot/lib/pilot/options.rb +1 -1
  43. data/precheck/lib/precheck/options.rb +1 -1
  44. data/screengrab/lib/screengrab/options.rb +2 -2
  45. data/sigh/lib/assets/resign.sh +9 -6
  46. data/sigh/lib/sigh/options.rb +6 -1
  47. data/sigh/lib/sigh/runner.rb +2 -2
  48. data/snapshot/lib/snapshot/options.rb +1 -1
  49. data/snapshot/lib/snapshot/reports_generator.rb +8 -0
  50. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +9 -1
  51. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +1 -1
  52. data/spaceship/lib/spaceship/connect_api/token.rb +1 -1
  53. data/supply/lib/supply/client.rb +3 -3
  54. data/supply/lib/supply/uploader.rb +10 -7
  55. metadata +39 -39
  56. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -207
  57. data/fastlane/lib/fastlane/helper/crashlytics_helper.rb +0 -157
  58. data/match/lib/match/storage/.git_storage.rb.swp +0 -0
  59. data/match/lib/match/storage/.interface.rb.swp +0 -0
@@ -84,6 +84,10 @@ module Snapshot
84
84
  {
85
85
  # snapshot in Xcode 9 saves screenshots with the SIMULATOR_DEVICE_NAME
86
86
  # which includes spaces
87
+ 'iPhone 13 Pro Max' => "iPhone 13 Pro Max",
88
+ 'iPhone 13 Pro' => "iPhone 13 Pro",
89
+ 'iPhone 13 mini' => "iPhone 13 mini",
90
+ 'iPhone 13' => "iPhone 13",
87
91
  'iPhone 12 Pro Max' => "iPhone 12 Pro Max",
88
92
  'iPhone 12 Pro' => "iPhone 12 Pro",
89
93
  'iPhone 12 mini' => "iPhone 12 mini",
@@ -113,6 +117,10 @@ module Snapshot
113
117
  'iPad Air' => 'iPad Air',
114
118
  'iPad (5th generation)' => 'iPad (5th generation)',
115
119
  'iPad (7th generation)' => 'iPad (7th generation)',
120
+ 'iPad mini 2' => 'iPad mini 2',
121
+ 'iPad mini 3' => 'iPad mini 3',
122
+ 'iPad mini 4' => 'iPad mini 4',
123
+ 'iPad mini (6th generation)' => 'iPad mini (6th generation)',
116
124
  'iPad Pro (9.7-inch)' => 'iPad Pro (9.7-inch)',
117
125
  'iPad Pro (9.7 inch)' => 'iPad Pro (9.7-inch)', # iOS 10.3.1 simulator
118
126
  'iPad Pro (10.5-inch)' => 'iPad Pro (10.5-inch)',
@@ -116,7 +116,15 @@ module Snapshot
116
116
  device_udid = TestCommandGenerator.device_udid(device_type)
117
117
 
118
118
  UI.message("Launch Simulator #{device_type}")
119
- Helper.backticks("xcrun instruments -w #{device_udid} &> /dev/null")
119
+ # Boot the simulator and wait for it to finish booting
120
+ Helper.backticks("xcrun simctl bootstatus #{device_udid} -b &> /dev/null")
121
+
122
+ # "Booted" status is not enough for to adjust the status bar
123
+ # Simulator could stil be booting with Apple logo
124
+ # Need to wait "some amount of time" until home screen shows
125
+ boot_sleep = ENV["SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT"].to_i || 10
126
+ UI.message("Waiting #{boot_sleep} seconds for device to fully boot before overriding status bar... Set 'SNAPSHOT_SIMULATOR_WAIT_FOR_BOOT_TIMEOUT' environemnt variable to adjust timeout")
127
+ sleep(boot_sleep) if boot_sleep > 0
120
128
 
121
129
  UI.message("Overriding Status Bar")
122
130
 
@@ -112,7 +112,7 @@ module Spaceship
112
112
 
113
113
  # @deprecated
114
114
  def fetch_age_rating_declaration(client: nil)
115
- raise 'AppStoreVersion no longer as AgeRatingDelcaration as of App Store Connect API 1.3 - Use AppInfo instead'
115
+ raise 'AppStoreVersion no longer as AgeRatingDeclaration as of App Store Connect API 1.3 - Use AppInfo instead'
116
116
  end
117
117
 
118
118
  #
@@ -29,7 +29,7 @@ module Spaceship
29
29
  attr_accessor :in_house
30
30
 
31
31
  def self.from(hash: nil, filepath: nil)
32
- api_token ||= self.create(**hash) if hash
32
+ api_token ||= self.create(**hash.transform_keys(&:to_sym)) if hash
33
33
  api_token ||= self.from_json_file(filepath) if filepath
34
34
  return api_token
35
35
  end
@@ -286,10 +286,10 @@ module Supply
286
286
 
287
287
  filtered_release = filtered_track.releases.first { |r| !r.name.nil? && r.name == version }
288
288
 
289
- # Since we can release on Alpha/Beta without release notes.
289
+ # Since we can release on Internal/Alpha/Beta without release notes.
290
290
  if filtered_release.release_notes.nil?
291
- UI.user_error!("Version '#{version}' for '#{current_package_name}' does not seem to have any release notes. Nothing to download.")
292
- return nil
291
+ UI.message("Version '#{version}' for '#{current_package_name}' does not seem to have any release notes. Nothing to download.")
292
+ return []
293
293
  end
294
294
 
295
295
  return filtered_release.release_notes.map do |row|
@@ -13,6 +13,8 @@ module Supply
13
13
  apk_version_codes.concat(upload_bundles) unless Supply.config[:skip_upload_aab]
14
14
  upload_mapping(apk_version_codes)
15
15
 
16
+ track_to_update = Supply.config[:track]
17
+
16
18
  apk_version_codes.concat(Supply.config[:version_codes_to_retain]) if Supply.config[:version_codes_to_retain]
17
19
 
18
20
  if !apk_version_codes.empty?
@@ -23,13 +25,14 @@ module Supply
23
25
  else
24
26
  # Only promote or rollout if we don't have version codes
25
27
  if Supply.config[:track_promote_to]
28
+ track_to_update = Supply.config[:track_promote_to]
26
29
  promote_track
27
30
  elsif !Supply.config[:rollout].nil? && Supply.config[:track].to_s != ""
28
31
  update_rollout
29
32
  end
30
33
  end
31
34
 
32
- perform_upload_meta(apk_version_codes)
35
+ perform_upload_meta(apk_version_codes, track_to_update)
33
36
 
34
37
  if Supply.config[:validate_only]
35
38
  UI.message("Validating all changes with Google Play...")
@@ -70,7 +73,7 @@ module Supply
70
73
  end
71
74
  end
72
75
 
73
- def perform_upload_meta(version_codes)
76
+ def perform_upload_meta(version_codes, track_name)
74
77
  if (!Supply.config[:skip_upload_metadata] || !Supply.config[:skip_upload_images] || !Supply.config[:skip_upload_changelogs] || !Supply.config[:skip_upload_screenshots]) && metadata_path
75
78
  # Use version code from config if version codes is empty and no nil or empty string
76
79
  version_codes = [Supply.config[:version_code]] if version_codes.empty?
@@ -81,7 +84,7 @@ module Supply
81
84
  version_codes.each do |version_code|
82
85
  UI.user_error!("Could not find folder #{metadata_path}") unless File.directory?(metadata_path)
83
86
 
84
- track, release = fetch_track_and_release!(Supply.config[:track], version_code)
87
+ track, release = fetch_track_and_release!(track_name, version_code)
85
88
  UI.user_error!("Unable to find the requested track - '#{Supply.config[:track]}'") unless track
86
89
  UI.user_error!("Could not find release for version code '#{version_code}' to update changelog") unless release
87
90
 
@@ -98,7 +101,7 @@ module Supply
98
101
  release_notes << upload_changelog(language, version_code) unless Supply.config[:skip_upload_changelogs]
99
102
  end
100
103
 
101
- upload_changelogs(release_notes, release, track) unless release_notes.empty?
104
+ upload_changelogs(release_notes, release, track, track_name) unless release_notes.empty?
102
105
  end
103
106
  end
104
107
  end
@@ -144,7 +147,7 @@ module Supply
144
147
  end
145
148
 
146
149
  def verify_config!
147
- unless metadata_path || Supply.config[:apk] || Supply.config[:apk_paths] || Supply.config[:aab] || Supply.config[:aab_paths] || (Supply.config[:track] && Supply.config[:track_promote_to])
150
+ unless metadata_path || Supply.config[:apk] || Supply.config[:apk_paths] || Supply.config[:aab] || Supply.config[:aab_paths] || (Supply.config[:track] && Supply.config[:track_promote_to]) || (Supply.config[:track] && Supply.config[:rollout])
148
151
  UI.user_error!("No local metadata, apks, aab, or track to promote were found, make sure to run `fastlane supply init` to setup supply")
149
152
  end
150
153
 
@@ -239,9 +242,9 @@ module Supply
239
242
  )
240
243
  end
241
244
 
242
- def upload_changelogs(release_notes, release, track)
245
+ def upload_changelogs(release_notes, release, track, track_name)
243
246
  release.release_notes = release_notes
244
- client.upload_changelogs(track, Supply.config[:track])
247
+ client.upload_changelogs(track, track_name)
245
248
  end
246
249
 
247
250
  def upload_metadata(language, listing)
metadata CHANGED
@@ -1,38 +1,38 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.193.0
4
+ version: 2.196.0
5
5
  platform: ruby
6
6
  authors:
7
- - Jimmy Dee
8
- - Aaron Brager
9
- - Fumiya Nakamura
10
- - Manish Rathi
11
- - Olivier Halligon
12
- - Josh Holtz
13
- - Andrew McBurney
14
- - Danielle Tomlinson
15
- - Jorge Revuelta H
7
+ - Max Ott
8
+ - Jérôme Lacoste
16
9
  - Luka Mirosevic
17
- - Iulian Onofrei
18
- - Matthew Ellis
19
- - Helmut Januschka
20
- - Jan Piotrowski
21
10
  - Daniel Jankowski
22
- - Joshua Liebowitz
23
- - Manu Wallner
24
- - Jérôme Lacoste
25
- - Max Ott
26
- - Felix Krause
27
- - Stefan Natchev
28
11
  - Satoshi Namai
29
- - Maksym Grebenets
12
+ - Matthew Ellis
13
+ - Jan Piotrowski
14
+ - Andrew McBurney
15
+ - Iulian Onofrei
16
+ - Manish Rathi
30
17
  - Kohki Miki
18
+ - Danielle Tomlinson
31
19
  - Roger Oba
20
+ - Fumiya Nakamura
21
+ - Felix Krause
22
+ - Aaron Brager
23
+ - Jimmy Dee
24
+ - Helmut Januschka
25
+ - Jorge Revuelta H
26
+ - Olivier Halligon
27
+ - Josh Holtz
28
+ - Manu Wallner
29
+ - Joshua Liebowitz
30
+ - Maksym Grebenets
31
+ - Stefan Natchev
32
32
  autorequire:
33
33
  bindir: bin
34
34
  cert_chain: []
35
- date: 2021-08-31 00:00:00.000000000 Z
35
+ date: 2021-10-14 00:00:00.000000000 Z
36
36
  dependencies:
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: xcodeproj
@@ -1056,7 +1056,6 @@ files:
1056
1056
  - fastlane/lib/fastlane/actions/commit_github_file.rb
1057
1057
  - fastlane/lib/fastlane/actions/commit_version_bump.rb
1058
1058
  - fastlane/lib/fastlane/actions/copy_artifacts.rb
1059
- - fastlane/lib/fastlane/actions/crashlytics.rb
1060
1059
  - fastlane/lib/fastlane/actions/create_app_on_managed_play_store.rb
1061
1060
  - fastlane/lib/fastlane/actions/create_app_online.rb
1062
1061
  - fastlane/lib/fastlane/actions/create_keychain.rb
@@ -1278,7 +1277,6 @@ files:
1278
1277
  - fastlane/lib/fastlane/features.rb
1279
1278
  - fastlane/lib/fastlane/helper/README.md
1280
1279
  - fastlane/lib/fastlane/helper/adb_helper.rb
1281
- - fastlane/lib/fastlane/helper/crashlytics_helper.rb
1282
1280
  - fastlane/lib/fastlane/helper/dotenv_helper.rb
1283
1281
  - fastlane/lib/fastlane/helper/gem_helper.rb
1284
1282
  - fastlane/lib/fastlane/helper/git_helper.rb
@@ -1509,8 +1507,6 @@ files:
1509
1507
  - match/lib/match/setup.rb
1510
1508
  - match/lib/match/spaceship_ensure.rb
1511
1509
  - match/lib/match/storage.rb
1512
- - match/lib/match/storage/.git_storage.rb.swp
1513
- - match/lib/match/storage/.interface.rb.swp
1514
1510
  - match/lib/match/storage/git_storage.rb
1515
1511
  - match/lib/match/storage/google_cloud_storage.rb
1516
1512
  - match/lib/match/storage/interface.rb
@@ -1843,28 +1839,32 @@ homepage: https://fastlane.tools
1843
1839
  licenses:
1844
1840
  - MIT
1845
1841
  metadata:
1846
- docs_url: https://docs.fastlane.tools
1842
+ bug_tracker_uri: https://github.com/fastlane/fastlane/issues
1843
+ changelog_uri: https://github.com/fastlane/fastlane/releases
1844
+ documentation_uri: https://docs.fastlane.tools/
1845
+ homepage_uri: https://fastlane.tools
1846
+ source_code_uri: https://github.com/fastlane/fastlane
1847
1847
  post_install_message:
1848
1848
  rdoc_options: []
1849
1849
  require_paths:
1850
+ - cert/lib
1850
1851
  - credentials_manager/lib
1851
- - pem/lib
1852
- - snapshot/lib
1853
- - frameit/lib
1854
- - match/lib
1855
- - fastlane_core/lib
1856
1852
  - deliver/lib
1857
- - scan/lib
1858
- - supply/lib
1859
- - cert/lib
1860
1853
  - fastlane/lib
1861
- - spaceship/lib
1862
- - pilot/lib
1854
+ - fastlane_core/lib
1855
+ - frameit/lib
1863
1856
  - gym/lib
1857
+ - match/lib
1858
+ - pem/lib
1859
+ - pilot/lib
1864
1860
  - precheck/lib
1861
+ - produce/lib
1862
+ - scan/lib
1865
1863
  - screengrab/lib
1866
1864
  - sigh/lib
1867
- - produce/lib
1865
+ - snapshot/lib
1866
+ - spaceship/lib
1867
+ - supply/lib
1868
1868
  required_ruby_version: !ruby/object:Gem::Requirement
1869
1869
  requirements:
1870
1870
  - - ">="
@@ -1876,7 +1876,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1876
1876
  - !ruby/object:Gem::Version
1877
1877
  version: '0'
1878
1878
  requirements: []
1879
- rubygems_version: 3.1.4
1879
+ rubygems_version: 3.2.3
1880
1880
  signing_key:
1881
1881
  specification_version: 4
1882
1882
  summary: The easiest way to automate beta deployments and releases for your iOS and
@@ -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 . \