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
@@ -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),
@@ -25,7 +25,7 @@ module Fastlane
25
25
  optional: true,
26
26
  default_value: false,
27
27
  verify_block: proc do |value|
28
- raise "Please pass a valid value for only_tags. Use one of the following: true, false" unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
28
+ UI.user_error!("Please pass a valid value for only_tags. Use one of the following: true, false") unless value.kind_of?(TrueClass) || value.kind_of?(FalseClass)
29
29
  end)
30
30
  ]
31
31
  end
@@ -30,7 +30,7 @@ module Fastlane
30
30
  end
31
31
 
32
32
  # Ensure we ended up with a valid path to gradle
33
- raise "Couldn't find gradlew at path '#{File.expand_path(gradle_path)}'".red unless File.exist?(gradle_path)
33
+ UI.user_error!("Couldn't find gradlew at path '#{File.expand_path(gradle_path)}'") unless File.exist?(gradle_path)
34
34
 
35
35
  # Construct our flags
36
36
  flags = []
@@ -22,19 +22,19 @@ module Fastlane
22
22
  if xcodeproj_path
23
23
  # ensure that the xcodeproj passed in was OK
24
24
  unless Helper.is_test?
25
- raise "Could not find the specified xcodeproj: #{xcodeproj_path}" unless File.directory?(xcodeproj_path)
25
+ UI.user_error!("Could not find the specified xcodeproj: #{xcodeproj_path}") unless File.directory?(xcodeproj_path)
26
26
  end
27
27
  else
28
28
  # find an xcodeproj (ignoring the Cocoapods one)
29
29
  xcodeproj_paths = Dir[File.expand_path(File.join(repo_path, '**/*.xcodeproj'))].reject { |path| %r{Pods\/.*.xcodeproj} =~ path }
30
30
 
31
31
  # no projects found: error
32
- raise 'Could not find a .xcodeproj in the current repository\'s working directory.'.red if xcodeproj_paths.count == 0
32
+ UI.user_error!('Could not find a .xcodeproj in the current repository\'s working directory.') if xcodeproj_paths.count == 0
33
33
 
34
34
  # too many projects found: error
35
35
  if xcodeproj_paths.count > 1
36
36
  relative_projects = xcodeproj_paths.map { |e| Pathname.new(e).relative_path_from(repo_pathname).to_s }.join("\n")
37
- raise "Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}".red
37
+ UI.user_error!("Found multiple .xcodeproj projects in the current repository's working directory. Please specify your app's main project: \n#{relative_projects}")
38
38
  end
39
39
 
40
40
  # one project found: great
@@ -76,7 +76,7 @@ module Fastlane
76
76
  end
77
77
 
78
78
  # little user hint
79
- raise 'No file changes picked up. Make sure you run the `increment_build_number` action first.'.red if hg_dirty_files.empty?
79
+ UI.user_error!("No file changes picked up. Make sure you run the `increment_build_number` action first.") if hg_dirty_files.empty?
80
80
 
81
81
  # check if the files changed are the ones we expected to change (these should be only the files that have version info in them)
82
82
  dirty_set = Set.new(hg_dirty_files.map(&:downcase))
@@ -91,7 +91,7 @@ module Fastlane
91
91
  "stage in your lane, and don't touch the working directory while your lane is running. You can also use the :force option to ",
92
92
  "bypass this check, and always commit a version bump regardless of the state of the working directory."
93
93
  ].join("\n")
94
- raise str.red
94
+ UI.user_error!(str)
95
95
  end
96
96
  end
97
97
 
@@ -123,8 +123,8 @@ module Fastlane
123
123
  description: "The path to your project file (Not the workspace). If you have only one, this is optional",
124
124
  optional: true,
125
125
  verify_block: proc do |value|
126
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
127
- raise "Could not find Xcode project".red unless File.exist?(value)
126
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
127
+ UI.user_error!("Could not find Xcode project") unless File.exist?(value)
128
128
  end),
129
129
  FastlaneCore::ConfigItem.new(key: :force,
130
130
  env_name: "FL_FORCE_COMMIT",
@@ -31,7 +31,7 @@ module Fastlane
31
31
  if api_version.to_i == 1
32
32
  ########## running on V1 ##########
33
33
  if user?(channel)
34
- raise 'HipChat private message not working with API V1 please use API V2 instead'.red
34
+ UI.user_error!("HipChat private message not working with API V1 please use API V2 instead")
35
35
  else
36
36
  uri = URI.parse("https://#{api_host}/v1/rooms/message")
37
37
  response = Net::HTTP.post_form(uri, { 'from' => from,
@@ -78,11 +78,11 @@ module Fastlane
78
78
  when 200, 204
79
79
  true
80
80
  when 404
81
- raise "Channel `#{channel}` not found".red
81
+ UI.user_error!("Channel `#{channel}` not found")
82
82
  when 401
83
- raise "Access denied for channel `#{channel}`".red
83
+ UI.user_error!("Access denied for channel `#{channel}`")
84
84
  else
85
- raise "Unexpected #{response.code} for `#{channel}` with response: #{response.body}".red
85
+ UI.user_error!("Unexpected #{response.code} for `#{channel}` with response: #{response.body}")
86
86
  end
87
87
  end
88
88
 
@@ -105,7 +105,7 @@ module Fastlane
105
105
  verify_block: proc do |value|
106
106
  unless value.to_s.length > 0
107
107
  UI.error("Please add 'ENV[\"HIPCHAT_API_TOKEN\"] = \"your token\"' to your Fastfile's `before_all` section.")
108
- raise 'No HIPCHAT_API_TOKEN given.'.red
108
+ UI.user_error!("No HIPCHAT_API_TOKEN given.")
109
109
  end
110
110
  end),
111
111
  FastlaneCore::ConfigItem.new(key: :custom_color,
@@ -125,7 +125,7 @@ module Fastlane
125
125
  verify_block: proc do |value|
126
126
  if value.nil? || ![1, 2].include?(value.to_i)
127
127
  UI.error("Please add 'ENV[\"HIPCHAT_API_VERSION\"] = \"1 or 2\"' to your Fastfile's `before_all` section.")
128
- raise 'No HIPCHAT_API_VERSION given.'.red
128
+ UI.user_error!("No HIPCHAT_API_VERSION given.")
129
129
  end
130
130
  end),
131
131
  FastlaneCore::ConfigItem.new(key: :notify_room,
@@ -147,7 +147,7 @@ module Fastlane
147
147
  verify_block: proc do |value|
148
148
  unless ["html", "text"].include?(value.to_s)
149
149
  UI.error("Please specify the message format as either 'html' or 'text'.")
150
- raise 'Unrecognized message_format.'.red
150
+ UI.user_error!("Unrecognized message_format.")
151
151
  end
152
152
  end),
153
153
  FastlaneCore::ConfigItem.new(key: :include_html_header,
@@ -40,7 +40,7 @@ module Fastlane
40
40
  end
41
41
  end
42
42
 
43
- raise "Symbols on path '#{File.expand_path(dsym_filename)}' not found".red if dsym_filename && !File.exist?(dsym_filename)
43
+ UI.user_error!("Symbols on path '#{File.expand_path(dsym_filename)}' not found") if dsym_filename && !File.exist?(dsym_filename)
44
44
 
45
45
  UI.success('Starting with ipa upload to HockeyApp... this could take some time.')
46
46
 
@@ -67,9 +67,9 @@ module Fastlane
67
67
  UI.success('Build successfully uploaded to HockeyApp!')
68
68
  else
69
69
  if response.body.to_s.include?("App could not be created")
70
- raise "Hockey has an issue processing this app. Please confirm that an app in Hockey matches this IPA's bundle ID or that you are using the correct API upload token. If error persists, please provide the :public_identifier option from the HockeyApp website. More information https://github.com/fastlane/fastlane/issues/400"
70
+ UI.user_error!("Hockey has an issue processing this app. Please confirm that an app in Hockey matches this IPA's bundle ID or that you are using the correct API upload token. If error persists, please provide the :public_identifier option from the HockeyApp website. More information https://github.com/fastlane/fastlane/issues/400")
71
71
  else
72
- raise "Error when trying to upload ipa to HockeyApp: #{response.body}".red
72
+ UI.user_error!("Error when trying to upload ipa to HockeyApp: #{response.body}")
73
73
  end
74
74
  end
75
75
  end
@@ -86,17 +86,17 @@ module Fastlane
86
86
  default_value: Actions.lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH],
87
87
  optional: true,
88
88
  verify_block: proc do |value|
89
- raise "Couldn't find apk file at path '#{value}'".red unless File.exist?(value)
89
+ UI.user_error!("Couldn't find apk file at path '#{value}'") unless File.exist?(value)
90
90
  end,
91
91
  conflicting_options: [:ipa],
92
92
  conflict_block: proc do |value|
93
- raise "You can't use 'apk' and '#{value.key}' options in one run".red
93
+ UI.user_error!("You can't use 'apk' and '#{value.key}' options in one run")
94
94
  end),
95
95
  FastlaneCore::ConfigItem.new(key: :api_token,
96
96
  env_name: "FL_HOCKEY_API_TOKEN",
97
97
  description: "API Token for Hockey Access",
98
98
  verify_block: proc do |value|
99
- raise "No API token for Hockey given, pass using `api_token: 'token'`".red unless value and !value.empty?
99
+ UI.user_error!("No API token for Hockey given, pass using `api_token: 'token'`") unless value and !value.empty?
100
100
  end),
101
101
  FastlaneCore::ConfigItem.new(key: :ipa,
102
102
  env_name: "FL_HOCKEY_IPA",
@@ -104,11 +104,11 @@ module Fastlane
104
104
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
105
105
  optional: true,
106
106
  verify_block: proc do |value|
107
- raise "Couldn't find ipa file at path '#{value}'".red unless File.exist?(value)
107
+ UI.user_error!("Couldn't find ipa file at path '#{value}'") unless File.exist?(value)
108
108
  end,
109
109
  conflicting_options: [:apk],
110
110
  conflict_block: proc do |value|
111
- raise "You can't use 'ipa' and '#{value.key}' options in one run".red
111
+ UI.user_error!("You can't use 'ipa' and '#{value.key}' options in one run")
112
112
  end),
113
113
  FastlaneCore::ConfigItem.new(key: :dsym,
114
114
  env_name: "FL_HOCKEY_DSYM",
@@ -61,8 +61,8 @@ module Fastlane
61
61
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
62
62
  optional: true,
63
63
  verify_block: proc do |value|
64
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
65
- raise "Could not find Xcode project".red if !File.exist?(value) and !Helper.is_test?
64
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
65
+ UI.user_error!("Could not find Xcode project") if !File.exist?(value) and !Helper.is_test?
66
66
  end)
67
67
  ]
68
68
  end
@@ -34,7 +34,7 @@ module Fastlane
34
34
  if Helper.test?
35
35
  version_array = [1, 0, 0]
36
36
  else
37
- raise "Your current version (#{current_version}) does not respect the format A.B.C" unless current_version =~ /\d+.\d+.\d+/
37
+ UI.user_error!("Your current version (#{current_version}) does not respect the format A.B.C") unless current_version =~ /\d+.\d+.\d+/
38
38
  version_array = current_version.split(".").map(&:to_i)
39
39
  end
40
40
 
@@ -93,7 +93,7 @@ module Fastlane
93
93
  description: "The type of this version bump. Available: patch, minor, major",
94
94
  default_value: "patch",
95
95
  verify_block: proc do |value|
96
- raise "Available values are 'patch', 'minor' and 'major'" unless ['patch', 'minor', 'major'].include? value
96
+ UI.user_error!("Available values are 'patch', 'minor' and 'major'") unless ['patch', 'minor', 'major'].include? value
97
97
  end),
98
98
  FastlaneCore::ConfigItem.new(key: :version_number,
99
99
  env_name: "FL_VERSION_NUMBER_VERSION_NUMBER",
@@ -104,8 +104,8 @@ module Fastlane
104
104
  env_name: "FL_VERSION_NUMBER_PROJECT",
105
105
  description: "optional, you must specify the path to your main Xcode project if it is not in the project root directory",
106
106
  verify_block: proc do |value|
107
- raise "Please pass the path to the project, not the workspace".red if value.end_with? ".xcworkspace"
108
- raise "Could not find Xcode project".red unless File.exist?(value)
107
+ UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with? ".xcworkspace"
108
+ UI.user_error!("Could not find Xcode project") unless File.exist?(value)
109
109
  end,
110
110
  optional: true)
111
111
  ]
@@ -5,7 +5,7 @@ module Fastlane
5
5
  class InstallOnDeviceAction < Action
6
6
  def self.run(params)
7
7
  unless Helper.test?
8
- raise "ios-deploy not installed, see https://github.com/phonegap/ios-deploy for instructions".red if `which ios-deploy`.length == 0
8
+ UI.user_error!("ios-deploy not installed, see https://github.com/phonegap/ios-deploy for instructions") if `which ios-deploy`.length == 0
9
9
  end
10
10
  taxi_cmd = [
11
11
  "ios-deploy",
@@ -60,8 +60,8 @@ module Fastlane
60
60
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || Dir["*.ipa"].first,
61
61
  verify_block: proc do |value|
62
62
  unless Helper.test?
63
- raise "Could not find ipa file at path '#{value}'" unless File.exist? value
64
- raise "'#{value}' doesn't seem to be an ipa file" unless value.end_with? ".ipa"
63
+ UI.user_error!("Could not find ipa file at path '#{value}'") unless File.exist? value
64
+ UI.user_error!("'#{value}' doesn't seem to be an ipa file") unless value.end_with? ".ipa"
65
65
  end
66
66
  end
67
67
  )
@@ -28,8 +28,8 @@ module Fastlane
28
28
  env_name: "FL_XCODE_PLUGIN_URL",
29
29
  description: "URL for Xcode plugin ZIP file",
30
30
  verify_block: proc do |value|
31
- raise "No URL for InstallXcodePluginAction given, pass using `url: 'url'`".red if value.to_s.length == 0
32
- raise "URL doesn't use HTTPS".red unless value.start_with?("https://")
31
+ UI.user_error!("No URL for InstallXcodePluginAction given, pass using `url: 'url'`") if value.to_s.length == 0
32
+ UI.user_error!("URL doesn't use HTTPS") unless value.start_with?("https://")
33
33
  end)
34
34
  ]
35
35
  end
@@ -17,7 +17,7 @@ module Fastlane
17
17
  Actions.lane_context[SharedValues::INSTALLR_BUILD_INFORMATION] = response.body
18
18
  UI.success('Build successfully uploaded to Installr!')
19
19
  else
20
- raise "Error when trying to upload build file to Installr: #{response.body}".red
20
+ UI.user_error!("Error when trying to upload build file to Installr: #{response.body}")
21
21
  end
22
22
  end
23
23
 
@@ -69,14 +69,14 @@ module Fastlane
69
69
  env_name: "INSTALLR_API_TOKEN",
70
70
  description: "API Token for Installr Access",
71
71
  verify_block: proc do |value|
72
- raise "No API token for Installr given, pass using `api_token: 'token'`".red unless value and !value.empty?
72
+ UI.user_error!("No API token for Installr given, pass using `api_token: 'token'`") unless value and !value.empty?
73
73
  end),
74
74
  FastlaneCore::ConfigItem.new(key: :ipa,
75
75
  env_name: "INSTALLR_IPA_PATH",
76
76
  description: "Path to your IPA file. Optional if you use the `gym` or `xcodebuild` action",
77
77
  default_value: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
78
78
  verify_block: proc do |value|
79
- raise "Couldn't find build file at path '#{value}'".red unless File.exist?(value)
79
+ UI.user_error!("Couldn't find build file at path '#{value}'") unless File.exist?(value)
80
80
  end),
81
81
  FastlaneCore::ConfigItem.new(key: :notes,
82
82
  env_name: "INSTALLR_NOTES",
@@ -89,7 +89,7 @@ module Fastlane
89
89
  end
90
90
 
91
91
  # Raise a custom exception, as the the normal one is useless for the user
92
- raise "A build error occured, this is usually related to code signing. Take a look at the error above".red
92
+ UI.user_error!("A build error occured, this is usually related to code signing. Take a look at the error above")
93
93
  end
94
94
  end
95
95
 
@@ -33,7 +33,7 @@ module Fastlane
33
33
  begin
34
34
  build_number = train.builds.map(&:build_version).map(&:to_i).sort.last
35
35
  rescue
36
- raise "could not find a build on iTC - and 'initial_build_number' option is not set" unless params[:initial_build_number]
36
+ UI.user_error!("could not find a build on iTC - and 'initial_build_number' option is not set") unless params[:initial_build_number]
37
37
  build_number = params[:initial_build_number]
38
38
  end
39
39
 
@@ -8,7 +8,7 @@ module Fastlane
8
8
 
9
9
  def self.run(options)
10
10
  unless Helper.test?
11
- raise 'lcov not installed, please install using `brew install lcov`'.red if `which lcov`.length == 0
11
+ UI.user_error!("lcov not installed, please install using `brew install lcov`") if `which lcov`.length == 0
12
12
  end
13
13
  gen_cov(options)
14
14
  end
@@ -74,7 +74,7 @@ module Fastlane
74
74
  optional: false,
75
75
  verify_block: proc do |value|
76
76
  file_path = File.expand_path(value)
77
- raise "Couldn't find file at path '#{file_path}'".red unless File.exist?(file_path)
77
+ UI.user_error!("Couldn't find file at path '#{file_path}'") unless File.exist?(file_path)
78
78
  end),
79
79
  FastlaneCore::ConfigItem.new(key: :repo_id,
80
80
  env_name: "FL_NEXUS_REPO_ID",
@@ -12,7 +12,7 @@ module Fastlane
12
12
  if is_git?
13
13
  command = 'git rev-list HEAD --count'
14
14
  else
15
- raise "Not in a git repository."
15
+ UI.user_error!("Not in a git repository.")
16
16
  end
17
17
  return Actions.sh(command).strip.to_i
18
18
  end
@@ -9,11 +9,11 @@ module Fastlane
9
9
  def self.run(params)
10
10
  oclint_path = params[:oclint_path]
11
11
  if `which #{oclint_path}`.to_s.empty? and !Helper.test?
12
- raise "You have to install oclint or provide path to oclint binary. Fore more details: ".red + "http://docs.oclint.org/en/stable/intro/installation.html".yellow
12
+ UI.user_error!("You have to install oclint or provide path to oclint binary. Fore more details: ") + "http://docs.oclint.org/en/stable/intro/installation.html".yellow
13
13
  end
14
14
 
15
15
  compile_commands = params[:compile_commands]
16
- raise "Could not find json compilation database at path '#{compile_commands}'".red unless File.exist?(compile_commands)
16
+ UI.user_error!("Could not find json compilation database at path '#{compile_commands}'") unless File.exist?(compile_commands)
17
17
 
18
18
  if params[:select_reqex]
19
19
  UI.important("'select_reqex' paramter is deprecated. Please use 'select_regex' instead.")
@@ -51,7 +51,7 @@ module Fastlane
51
51
  when 200, 204
52
52
  puts "Succesfully created new OneSignal app".green
53
53
  else
54
- raise "Unexpected #{response.code} with response: #{response.body}".red
54
+ UI.user_error!("Unexpected #{response.code} with response: #{response.body}")
55
55
  end
56
56
  end
57
57
 
@@ -71,7 +71,7 @@ module Fastlane
71
71
  verify_block: proc do |value|
72
72
  unless value.to_s.length > 0
73
73
  UI.error("Please add 'ENV[\"ONE_SIGNAL_AUTH_KEY\"] = \"your token\"' to your Fastfile's `before_all` section.")
74
- raise 'No ONE_SIGNAL_AUTH_KEY given.'.red
74
+ UI.user_error!("No ONE_SIGNAL_AUTH_KEY given.")
75
75
  end
76
76
  end),
77
77
 
@@ -81,7 +81,7 @@ module Fastlane
81
81
  verify_block: proc do |value|
82
82
  unless value.to_s.length > 0
83
83
  UI.error("Please add 'ENV[\"ONE_SIGNAL_APP_NAME\"] = \"Your app name\"' to your Fastfile's `before_all` section.")
84
- raise 'No ONE_SIGNAL_APP_NAME given.'.red
84
+ UI.user_error!("No ONE_SIGNAL_APP_NAME given.")
85
85
  end
86
86
  end),
87
87
 
@@ -45,8 +45,8 @@ module Fastlane
45
45
  description: "The Podspec you want to push",
46
46
  optional: true,
47
47
  verify_block: proc do |value|
48
- raise "Couldn't find file at path '#{value}'".red unless File.exist?(value)
49
- raise "File must be a `.podspec`".red unless value.end_with?(".podspec")
48
+ UI.user_error!("Couldn't find file at path '#{value}'") unless File.exist?(value)
49
+ UI.user_error!("File must be a `.podspec`") unless value.end_with?(".podspec")
50
50
  end),
51
51
  FastlaneCore::ConfigItem.new(key: :repo,
52
52
  description: "The repo you want to push. Pushes to Trunk by default",
@@ -60,7 +60,7 @@ module Fastlane
60
60
  optional: true,
61
61
  is_string: false,
62
62
  verify_block: proc do |value|
63
- raise "Sources must be an array.".red unless value.kind_of?(Array)
63
+ UI.user_error!("Sources must be an array.") unless value.kind_of?(Array)
64
64
  end)
65
65
  ]
66
66
  end
@@ -39,41 +39,41 @@ module Fastlane
39
39
  description: 'Client ID for Podio API (see https://developers.podio.com/api-key)',
40
40
  is_string: true,
41
41
  verify_block: proc do |value|
42
- raise "No Client ID for Podio given, pass using `client_id: 'id'`".red unless value && !value.empty?
42
+ UI.user_error!("No Client ID for Podio given, pass using `client_id: 'id'`") unless value && !value.empty?
43
43
  end),
44
44
  FastlaneCore::ConfigItem.new(key: :client_secret,
45
45
  env_name: 'PODIO_ITEM_CLIENT_SECRET',
46
46
  description: 'Client secret for Podio API (see https://developers.podio.com/api-key)',
47
47
  is_string: true,
48
48
  verify_block: proc do |value|
49
- raise "No Client Secret for Podio given, pass using `client_secret: 'secret'`".red unless value && !value.empty?
49
+ UI.user_error!("No Client Secret for Podio given, pass using `client_secret: 'secret'`") unless value && !value.empty?
50
50
  end),
51
51
  FastlaneCore::ConfigItem.new(key: :app_id,
52
52
  env_name: 'PODIO_ITEM_APP_ID',
53
53
  description: 'App ID of the app you intend to authenticate with (see https://developers.podio.com/authentication/app_auth)',
54
54
  is_string: true,
55
55
  verify_block: proc do |value|
56
- raise "No App ID for Podio given, pass using `app_id: 'id'`".red unless value && !value.empty?
56
+ UI.user_error!("No App ID for Podio given, pass using `app_id: 'id'`") unless value && !value.empty?
57
57
  end),
58
58
  FastlaneCore::ConfigItem.new(key: :app_token,
59
59
  env_name: 'PODIO_ITEM_APP_TOKEN',
60
60
  description: 'App token of the app you intend to authenticate with (see https://developers.podio.com/authentication/app_auth)',
61
61
  is_string: true,
62
62
  verify_block: proc do |value|
63
- raise "No App token for Podio given, pass using `app_token: 'token'`".red unless value && !value.empty?
63
+ UI.user_error!("No App token for Podio given, pass using `app_token: 'token'`") unless value && !value.empty?
64
64
  end),
65
65
  FastlaneCore::ConfigItem.new(key: :identifying_field,
66
66
  env_name: 'PODIO_ITEM_IDENTIFYING_FIELD',
67
67
  description: 'String specifying the field key used for identification of an item',
68
68
  is_string: true,
69
69
  verify_block: proc do |value|
70
- raise "No Identifying field given, pass using `identifying_field: 'field name'`".red unless value && !value.empty?
70
+ UI.user_error!("No Identifying field given, pass using `identifying_field: 'field name'`") unless value && !value.empty?
71
71
  end),
72
72
  FastlaneCore::ConfigItem.new(key: :identifying_value,
73
73
  description: 'String uniquely specifying an item within the app',
74
74
  is_string: true,
75
75
  verify_block: proc do |value|
76
- raise "No Identifying value given, pass using `identifying_value: 'unique value'`".red unless value && !value.empty?
76
+ UI.user_error!("No Identifying value given, pass using `identifying_value: 'unique value'`") unless value && !value.empty?
77
77
  end),
78
78
  FastlaneCore::ConfigItem.new(key: :other_fields,
79
79
  description: 'Dictionary of your app fields. Podio supports several field types, see https://developers.podio.com/doc/items',
@@ -131,7 +131,7 @@ module Fastlane
131
131
  app_token: app_token,
132
132
  client_id: client_id,
133
133
  client_secret: client_secret
134
- raise 'Failed to authenticate with Podio API' if auth_response.code != 200
134
+ UI.user_error!("Failed to authenticate with Podio API") if auth_response.code != 200
135
135
 
136
136
  auth_response_dictionary = JSON.parse(auth_response.body)
137
137
  access_token = auth_response_dictionary['access_token']
@@ -152,7 +152,7 @@ module Fastlane
152
152
  def self.get_existing_item(auth_config, identifying_value, app_id)
153
153
  filter_request_body = { query: identifying_value, limit: 1, ref_type: 'item' }.to_json
154
154
  filter_response = RestClient.post "#{BASE_URL}/search/app/#{app_id}/", filter_request_body, auth_config
155
- raise "Failed to search for already existing item #{identifying_value}" if filter_response.code != 200
155
+ UI.user_error!("Failed to search for already existing item #{identifying_value}") if filter_response.code != 200
156
156
 
157
157
  existing_items = JSON.parse(filter_response.body)
158
158
  existing_item_id = nil
@@ -171,7 +171,7 @@ module Fastlane
171
171
  def self.create_item(auth_config, identifying_field, identifying_value, app_id)
172
172
  item_request_body = { fields: { identifying_field => identifying_value } }.to_json
173
173
  item_response = RestClient.post "#{BASE_URL}/item/app/#{app_id}", item_request_body, auth_config
174
- raise "Failed to create item \"#{identifying_value}\"" if item_response.code != 200
174
+ UI.user_error!("Failed to create item \"#{identifying_value}\"") if item_response.code != 200
175
175
 
176
176
  item_response_dictionary = JSON.parse(item_response.body)
177
177
  [item_response_dictionary['item_id'], item_response_dictionary['link']]
@@ -181,14 +181,14 @@ module Fastlane
181
181
  if fields.length > 0
182
182
  item_request_body = { fields: fields }.to_json
183
183
  item_response = RestClient.put "#{BASE_URL}/item/#{item_id}", item_request_body, auth_config
184
- raise "Failed to update item values \"#{fields}\"" unless item_response.code != 200 || item_response.code != 204
184
+ UI.user_error!("Failed to update item values \"#{fields}\"") unless item_response.code != 200 || item_response.code != 204
185
185
  end
186
186
  end
187
187
 
188
188
  def self.get_embed_id(auth_config, url)
189
189
  embed_request_body = { url: url }.to_json
190
190
  embed_response = RestClient.post "#{BASE_URL}/embed/", embed_request_body, auth_config
191
- raise "Failed to create embed for link #{link}" if embed_response.code != 200
191
+ UI.user_error!("Failed to create embed for link #{link}") if embed_response.code != 200
192
192
 
193
193
  embed_response_dictionary = JSON.parse(embed_response.body)
194
194
  embed_response_dictionary['embed_id']