fastlane 1.68.0 → 1.69.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/lib/assets/DefaultFastfileTemplate +3 -6
  3. data/lib/assets/FastfileTemplateAndroid +3 -5
  4. data/lib/assets/custom_action_template.rb +2 -2
  5. data/lib/fastlane/action.rb +1 -1
  6. data/lib/fastlane/actions/actions_helper.rb +2 -2
  7. data/lib/fastlane/actions/appaloosa.rb +1 -1
  8. data/lib/fastlane/actions/appetize.rb +70 -51
  9. data/lib/fastlane/actions/appium.rb +3 -3
  10. data/lib/fastlane/actions/appledoc.rb +1 -1
  11. data/lib/fastlane/actions/backup_xcarchive.rb +2 -2
  12. data/lib/fastlane/actions/badge.rb +8 -8
  13. data/lib/fastlane/actions/carthage.rb +22 -9
  14. data/lib/fastlane/actions/changelog_from_git_commits.rb +4 -4
  15. data/lib/fastlane/actions/chatwork.rb +2 -2
  16. data/lib/fastlane/actions/clean_cocoapods_cache.rb +1 -1
  17. data/lib/fastlane/actions/cocoapods.rb +1 -1
  18. data/lib/fastlane/actions/commit_version_bump.rb +6 -6
  19. data/lib/fastlane/actions/crashlytics.rb +7 -7
  20. data/lib/fastlane/actions/default_platform.rb +1 -1
  21. data/lib/fastlane/actions/deploygate.rb +19 -6
  22. data/lib/fastlane/actions/dotgpg_environment.rb +1 -1
  23. data/lib/fastlane/actions/download.rb +1 -1
  24. data/lib/fastlane/actions/download_dsyms.rb +31 -2
  25. data/lib/fastlane/actions/dsym_zip.rb +1 -1
  26. data/lib/fastlane/actions/ensure_git_branch.rb +1 -1
  27. data/lib/fastlane/actions/ensure_no_debug_code.rb +2 -2
  28. data/lib/fastlane/actions/ensure_xcode_version.rb +1 -1
  29. data/lib/fastlane/actions/fastlane_version.rb +2 -2
  30. data/lib/fastlane/actions/frameit.rb +1 -1
  31. data/lib/fastlane/actions/gcovr.rb +1 -1
  32. data/lib/fastlane/actions/get_build_number.rb +2 -2
  33. data/lib/fastlane/actions/get_build_number_repository.rb +1 -1
  34. data/lib/fastlane/actions/get_github_release.rb +3 -3
  35. data/lib/fastlane/actions/get_info_plist_value.rb +1 -1
  36. data/lib/fastlane/actions/get_version_number.rb +2 -2
  37. data/lib/fastlane/actions/git_add.rb +2 -2
  38. data/lib/fastlane/actions/git_commit.rb +2 -2
  39. data/lib/fastlane/actions/git_pull.rb +1 -1
  40. data/lib/fastlane/actions/gradle.rb +1 -1
  41. data/lib/fastlane/actions/hg_commit_version_bump.rb +7 -7
  42. data/lib/fastlane/actions/hipchat.rb +7 -7
  43. data/lib/fastlane/actions/hockey.rb +8 -8
  44. data/lib/fastlane/actions/increment_build_number.rb +2 -2
  45. data/lib/fastlane/actions/increment_version_number.rb +4 -4
  46. data/lib/fastlane/actions/install_on_device.rb +3 -3
  47. data/lib/fastlane/actions/install_xcode_plugin.rb +2 -2
  48. data/lib/fastlane/actions/installr.rb +3 -3
  49. data/lib/fastlane/actions/ipa.rb +1 -1
  50. data/lib/fastlane/actions/latest_testflight_build_number.rb +1 -1
  51. data/lib/fastlane/actions/lcov.rb +1 -1
  52. data/lib/fastlane/actions/nexus_upload.rb +1 -1
  53. data/lib/fastlane/actions/number_of_commits.rb +1 -1
  54. data/lib/fastlane/actions/oclint.rb +2 -2
  55. data/lib/fastlane/actions/onesignal.rb +3 -3
  56. data/lib/fastlane/actions/pod_push.rb +3 -3
  57. data/lib/fastlane/actions/podio_item.rb +11 -11
  58. data/lib/fastlane/actions/read_podspec.rb +1 -1
  59. data/lib/fastlane/actions/register_devices.rb +6 -6
  60. data/lib/fastlane/actions/reset_git_repo.rb +1 -1
  61. data/lib/fastlane/actions/resign.rb +3 -3
  62. data/lib/fastlane/actions/restore_file.rb +1 -1
  63. data/lib/fastlane/actions/s3.rb +4 -4
  64. data/lib/fastlane/actions/say.rb +1 -1
  65. data/lib/fastlane/actions/set_github_release.rb +10 -10
  66. data/lib/fastlane/actions/set_info_plist_value.rb +1 -1
  67. data/lib/fastlane/actions/slack.rb +2 -2
  68. data/lib/fastlane/actions/slather.rb +1 -1
  69. data/lib/fastlane/actions/sonar.rb +2 -2
  70. data/lib/fastlane/actions/splunkmint.rb +3 -3
  71. data/lib/fastlane/actions/ssh.rb +1 -1
  72. data/lib/fastlane/actions/supply.rb +6 -1
  73. data/lib/fastlane/actions/swiftlint.rb +3 -3
  74. data/lib/fastlane/actions/team_id.rb +1 -1
  75. data/lib/fastlane/actions/team_name.rb +1 -1
  76. data/lib/fastlane/actions/testfairy.rb +3 -3
  77. data/lib/fastlane/actions/testmunk.rb +5 -5
  78. data/lib/fastlane/actions/tryouts.rb +6 -6
  79. data/lib/fastlane/actions/typetalk.rb +2 -2
  80. data/lib/fastlane/actions/unlock_keychain.rb +1 -1
  81. data/lib/fastlane/actions/update_app_group_identifiers.rb +6 -6
  82. data/lib/fastlane/actions/update_app_identifier.rb +6 -6
  83. data/lib/fastlane/actions/update_info_plist.rb +4 -4
  84. data/lib/fastlane/actions/update_project_code_signing.rb +2 -2
  85. data/lib/fastlane/actions/update_project_provisioning.rb +4 -4
  86. data/lib/fastlane/actions/update_project_team.rb +2 -2
  87. data/lib/fastlane/actions/update_url_schemes.rb +1 -1
  88. data/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -0
  89. data/lib/fastlane/actions/upload_symbols_to_sentry.rb +3 -3
  90. data/lib/fastlane/actions/verify_build.rb +13 -13
  91. data/lib/fastlane/actions/verify_xcode.rb +2 -2
  92. data/lib/fastlane/actions/version_bump_podspec.rb +3 -3
  93. data/lib/fastlane/actions/version_get_podspec.rb +2 -2
  94. data/lib/fastlane/actions/xcode_install.rb +1 -1
  95. data/lib/fastlane/actions/xcode_select.rb +2 -2
  96. data/lib/fastlane/actions/xcode_server_get_assets.rb +10 -10
  97. data/lib/fastlane/actions/xcodebuild.rb +2 -2
  98. data/lib/fastlane/actions/xctool.rb +1 -1
  99. data/lib/fastlane/actions/zip.rb +58 -0
  100. data/lib/fastlane/command_line_handler.rb +1 -1
  101. data/lib/fastlane/documentation/actions_list.rb +1 -1
  102. data/lib/fastlane/erb_template_helper.rb +1 -1
  103. data/lib/fastlane/helper/crashlytics_helper.rb +5 -5
  104. data/lib/fastlane/helper/git_helper.rb +2 -1
  105. data/lib/fastlane/helper/gradle_helper.rb +0 -2
  106. data/lib/fastlane/helper/podspec_helper.rb +2 -2
  107. data/lib/fastlane/lane_manager.rb +3 -3
  108. data/lib/fastlane/one_off.rb +3 -3
  109. data/lib/fastlane/runner.rb +7 -7
  110. data/lib/fastlane/setup/setup.rb +1 -2
  111. data/lib/fastlane/supported_platforms.rb +1 -1
  112. data/lib/fastlane/version.rb +1 -1
  113. metadata +20 -5
@@ -42,7 +42,7 @@ module Fastlane
42
42
  description: "Path to the podspec to be read",
43
43
  default_value: Dir['*.podspec*'].first,
44
44
  verify_block: proc do |value|
45
- raise "File #{value} not found".red unless File.exist?(value)
45
+ UI.user_error!("File #{value} not found") unless File.exist?(value)
46
46
  end)
47
47
  ]
48
48
  end
@@ -22,14 +22,14 @@ module Fastlane
22
22
 
23
23
  if devices
24
24
  device_objs = devices.map do |k, v|
25
- raise "Passed invalid UDID: #{v} for device: #{k}".red unless UDID_REGEXP =~ v
25
+ UI.user_error!("Passed invalid UDID: #{v} for device: #{k}") unless UDID_REGEXP =~ v
26
26
  Spaceship::Device.create!(name: k, udid: v)
27
27
  end
28
28
  elsif devices_file
29
29
  require 'csv'
30
30
 
31
31
  devices_file = CSV.read(File.expand_path(File.join(devices_file)), col_sep: "\t")
32
- raise 'Please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)'.red unless devices_file.first == ['Device ID', 'Device Name']
32
+ UI.user_error!("Please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)") unless devices_file.first == ['Device ID', 'Device Name']
33
33
 
34
34
  UI.message("Fetching list of currently registered devices...")
35
35
  existing_devices = Spaceship::Device.all
@@ -37,13 +37,13 @@ module Fastlane
37
37
  device_objs = devices_file.drop(1).map do |device|
38
38
  next if existing_devices.map(&:udid).include?(device[0])
39
39
 
40
- raise 'Invalid device line, please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)'.red unless device.count == 2
41
- raise "Passed invalid UDID: #{device[0]} for device: #{device[1]}".red unless UDID_REGEXP =~ device[0]
40
+ UI.user_error!("Invalid device line, please provide a file according to the Apple Sample UDID file (https://devimages.apple.com.edgekey.net/downloads/devices/Multiple-Upload-Samples.zip)") unless device.count == 2
41
+ UI.user_error!("Passed invalid UDID: #{device[0]} for device: #{device[1]}") unless UDID_REGEXP =~ device[0]
42
42
 
43
43
  Spaceship::Device.create!(name: device[1], udid: device[0])
44
44
  end
45
45
  else
46
- raise 'You must pass either a valid `devices` or `devices_file`. Please check the readme.'.red
46
+ UI.user_error!("You must pass either a valid `devices` or `devices_file`. Please check the readme.")
47
47
  end
48
48
 
49
49
  UI.success("Successfully registered new devices.")
@@ -69,7 +69,7 @@ module Fastlane
69
69
  description: "Provide a path to the devices to register",
70
70
  optional: true,
71
71
  verify_block: proc do |value|
72
- raise "Could not find file '#{value}'".red unless File.exist?(value)
72
+ UI.user_error!("Could not find file '#{value}'") unless File.exist?(value)
73
73
  end),
74
74
  FastlaneCore::ConfigItem.new(key: :team_id,
75
75
  env_name: "FASTLANE_TEAM_ID",
@@ -61,7 +61,7 @@ module Fastlane
61
61
  optional: true,
62
62
  is_string: false,
63
63
  verify_block: proc do |value|
64
- raise "Please pass an array only" unless value.kind_of? Array
64
+ UI.user_error!("Please pass an array only") unless value.kind_of? Array
65
65
  end),
66
66
  FastlaneCore::ConfigItem.new(key: :force,
67
67
  env_name: "FL_RESET_GIT_FORCE",
@@ -9,7 +9,7 @@ module Fastlane
9
9
  if Sigh::Resign.resign(params[:ipa], params[:signing_identity], params[:provisioning_profile], params[:entitlements], params[:version], params[:display_name])
10
10
  UI.success('Successfully re-signed .ipa 🔏.')
11
11
  else
12
- raise 'Failed to re-sign .ipa'.red
12
+ UI.user_error!("Failed to re-sign .ipa")
13
13
  end
14
14
  end
15
15
 
@@ -38,7 +38,7 @@ module Fastlane
38
38
  description: "Path to the ipa file to resign. Optional if you use the `gym` or `xcodebuild` action",
39
39
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
40
40
  verify_block: proc do |value|
41
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
41
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
42
42
  end),
43
43
  FastlaneCore::ConfigItem.new(key: :signing_identity,
44
44
  env_name: "FL_RESIGN_SIGNING_IDENTITY",
@@ -60,7 +60,7 @@ module Fastlane
60
60
  else [value]
61
61
  end
62
62
  files.each do |file|
63
- raise "Couldn't find provisiong profile at path '#{file}'".red unless File.exist?(file)
63
+ UI.user_error!("Couldn't find provisiong profile at path '#{file}'") unless File.exist?(file)
64
64
  end
65
65
  end),
66
66
  FastlaneCore::ConfigItem.new(key: :version,
@@ -4,7 +4,7 @@ module Fastlane
4
4
  def self.run(params)
5
5
  path = params[:path]
6
6
  backup_path = "#{path}.back"
7
- raise "Could not find file '#{backup_path}'" unless File.exist? backup_path
7
+ UI.user_error!("Could not find file '#{backup_path}'") unless File.exist? backup_path
8
8
  FileUtils.cp(backup_path, path, {preserve: true})
9
9
  FileUtils.rm(backup_path)
10
10
  UI.message("Successfully restored backup 📤")
@@ -54,10 +54,10 @@ module Fastlane
54
54
  dsym_file = params[:dsym]
55
55
  s3_path = params[:path]
56
56
 
57
- raise "No S3 access key given, pass using `access_key: 'key'`".red unless s3_access_key.to_s.length > 0
58
- raise "No S3 secret access key given, pass using `secret_access_key: 'secret key'`".red unless s3_secret_access_key.to_s.length > 0
59
- raise "No S3 bucket given, pass using `bucket: 'bucket'`".red unless s3_bucket.to_s.length > 0
60
- raise "No IPA file path given, pass using `ipa: 'ipa path'`".red unless ipa_file.to_s.length > 0
57
+ UI.user_error!("No S3 access key given, pass using `access_key: 'key'`") unless s3_access_key.to_s.length > 0
58
+ UI.user_error!("No S3 secret access key given, pass using `secret_access_key: 'secret key'`") unless s3_secret_access_key.to_s.length > 0
59
+ UI.user_error!("No S3 bucket given, pass using `bucket: 'bucket'`") unless s3_bucket.to_s.length > 0
60
+ UI.user_error!("No IPA file path given, pass using `ipa: 'ipa path'`") unless ipa_file.to_s.length > 0
61
61
 
62
62
  plist_template_path = params[:plist_template_path]
63
63
  html_template_path = params[:html_template_path]
@@ -4,7 +4,7 @@ module Fastlane
4
4
  def self.run(params)
5
5
  text = params.join(' ') if params.kind_of?(Array) # that's usually the case
6
6
  text = params if params.kind_of?(String)
7
- raise "You can't call the `say` action as OneOff" unless text
7
+ UI.user_error!("You can't call the `say` action as OneOff") unless text
8
8
  text = text.tr("'", '"')
9
9
 
10
10
  Actions.sh("say '#{text}'")
@@ -52,7 +52,7 @@ module Fastlane
52
52
  get_response = self.call_releases_endpoint("get", server_url, repo_name, "/releases/#{release_id}", api_token, nil)
53
53
  if get_response[:status] != 200
54
54
  UI.error("GitHub responded with #{response[:status]}:#{response[:body]}")
55
- raise "Failed to fetch the newly created release, but it *has been created* successfully.".red
55
+ UI.user_error!("Failed to fetch the newly created release, but it *has been created* successfully.")
56
56
  end
57
57
 
58
58
  get_body = JSON.parse(get_response.body)
@@ -67,10 +67,10 @@ module Fastlane
67
67
  UI.error("Release on tag #{params[:tag_name]} already exists!")
68
68
  when 404
69
69
  UI.error(response.body)
70
- raise "Repository #{params[:repository_name]} cannot be found, please double check its name and that you provided a valid API token (if it's a private repository).".red
70
+ UI.user_error!("Repository #{params[:repository_name]} cannot be found, please double check its name and that you provided a valid API token (if it's a private repository).")
71
71
  when 401
72
72
  UI.error(response.body)
73
- raise "You are not authorized to access #{params[:repository_name]}, please make sure you provided a valid API token.".red
73
+ UI.user_error!("You are not authorized to access #{params[:repository_name]}, please make sure you provided a valid API token.")
74
74
  else
75
75
  if response[:status] != 200
76
76
  UI.error("GitHub responded with #{response[:status]}:#{response[:body]}")
@@ -90,7 +90,7 @@ module Fastlane
90
90
  absolute_path = File.absolute_path(asset_path)
91
91
 
92
92
  # check that the asset even exists
93
- raise "Asset #{absolute_path} doesn't exist" unless File.exist?(absolute_path)
93
+ UI.user_error!("Asset #{absolute_path} doesn't exist") unless File.exist?(absolute_path)
94
94
 
95
95
  name = File.basename(absolute_path)
96
96
  response = nil
@@ -124,7 +124,7 @@ module Fastlane
124
124
  UI.success("Successfully uploaded #{name}.")
125
125
  else
126
126
  UI.error("GitHub responded with #{response[:status]}:#{response[:body]}")
127
- raise "Failed to upload asset #{name} to GitHub."
127
+ UI.user_error!("Failed to upload asset #{name} to GitHub.")
128
128
  end
129
129
  end
130
130
 
@@ -136,7 +136,7 @@ module Fastlane
136
136
  when "get"
137
137
  response = Excon.get(url, headers: headers, body: body)
138
138
  else
139
- raise "Unsupported method #{method}"
139
+ UI.user_error!("Unsupported method #{method}")
140
140
  end
141
141
  return response
142
142
  end
@@ -175,8 +175,8 @@ module Fastlane
175
175
  env_name: "FL_SET_GITHUB_RELEASE_REPOSITORY_NAME",
176
176
  description: "The path to your repo, e.g. 'fastlane/fastlane'",
177
177
  verify_block: proc do |value|
178
- raise "Please only pass the path, e.g. 'fastlane/fastlane'".red if value.include? "github.com"
179
- raise "Please only pass the path, e.g. 'fastlane/fastlane'".red if value.split('/').count != 2
178
+ UI.user_error!("Please only pass the path, e.g. 'fastlane/fastlane'") if value.include? "github.com"
179
+ UI.user_error!("Please only pass the path, e.g. 'fastlane/fastlane'") if value.split('/').count != 2
180
180
  end),
181
181
  FastlaneCore::ConfigItem.new(key: :server_url,
182
182
  env_name: "FL_GITHUB_RELEASE_SERVER_URL",
@@ -184,7 +184,7 @@ module Fastlane
184
184
  default_value: "https://api.github.com",
185
185
  optional: true,
186
186
  verify_block: proc do |value|
187
- raise "Please include the protocol in the server url, e.g. https://your.github.server/api/v3".red unless value.include? "//"
187
+ UI.user_error!("Please include the protocol in the server url, e.g. https://your.github.server/api/v3") unless value.include? "//"
188
188
  end),
189
189
  FastlaneCore::ConfigItem.new(key: :api_token,
190
190
  env_name: "FL_GITHUB_RELEASE_API_TOKEN",
@@ -230,7 +230,7 @@ module Fastlane
230
230
  optional: true,
231
231
  is_string: false,
232
232
  verify_block: proc do |value|
233
- raise "upload_assets must be an Array of paths to assets" unless value.kind_of? Array
233
+ UI.user_error!("upload_assets must be an Array of paths to assets") unless value.kind_of? Array
234
234
  end)
235
235
  ]
236
236
  end
@@ -40,7 +40,7 @@ module Fastlane
40
40
  description: "Path to plist file you want to update",
41
41
  optional: false,
42
42
  verify_block: proc do |value|
43
- raise "Couldn't find plist file at path '#{value}'".red unless File.exist?(value)
43
+ UI.user_error!("Couldn't find plist file at path '#{value}'") unless File.exist?(value)
44
44
  end)
45
45
  ]
46
46
  end
@@ -47,7 +47,7 @@ module Fastlane
47
47
  UI.success('Successfully sent Slack notification')
48
48
  else
49
49
  UI.verbose(result)
50
- raise 'Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile.'.red
50
+ UI.user_error!("Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile.")
51
51
  end
52
52
  end
53
53
 
@@ -75,7 +75,7 @@ module Fastlane
75
75
  env_name: "SLACK_URL",
76
76
  description: "Create an Incoming WebHook for your Slack group",
77
77
  verify_block: proc do |value|
78
- raise "Invalid URL, must start with https://" unless value.start_with? "https://"
78
+ UI.user_error!("Invalid URL, must start with https://") unless value.start_with? "https://"
79
79
  end),
80
80
  FastlaneCore::ConfigItem.new(key: :username,
81
81
  env_name: "FL_SLACK_USERNAME",
@@ -89,7 +89,7 @@ Slather is available at https://github.com/venmo/slather
89
89
  env_name: "FL_SLATHER_PROJ", # The name of the environment variable
90
90
  description: "The project file that slather looks at", # a short description of this parameter
91
91
  verify_block: proc do |value|
92
- raise "No project file specified, pass using `proj: 'Project.xcodeproj'`".red unless value and !value.empty?
92
+ UI.user_error!("No project file specified, pass using `proj: 'Project.xcodeproj'`") unless value and !value.empty?
93
93
  end),
94
94
  FastlaneCore::ConfigItem.new(key: :scheme,
95
95
  env_name: "FL_SLATHER_SCHEME", # The name of the environment variable
@@ -30,7 +30,7 @@ module Fastlane
30
30
  end
31
31
 
32
32
  def self.verify_sonar_runner_binary
33
- raise "You have to install sonar-runner using `brew install sonar-runner`".red unless `which sonar-runner`.to_s.length > 0
33
+ UI.user_error!("You have to install sonar-runner using `brew install sonar-runner`") unless `which sonar-runner`.to_s.length > 0
34
34
  end
35
35
 
36
36
  #####################################################
@@ -52,7 +52,7 @@ module Fastlane
52
52
  description: "The path to your sonar project configuration file; defaults to `sonar-project.properties`", # default is enforced by sonar-runner binary
53
53
  optional: true,
54
54
  verify_block: proc do |value|
55
- raise "Couldn't find file at path '#{value}'".red unless value.nil? or File.exist?(value)
55
+ UI.user_error!("Couldn't find file at path '#{value}'") unless value.nil? or File.exist?(value)
56
56
  end),
57
57
  FastlaneCore::ConfigItem.new(key: :project_key,
58
58
  env_name: "FL_SONAR_RUNNER_PROJECT_KEY",
@@ -22,7 +22,7 @@ module Fastlane
22
22
 
23
23
  def self.fail_on_error(result)
24
24
  if result.include?("error")
25
- raise "Server error, failed to upload the dSYM file".red
25
+ UI.user_error!("Server error, failed to upload the dSYM file")
26
26
  end
27
27
  end
28
28
 
@@ -45,11 +45,11 @@ module Fastlane
45
45
 
46
46
  if file_path
47
47
  expanded_file_path = File.expand_path(file_path)
48
- raise "Couldn't find file at path '#{expanded_file_path}'".red unless File.exist?(expanded_file_path)
48
+ UI.user_error!("Couldn't find file at path '#{expanded_file_path}'") unless File.exist?(expanded_file_path)
49
49
 
50
50
  return expanded_file_path
51
51
  else
52
- raise "Couldn't find any dSYM file".red
52
+ UI.user_error!("Couldn't find any dSYM file")
53
53
  end
54
54
  end
55
55
 
@@ -51,7 +51,7 @@ module Fastlane
51
51
  UI.important(['[SSH COMMAND]', cmd].join(': ')) if params[:log]
52
52
  return_value = ssh_exec!(ssh, cmd)
53
53
  UI.error("SSH Command failed '#{cmd}' Exit-Code: #{return_value[:exit_code]}") if return_value[:exit_code] > 0
54
- raise "SSH Command failed" if return_value[:exit_code] > 0
54
+ UI.user_error!("SSH Command failed") if return_value[:exit_code] > 0
55
55
 
56
56
  stderr << return_value[:stderr]
57
57
  stdout << return_value[:stdout]
@@ -8,7 +8,12 @@ module Fastlane
8
8
  begin
9
9
  FastlaneCore::UpdateChecker.start_looking_for_update('supply') unless Helper.is_test?
10
10
 
11
- params[:apk] ||= Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
11
+ all_apk_paths = Actions.lane_context[SharedValues::GRADLE_ALL_APK_OUTPUT_PATHS]
12
+ if all_apk_paths.length > 1
13
+ params[:apk_paths] ||= all_apk_paths
14
+ else
15
+ params[:apk] ||= Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]
16
+ end
12
17
 
13
18
  Supply.config = params # we already have the finished config
14
19
 
@@ -3,12 +3,12 @@ module Fastlane
3
3
  class SwiftlintAction < Action
4
4
  def self.run(params)
5
5
  if `which swiftlint`.to_s.length == 0 and !Helper.test?
6
- raise "You have to install swiftlint using `brew install swiftlint`".red
6
+ UI.user_error!("You have to install swiftlint using `brew install swiftlint`")
7
7
  end
8
8
 
9
9
  version = Gem::Version.new(Helper.test? ? '0.0.0' : `swiftlint version`.chomp)
10
10
  if params[:mode] == :autocorrect and version < Gem::Version.new('0.5.0') and !Helper.test?
11
- raise "Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`".red
11
+ UI.user_error!("Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
12
12
  end
13
13
 
14
14
  command = "swiftlint #{params[:mode]}"
@@ -17,7 +17,7 @@ module Fastlane
17
17
 
18
18
  if params[:files]
19
19
  if version < Gem::Version.new('0.5.1') and !Helper.test?
20
- raise "Your version of swiftlint (#{version}) does not support list of files as input.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`".red
20
+ UI.user_error!("Your version of swiftlint (#{version}) does not support list of files as input.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
21
21
  end
22
22
 
23
23
  files = params[:files].map.with_index(0) { |f, i| "SCRIPT_INPUT_FILE_#{i}=#{f.shellescape}" }.join(" ")
@@ -7,7 +7,7 @@ module Fastlane
7
7
  def self.run(params)
8
8
  params = nil unless params.kind_of? Array
9
9
  team = (params || []).first
10
- raise "Please pass your Team ID (e.g. team_id 'Q2CBPK58CA')".red unless team.to_s.length > 0
10
+ UI.user_error!("Please pass your Team ID (e.g. team_id 'Q2CBPK58CA')") unless team.to_s.length > 0
11
11
 
12
12
  UI.message("Setting Team ID to '#{team}' for all build steps")
13
13
 
@@ -7,7 +7,7 @@ module Fastlane
7
7
  def self.run(params)
8
8
  params = nil unless params.kind_of? Array
9
9
  team = (params || []).first
10
- raise "Please pass your Team Name (e.g. team_name 'Felix Krause')".red unless team.to_s.length > 0
10
+ UI.user_error!("Please pass your Team Name (e.g. team_name 'Felix Krause')") unless team.to_s.length > 0
11
11
 
12
12
  UI.message("Setting Team Name to '#{team}' for all build steps")
13
13
 
@@ -22,7 +22,7 @@ module Fastlane
22
22
  UI.success("Build URL: #{Actions.lane_context[SharedValues::TESTFAIRY_BUILD_URL]}")
23
23
  UI.success("Build successfully uploaded to TestFairy.")
24
24
  else
25
- raise 'Error when trying to upload ipa to TestFairy'.red
25
+ UI.user_error!("Error when trying to upload ipa to TestFairy")
26
26
  end
27
27
  end
28
28
 
@@ -55,14 +55,14 @@ module Fastlane
55
55
  env_name: "FL_TESTFAIRY_API_KEY", # The name of the environment variable
56
56
  description: "API Key for TestFairy", # a short description of this parameter
57
57
  verify_block: proc do |value|
58
- raise "No API key for TestFairy given, pass using `api_key: 'key'`".red unless value.to_s.length > 0
58
+ UI.user_error!("No API key for TestFairy given, pass using `api_key: 'key'`") unless value.to_s.length > 0
59
59
  end),
60
60
  FastlaneCore::ConfigItem.new(key: :ipa,
61
61
  env_name: 'TESTFAIRY_IPA_PATH',
62
62
  description: 'Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action',
63
63
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
64
64
  verify_block: proc do |value|
65
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
65
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
66
66
  end),
67
67
  FastlaneCore::ConfigItem.new(key: :comment,
68
68
  env_name: "FL_TESTFAIRY_COMMENT",
@@ -28,7 +28,7 @@ module Fastlane
28
28
  if response
29
29
  UI.success('Your tests are being executed right now. Please wait for the mail with results and decide if you want to continue.')
30
30
  else
31
- raise 'Something went wrong while uploading your app to Testmunk'.red
31
+ UI.user_error!("Something went wrong while uploading your app to Testmunk")
32
32
  end
33
33
  end
34
34
 
@@ -43,25 +43,25 @@ module Fastlane
43
43
  description: "Path to IPA",
44
44
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
45
45
  verify_block: proc do |value|
46
- raise "Please pass to existing ipa" unless File.exist? value
46
+ UI.user_error!("Please pass to existing ipa") unless File.exist? value
47
47
  end),
48
48
  FastlaneCore::ConfigItem.new(key: :email,
49
49
  env_name: "TESTMUNK_EMAIL",
50
50
  description: "Your email address",
51
51
  verify_block: proc do |value|
52
- raise "Please pass your Testmunk email address using `ENV['TESTMUNK_EMAIL'] = 'value'`" unless value
52
+ UI.user_error!("Please pass your Testmunk email address using `ENV['TESTMUNK_EMAIL'] = 'value'`") unless value
53
53
  end),
54
54
  FastlaneCore::ConfigItem.new(key: :api,
55
55
  env_name: "TESTMUNK_API",
56
56
  description: "Testmunk API Key",
57
57
  verify_block: proc do |value|
58
- raise "Please pass your Testmunk API Key using `ENV['TESTMUNK_API'] = 'value'`" unless value
58
+ UI.user_error!("Please pass your Testmunk API Key using `ENV['TESTMUNK_API'] = 'value'`") unless value
59
59
  end),
60
60
  FastlaneCore::ConfigItem.new(key: :app,
61
61
  env_name: "TESTMUNK_APP",
62
62
  description: "Testmunk App Name",
63
63
  verify_block: proc do |value|
64
- raise "Please pass your Testmunk app name using `ENV['TESTMUNK_APP'] = 'value'`" unless value
64
+ UI.user_error!("Please pass your Testmunk app name using `ENV['TESTMUNK_APP'] = 'value'`") unless value
65
65
  end)
66
66
  ]
67
67
  end
@@ -19,7 +19,7 @@ module Fastlane
19
19
  UI.success('Build successfully uploaded to Tryouts!')
20
20
  UI.message("Release download url: #{response.body['download_url']}") if response.body["download_url"]
21
21
  else
22
- raise "Error when trying to upload build file to Tryouts: #{response.body}".red
22
+ UI.user_error!("Error when trying to upload build file to Tryouts: #{response.body}")
23
23
  end
24
24
  end
25
25
 
@@ -68,20 +68,20 @@ module Fastlane
68
68
  env_name: "TRYOUTS_APP_ID",
69
69
  description: "Tryouts application hash",
70
70
  verify_block: proc do |value|
71
- raise "No application identifier for Tryouts given, pass using `app_id: 'application id'`".red unless value and !value.empty?
71
+ UI.user_error!("No application identifier for Tryouts given, pass using `app_id: 'application id'`") unless value and !value.empty?
72
72
  end),
73
73
  FastlaneCore::ConfigItem.new(key: :api_token,
74
74
  env_name: "TRYOUTS_API_TOKEN",
75
75
  description: "API Token for Tryouts Access",
76
76
  verify_block: proc do |value|
77
- raise "No API token for Tryouts given, pass using `api_token: 'token'`".red unless value and !value.empty?
77
+ UI.user_error!("No API token for Tryouts given, pass using `api_token: 'token'`") unless value and !value.empty?
78
78
  end),
79
79
  FastlaneCore::ConfigItem.new(key: :build_file,
80
80
  env_name: "TRYOUTS_BUILD_FILE",
81
81
  description: "Path to your IPA or APK file. Optional if you use the `gym` or `xcodebuild` action",
82
82
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
83
83
  verify_block: proc do |value|
84
- raise "Couldn't find build file at path '#{value}'".red unless File.exist?(value)
84
+ UI.user_error!("Couldn't find build file at path '#{value}'") unless File.exist?(value)
85
85
  end),
86
86
  FastlaneCore::ConfigItem.new(key: :notes,
87
87
  env_name: "TRYOUTS_NOTES",
@@ -92,7 +92,7 @@ module Fastlane
92
92
  env_name: "TRYOUTS_NOTES_PATH",
93
93
  description: "Release notes text file path. Overrides the :notes paramether",
94
94
  verify_block: proc do |value|
95
- raise "Couldn't find notes file at path '#{value}'".red unless File.exist?(value)
95
+ UI.user_error!("Couldn't find notes file at path '#{value}'") unless File.exist?(value)
96
96
  end,
97
97
  optional: true),
98
98
  FastlaneCore::ConfigItem.new(key: :notify,
@@ -105,7 +105,7 @@ module Fastlane
105
105
  description: "2 to make your release public. Release will be distributed to available testers. 1 to make your release private. Release won't be distributed to testers. This also prevents release from showing up for SDK update",
106
106
  verify_block: proc do |value|
107
107
  available_options = ["1", "2"]
108
- raise "'#{value}' is not a valid 'status' value. Available options are #{available_options.join(', ')}".red unless available_options.include?(value.to_s)
108
+ UI.user_error!("'#{value}' is not a valid 'status' value. Available options are #{available_options.join(', ')}") unless available_options.include?(value.to_s)
109
109
  end,
110
110
  is_string: false,
111
111
  default_value: 2)