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
@@ -57,9 +57,9 @@ module Fastlane
57
57
  optional: true,
58
58
  is_string: false,
59
59
  verify_block: proc do |value|
60
- raise ":between must be of type array".red unless value.kind_of?(Array)
61
- raise ":between must not contain nil values".red if value.any?(&:nil?)
62
- raise ":between must be an array of size 2".red unless (value || []).size == 2
60
+ UI.user_error!(":between must be of type array") unless value.kind_of?(Array)
61
+ UI.user_error!(":between must not contain nil values") if value.any?(&:nil?)
62
+ UI.user_error!(":between must be an array of size 2") unless (value || []).size == 2
63
63
  end),
64
64
  FastlaneCore::ConfigItem.new(key: :pretty,
65
65
  env_name: 'FL_CHANGELOG_FROM_GIT_COMMITS_PRETTY',
@@ -92,7 +92,7 @@ module Fastlane
92
92
  default_value: 'include_merges',
93
93
  verify_block: proc do |value|
94
94
  matches_option = GIT_MERGE_COMMIT_FILTERING_OPTIONS.any? { |opt| opt.to_s == value }
95
- raise "Valid values for :merge_commit_filtering are #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map {|o| "'#{o}'" }.join(', ')}".red unless matches_option
95
+ UI.user_error!("Valid values for :merge_commit_filtering are #{GIT_MERGE_COMMIT_FILTERING_OPTIONS.map {|o| "'#{o}'" }.join(', ')}") unless matches_option
96
96
  end
97
97
  )
98
98
  ]
@@ -27,7 +27,7 @@ module Fastlane
27
27
  else
28
28
  require 'json'
29
29
  json = JSON.parse(response.body)
30
- raise "HTTP Error: #{response.code} #{json['errors']}".red
30
+ UI.user_error!("HTTP Error: #{response.code} #{json['errors']}")
31
31
  end
32
32
  end
33
33
 
@@ -43,7 +43,7 @@ module Fastlane
43
43
  verify_block: proc do |value|
44
44
  unless value.to_s.length > 0
45
45
  UI.error("Please add 'ENV[\"CHATWORK_API_TOKEN\"] = \"your token\"' to your Fastfile's `before_all` section.")
46
- raise 'No CHATWORK_API_TOKEN given.'.red
46
+ UI.user_error!("No CHATWORK_API_TOKEN given.")
47
47
  end
48
48
  end),
49
49
  FastlaneCore::ConfigItem.new(key: :message,
@@ -24,7 +24,7 @@ module Fastlane
24
24
  optional: true,
25
25
  is_string: true,
26
26
  verify_block: proc do |value|
27
- raise "You must specify pod name which should be removed from cache".red if value.to_s.empty?
27
+ UI.user_error!("You must specify pod name which should be removed from cache") if value.to_s.empty?
28
28
  end)
29
29
  ]
30
30
  end
@@ -74,7 +74,7 @@ module Fastlane
74
74
  optional: true,
75
75
  is_string: true,
76
76
  verify_block: proc do |value|
77
- raise "Could not find Podfile".red unless File.exist?(value) || Helper.test?
77
+ UI.user_error!("Could not find Podfile") unless File.exist?(value) || Helper.test?
78
78
  end)
79
79
  ]
80
80
  end
@@ -17,18 +17,18 @@ module Fastlane
17
17
 
18
18
  if xcodeproj_path
19
19
  # ensure that the xcodeproj passed in was OK
20
- raise "Could not find the specified xcodeproj: #{xcodeproj_path}" unless File.directory?(xcodeproj_path)
20
+ UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path)
21
21
  else
22
22
  # find an xcodeproj (ignoring the Cocoapods one)
23
23
  xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| %r{Pods\/.*.xcodeproj} =~ path }
24
24
 
25
25
  # no projects found: error
26
- raise 'Could not find a .xcodeproj in the current repository\'s working directory.'.red if xcodeproj_paths.count == 0
26
+ UI.user_error!('Could not find a .xcodeproj in the current repository\'s working directory.') if xcodeproj_paths.count == 0
27
27
 
28
28
  # too many projects found: error
29
29
  if xcodeproj_paths.count > 1
30
30
  relative_projects = xcodeproj_paths.map { |e| Pathname.new(e).relative_path_from(repo_pathname).to_s }.join("\n")
31
- raise "Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}".red
31
+ UI.user_error!("Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}")
32
32
  end
33
33
 
34
34
  # one project found: great
@@ -65,7 +65,7 @@ module Fastlane
65
65
  git_dirty_files = Actions.sh('git diff --name-only HEAD').split("\n") + Actions.sh('git ls-files --other --exclude-standard').split("\n")
66
66
 
67
67
  # little user hint
68
- raise 'No file changes picked up. Make sure you run the `increment_build_number` action first.'.red if git_dirty_files.empty?
68
+ UI.user_error!("No file changes picked up. Make sure you run the `increment_build_number` action first.") if git_dirty_files.empty?
69
69
 
70
70
  # check if the files changed are the ones we expected to change (these should be only the files that have version info in them)
71
71
  changed_files_as_expected = (Set.new(git_dirty_files.map(&:downcase)).subset? Set.new(expected_changed_files.map(&:downcase)))
@@ -125,8 +125,8 @@ module Fastlane
125
125
  description: "The path to your project file (Not the workspace). If you have only one, this is optional",
126
126
  optional: true,
127
127
  verify_block: proc do |value|
128
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
129
- raise "Could not find Xcode project".red unless File.exist?(value)
128
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
129
+ UI.user_error!("Could not find Xcode project") unless File.exist?(value)
130
130
  end),
131
131
  FastlaneCore::ConfigItem.new(key: :force,
132
132
  env_name: "FL_FORCE_COMMIT",
@@ -24,7 +24,7 @@ module Fastlane
24
24
  elsif params[:apk_path]
25
25
  command = Helper::CrashlyticsHelper.generate_android_command(params)
26
26
  else
27
- raise "You have to either pass an ipa or an apk file to the Crashlytics action".red
27
+ UI.user_error!("You have to either pass an ipa or an apk file to the Crashlytics action")
28
28
  end
29
29
 
30
30
  UI.success('Uploading the build to Crashlytics Beta. Time for some ☕️.')
@@ -49,7 +49,7 @@ module Fastlane
49
49
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || Dir["*.ipa"].last,
50
50
  optional: true,
51
51
  verify_block: proc do |value|
52
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
52
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
53
53
  end),
54
54
  # Android Specific
55
55
  FastlaneCore::ConfigItem.new(key: :apk_path,
@@ -58,7 +58,7 @@ module Fastlane
58
58
  default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH] || Dir["*.apk"].last || Dir[File.join("app", "build", "outputs", "apk", "app-Release.apk")].last,
59
59
  optional: true,
60
60
  verify_block: proc do |value|
61
- raise "Couldn't find apk file at path '#{value}'".red unless File.exist?(value)
61
+ UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
62
62
  end),
63
63
  # General
64
64
  FastlaneCore::ConfigItem.new(key: :crashlytics_path,
@@ -67,26 +67,26 @@ module Fastlane
67
67
  default_value: Dir["./Pods/iOS/Crashlytics/Crashlytics.framework"].last || Dir["./**/Crashlytics.framework"].last,
68
68
  optional: true,
69
69
  verify_block: proc do |value|
70
- raise "Couldn't find crashlytics at path '#{File.expand_path(value)}'`".red unless File.exist?(File.expand_path(value))
70
+ UI.user_error!("Couldn't find crashlytics at path '#{File.expand_path(value)}'`") unless File.exist?(File.expand_path(value))
71
71
  end),
72
72
  FastlaneCore::ConfigItem.new(key: :api_token,
73
73
  env_name: "CRASHLYTICS_API_TOKEN",
74
74
  description: "Crashlytics Beta API Token",
75
75
  verify_block: proc do |value|
76
- raise "No API token for Crashlytics given, pass using `api_token: 'token'`".red unless value && !value.empty?
76
+ UI.user_error!("No API token for Crashlytics given, pass using `api_token: 'token'`") unless value && !value.empty?
77
77
  end),
78
78
  FastlaneCore::ConfigItem.new(key: :build_secret,
79
79
  env_name: "CRASHLYTICS_BUILD_SECRET",
80
80
  description: "Crashlytics Build Secret",
81
81
  verify_block: proc do |value|
82
- raise "No build secret for Crashlytics given, pass using `build_secret: 'secret'`".red unless value && !value.empty?
82
+ UI.user_error!("No build secret for Crashlytics given, pass using `build_secret: 'secret'`") unless value && !value.empty?
83
83
  end),
84
84
  FastlaneCore::ConfigItem.new(key: :notes_path,
85
85
  env_name: "CRASHLYTICS_NOTES_PATH",
86
86
  description: "Path to the release notes",
87
87
  optional: true,
88
88
  verify_block: proc do |value|
89
- raise "Path '#{value}' not found".red unless File.exist?(value)
89
+ UI.user_error!("Path '#{value}' not found") unless File.exist?(value)
90
90
  end),
91
91
  FastlaneCore::ConfigItem.new(key: :notes,
92
92
  env_name: "CRASHLYTICS_NOTES",
@@ -6,7 +6,7 @@ module Fastlane
6
6
 
7
7
  class DefaultPlatformAction < Action
8
8
  def self.run(params)
9
- raise "You forgot to pass the default platform".red if params.first.nil?
9
+ UI.user_error!("You forgot to pass the default platform") if params.first.nil?
10
10
 
11
11
  platform = params.first.to_sym
12
12
 
@@ -31,12 +31,17 @@ module Fastlane
31
31
 
32
32
  return options[:ipa] if Helper.test?
33
33
 
34
- response = client.upload_build(options[:ipa], options.values)
34
+ filter = [:message, :distribution_key, :release_note]
35
+ response = client.upload_build(
36
+ options[:ipa],
37
+ options.values.select do |key, _|
38
+ filter.include? key
39
+ end)
35
40
  if parse_response(response)
36
41
  UI.message("DeployGate URL: #{Actions.lane_context[SharedValues::DEPLOYGATE_URL]}")
37
42
  UI.success("Build successfully uploaded to DeployGate as revision \##{Actions.lane_context[SharedValues::DEPLOYGATE_REVISION]}!")
38
43
  else
39
- raise 'Error when trying to upload ipa to DeployGate'.red
44
+ UI.user_error!("Error when trying to upload ipa to DeployGate")
40
45
  end
41
46
  end
42
47
 
@@ -87,25 +92,33 @@ module Fastlane
87
92
  env_name: "DEPLOYGATE_API_TOKEN",
88
93
  description: "Deploygate API Token",
89
94
  verify_block: proc do |value|
90
- raise "No API Token for DeployGate given, pass using `api_token: 'token'`".red unless value.to_s.length > 0
95
+ UI.user_error!("No API Token for DeployGate given, pass using `api_token: 'token'`") unless value.to_s.length > 0
91
96
  end),
92
97
  FastlaneCore::ConfigItem.new(key: :user,
93
98
  env_name: "DEPLOYGATE_USER",
94
99
  description: "Target username or organization name",
95
100
  verify_block: proc do |value|
96
- raise "No User for app given, pass using `user: 'user'`".red unless value.to_s.length > 0
101
+ UI.user_error!("No User for app given, pass using `user: 'user'`") unless value.to_s.length > 0
97
102
  end),
98
103
  FastlaneCore::ConfigItem.new(key: :ipa,
99
104
  env_name: "DEPLOYGATE_IPA_PATH",
100
105
  description: "Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action",
101
106
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
102
107
  verify_block: proc do |value|
103
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
108
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
104
109
  end),
105
110
  FastlaneCore::ConfigItem.new(key: :message,
106
111
  env_name: "DEPLOYGATE_MESSAGE",
107
112
  description: "Release Notes",
108
- default_value: "No changelog provided")
113
+ default_value: "No changelog provided"),
114
+ FastlaneCore::ConfigItem.new(key: :distribution_key,
115
+ optional: true,
116
+ env_name: "DEPLOYGATE_DISTRIBUTION_KEY",
117
+ description: "Target Distribution Key"),
118
+ FastlaneCore::ConfigItem.new(key: :release_note,
119
+ optional: true,
120
+ env_name: "DEPLOYGATE_RELEASE_NOTE",
121
+ description: "Release note for distribution page")
109
122
  ]
110
123
  end
111
124
 
@@ -28,7 +28,7 @@ module Fastlane
28
28
  default_value: Dir["dotgpg/*.gpg"].last,
29
29
  optional: false,
30
30
  verify_block: proc do |value|
31
- raise "Dotgpg file '#{File.expand_path(value)}' not found".red unless File.exist?(value)
31
+ UI.user_error!("Dotgpg file '#{File.expand_path(value)}' not found") unless File.exist?(value)
32
32
  end)
33
33
  ]
34
34
  end
@@ -17,7 +17,7 @@ module Fastlane
17
17
  end
18
18
  Actions.lane_context[SharedValues::DOWNLOAD_CONTENT] = result
19
19
  rescue => ex
20
- raise "Error fetching remote file: #{ex}"
20
+ UI.user_error!("Error fetching remote file: #{ex}")
21
21
  end
22
22
  end
23
23
 
@@ -14,10 +14,29 @@ module Fastlane
14
14
  Spaceship::Tunes.select_team
15
15
  UI.message("Login successful")
16
16
 
17
- UI.message("Looking for dSYM files for #{params[:app_identifier]}...")
17
+ version = params[:version]
18
+ build_number = params[:build_number]
19
+
20
+ message = []
21
+ message << "Looking for dSYM files for #{params[:app_identifier]}"
22
+ if version
23
+ message << "v#{version}"
24
+ end
25
+
26
+ if build_number
27
+ message << "(#{build_number})"
28
+ end
29
+
30
+ UI.message(message.join(" "))
18
31
  app = Spaceship::Application.find(params[:app_identifier])
19
32
  app.all_build_train_numbers.each do |train_number|
33
+ if version && version != train_number
34
+ next
35
+ end
20
36
  app.all_builds_for_train(train: train_number).each do |build|
37
+ if build_number && build.build_version != build_number
38
+ next
39
+ end
21
40
  download_url = build.details.dsym_url
22
41
  if download_url
23
42
  result = self.download download_url
@@ -91,7 +110,17 @@ module Fastlane
91
110
  default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_name),
92
111
  verify_block: proc do |value|
93
112
  ENV["FASTLANE_ITC_TEAM_NAME"] = value
94
- end)
113
+ end),
114
+ FastlaneCore::ConfigItem.new(key: :version,
115
+ short_option: "-v",
116
+ env_name: "DOWNLOAD_DSYMS_VERSION",
117
+ description: "The app version for dSYMs you wish to download",
118
+ optional: true),
119
+ FastlaneCore::ConfigItem.new(key: :build_number,
120
+ short_option: "-b",
121
+ env_name: "DOWNLOAD_DSYMS_BUILD_NUMBER",
122
+ description: "The app build_number for dSYMs you wish to download",
123
+ optional: true)
95
124
  ]
96
125
  end
97
126
 
@@ -46,7 +46,7 @@ module Fastlane
46
46
  optional: true,
47
47
  env_name: 'DSYM_ZIP_XCARCHIVE_PATH',
48
48
  verify_block: proc do |value|
49
- raise "Couldn't find xcarchive file at path '#{value}'".red if !Helper.test? && !File.exist?(value)
49
+ UI.user_error!("Couldn't find xcarchive file at path '#{value}'") if !Helper.test? && !File.exist?(value)
50
50
  end),
51
51
  FastlaneCore::ConfigItem.new(key: :dsym_path,
52
52
  description: 'Path for generated dsym. Optional, default is your apps root directory',
@@ -11,7 +11,7 @@ module Fastlane
11
11
  if Actions.git_branch =~ branch_expr
12
12
  UI.success("Git branch match `#{branch}`, all good! 💪")
13
13
  else
14
- raise "Git is not on a branch matching `#{branch}`. Current branch is `#{Actions.git_branch}`! Please ensure the repo is checked out to the correct branch.".red
14
+ UI.user_error!("Git is not on a branch matching `#{branch}`. Current branch is `#{Actions.git_branch}`! Please ensure the repo is checked out to the correct branch.")
15
15
  end
16
16
  end
17
17
 
@@ -33,7 +33,7 @@ module Fastlane
33
33
  found << current_raw.strip
34
34
  end
35
35
 
36
- raise "Found debug code '#{params[:text]}': \n\n#{found.join("\n")}" if found.count > 0
36
+ UI.user_error!("Found debug code '#{params[:text]}': \n\n#{found.join("\n")}") if found.count > 0
37
37
  UI.message("No debug code found in code base 🐛")
38
38
  end
39
39
 
@@ -63,7 +63,7 @@ module Fastlane
63
63
  description: "The directory containing all the source files",
64
64
  default_value: ".",
65
65
  verify_block: proc do |value|
66
- raise "Couldn't find the folder at '#{File.absolute_path(value)}'".red unless File.directory?(value)
66
+ UI.user_error!("Couldn't find the folder at '#{File.absolute_path(value)}'") unless File.directory?(value)
67
67
  end),
68
68
  FastlaneCore::ConfigItem.new(key: :extension,
69
69
  env_name: "FL_ENSURE_NO_DEBUG_CODE_EXTENSION",
@@ -18,7 +18,7 @@ module Fastlane
18
18
  UI.message("Selected Xcode version is not correct: #{selected_version}. You expected #{required_version}.")
19
19
  UI.message("To correct this, use: `xcode_select(version: #{required_version})`.")
20
20
 
21
- raise "Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}\n"
21
+ UI.user_error!("Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}\n")
22
22
  end
23
23
  end
24
24
 
@@ -9,10 +9,10 @@ module Fastlane
9
9
  value = (params || []).first
10
10
  defined_version = Gem::Version.new(value) if value
11
11
 
12
- raise "Please pass minimum fastlane version as parameter to fastlane_version".red unless defined_version
12
+ UI.user_error!("Please pass minimum fastlane version as parameter to fastlane_version") unless defined_version
13
13
 
14
14
  if Gem::Version.new(Fastlane::VERSION) < defined_version
15
- raise "The Fastfile requires a fastlane version of >= #{defined_version}. You are on #{Fastlane::VERSION}. Please update using `sudo gem update fastlane`.".red
15
+ UI.user_error!("The Fastfile requires a fastlane version of >= #{defined_version}. You are on #{Fastlane::VERSION}. Please update using `sudo gem update fastlane`.")
16
16
  end
17
17
 
18
18
  UI.message("fastlane version valid")
@@ -49,7 +49,7 @@ module Fastlane
49
49
  verify_block: proc do |value|
50
50
  available = ['iPhone_6_Plus', 'iPhone_5s', 'iPhone_4', 'iPad_mini', 'Mac']
51
51
  unless available.include? value
52
- raise "Invalid device type '#{value}'. Available values: #{available}".red
52
+ UI.user_error!("Invalid device type '#{value}'. Available values: #{available}")
53
53
  end
54
54
  end)
55
55
  ]
@@ -53,7 +53,7 @@ module Fastlane
53
53
 
54
54
  def self.run(params)
55
55
  unless Helper.test?
56
- raise "gcovr not installed".red if `which gcovr`.length == 0
56
+ UI.user_error!("gcovr not installed") if `which gcovr`.length == 0
57
57
  end
58
58
 
59
59
  # The args we will build with
@@ -59,8 +59,8 @@ module Fastlane
59
59
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
60
60
  optional: true,
61
61
  verify_block: proc do |value|
62
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
63
- raise "Could not find Xcode project".red if !File.exist?(value) and !Helper.is_test?
62
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
63
+ UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.is_test?
64
64
  end)
65
65
  ]
66
66
  end
@@ -51,7 +51,7 @@ module Fastlane
51
51
  return 'hg parent --template "{node|short}"'
52
52
  end
53
53
  else
54
- raise "No repository detected"
54
+ UI.user_error!("No repository detected")
55
55
  end
56
56
  end
57
57
 
@@ -110,8 +110,8 @@ module Fastlane
110
110
  env_name: "FL_GET_GITHUB_RELEASE_URL",
111
111
  description: "The path to your repo, e.g. 'KrauseFx/fastlane'",
112
112
  verify_block: proc do |value|
113
- raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.include? "github.com"
114
- raise "Please only pass the path, e.g. 'KrauseFx/fastlane'".red if value.split('/').count != 2
113
+ UI.user_error!("Please only pass the path, e.g. 'KrauseFx/fastlane'") if value.include? "github.com"
114
+ UI.user_error!("Please only pass the path, e.g. 'KrauseFx/fastlane'") if value.split('/').count != 2
115
115
  end),
116
116
  FastlaneCore::ConfigItem.new(key: :server_url,
117
117
  env_name: "FL_GITHUB_RELEASE_SERVER_URL",
@@ -119,7 +119,7 @@ module Fastlane
119
119
  default_value: "https://api.github.com",
120
120
  optional: true,
121
121
  verify_block: proc do |value|
122
- raise "Please include the protocol in the server url, e.g. https://your.github.server".red unless value.include? "//"
122
+ UI.user_error!("Please include the protocol in the server url, e.g. https://your.github.server") unless value.include? "//"
123
123
  end),
124
124
  FastlaneCore::ConfigItem.new(key: :version,
125
125
  env_name: "FL_GET_GITHUB_RELEASE_VERSION",
@@ -37,7 +37,7 @@ module Fastlane
37
37
  description: "Path to plist file you want to read",
38
38
  optional: false,
39
39
  verify_block: proc do |value|
40
- raise "Couldn't find plist file at path '#{value}'".red unless File.exist?(value)
40
+ UI.user_error!("Couldn't find plist file at path '#{value}'") unless File.exist?(value)
41
41
  end)
42
42
  ]
43
43
  end
@@ -59,8 +59,8 @@ module Fastlane
59
59
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
60
60
  optional: true,
61
61
  verify_block: proc do |value|
62
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
63
- raise "Could not find Xcode project at path '#{File.expand_path(value)}'".red if !File.exist?(value) and !Helper.is_test?
62
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
63
+ UI.user_error!("Could not find Xcode project at path '#{File.expand_path(value)}'") if !File.exist?(value) and !Helper.is_test?
64
64
  end)
65
65
  ]
66
66
  end
@@ -32,10 +32,10 @@ module Fastlane
32
32
  is_string: false,
33
33
  verify_block: proc do |value|
34
34
  if value.kind_of?(String)
35
- raise "Couldn't find file at path '#{value}'".red unless File.exist?(value)
35
+ UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
36
36
  else
37
37
  value.each do |x|
38
- raise "Couldn't find file at path '#{x}'".red unless File.exist?(x)
38
+ UI.user_error!("Couldn't find file at path '#{x}'") unless File.exist?(x)
39
39
  end
40
40
  end
41
41
  end)