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
@@ -11,7 +11,7 @@ module Fastlane
11
11
  }.merge(params || {})
12
12
 
13
13
  [:message, :topic_id, :typetalk_token].each do |key|
14
- raise "No #{key} given.".red unless options[key]
14
+ UI.user_error!("No #{key} given.") unless options[key]
15
15
  end
16
16
 
17
17
  emoticon = (options[:success] ? ':smile:' : ':rage:')
@@ -47,7 +47,7 @@ module Fastlane
47
47
  when 200, 204
48
48
  true
49
49
  else
50
- raise "Could not sent Typetalk notification".red
50
+ UI.user_error!("Could not sent Typetalk notification")
51
51
  end
52
52
  end
53
53
 
@@ -63,7 +63,7 @@ module Fastlane
63
63
  end
64
64
  end
65
65
 
66
- raise "Could not find the keychain file in: #{possible_locations}".red
66
+ UI.user_error!("Could not find the keychain file in: #{possible_locations}")
67
67
  end
68
68
 
69
69
  #####################################################
@@ -12,15 +12,15 @@ module Fastlane
12
12
  UI.message("New App Group Identifiers: #{params[:app_group_identifiers]}")
13
13
 
14
14
  entitlements_file = params[:entitlements_file]
15
- raise "Could not find entitlements file at path '#{entitlements_file}'".red unless File.exist?(entitlements_file)
15
+ UI.user_error!("Could not find entitlements file at path '#{entitlements_file}'") unless File.exist?(entitlements_file)
16
16
 
17
17
  # parse entitlements
18
18
  result = Plist.parse_xml(entitlements_file)
19
- raise "Entitlements file at '#{entitlements_file}' cannot be parsed.".red unless result
19
+ UI.user_error!("Entitlements file at '#{entitlements_file}' cannot be parsed.") unless result
20
20
 
21
21
  # get app group field
22
22
  app_group_field = result['com.apple.security.application-groups']
23
- raise 'No existing App group field specified. Please specify an App Group in the entitlements file.'.red unless app_group_field
23
+ UI.user_error!("No existing App group field specified. Please specify an App Group in the entitlements file.") unless app_group_field
24
24
 
25
25
  # set new app group identifiers
26
26
  UI.message("Old App Group Identifiers: #{app_group_field}")
@@ -43,15 +43,15 @@ module Fastlane
43
43
  env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_ENTITLEMENTS_FILE_PATH", # The name of the environment variable
44
44
  description: "The path to the entitlement file which contains the app group identifiers", # a short description of this parameter
45
45
  verify_block: proc do |value|
46
- raise "Please pass a path to an entitlements file. ".red unless value.include? ".entitlements"
47
- raise "Could not find entitlements file".red if !File.exist?(value) and !Helper.is_test?
46
+ UI.user_error!("Please pass a path to an entitlements file. ") unless value.include? ".entitlements"
47
+ UI.user_error!("Could not find entitlements file") if !File.exist?(value) and !Helper.is_test?
48
48
  end),
49
49
  FastlaneCore::ConfigItem.new(key: :app_group_identifiers,
50
50
  env_name: "FL_UPDATE_APP_GROUP_IDENTIFIER_APP_GROUP_IDENTIFIERS",
51
51
  description: "An Array of unique identifiers for the app groups. Eg. ['group.com.test.testapp']",
52
52
  is_string: false,
53
53
  verify_block: proc do |value|
54
- raise "The parameter app_group_identifiers need to be an Array.".red unless value.kind_of? Array
54
+ UI.user_error!("The parameter app_group_identifiers need to be an Array.") unless value.kind_of? Array
55
55
  end)
56
56
  ]
57
57
  end
@@ -10,7 +10,7 @@ module Fastlane
10
10
 
11
11
  # Read existing plist file
12
12
  info_plist_path = File.join(params[:xcodeproj], '..', params[:plist_path])
13
- raise "Couldn't find info plist file at path '#{params[:plist_path]}'".red unless File.exist?(info_plist_path)
13
+ UI.user_error!("Couldn't find info plist file at path '#{params[:plist_path]}'") unless File.exist?(info_plist_path)
14
14
  plist = Plist.parse_xml(info_plist_path)
15
15
 
16
16
  # Check if current app identifier product bundle identifier
@@ -21,10 +21,10 @@ module Fastlane
21
21
 
22
22
  # Fetch the build configuration objects
23
23
  configs = project.objects.select { |obj| obj.isa == 'XCBuildConfiguration' && !obj.build_settings[identifier_key].nil? }
24
- raise "Info plist uses $(#{identifier_key}), but xcodeproj does not".red unless configs.count > 0
24
+ UI.user_error!("Info plist uses $(#{identifier_key}), but xcodeproj does not") unless configs.count > 0
25
25
 
26
26
  configs = configs.select { |obj| obj.build_settings[info_plist_key] == params[:plist_path] }
27
- raise "Xcodeproj doesn't have configuration with info plist #{params[:plist_path]}.".red unless configs.count > 0
27
+ UI.user_error!("Xcodeproj doesn't have configuration with info plist #{params[:plist_path]}.") unless configs.count > 0
28
28
 
29
29
  # For each of the build configurations, set app identifier
30
30
  configs.each do |c|
@@ -66,14 +66,14 @@ module Fastlane
66
66
  description: "Path to your Xcode project",
67
67
  default_value: Dir['*.xcodeproj'].first,
68
68
  verify_block: proc do |value|
69
- raise "Please pass the path to the project, not the workspace".red unless value.end_with?(".xcodeproj")
70
- raise "Could not find Xcode project".red unless File.exist?(value)
69
+ UI.user_error!("Please pass the path to the project, not the workspace") unless value.end_with?(".xcodeproj")
70
+ UI.user_error!("Could not find Xcode project") unless File.exist?(value)
71
71
  end),
72
72
  FastlaneCore::ConfigItem.new(key: :plist_path,
73
73
  env_name: "FL_UPDATE_APP_IDENTIFIER_PLIST_PATH",
74
74
  description: "Path to info plist, relative to your Xcode project",
75
75
  verify_block: proc do |value|
76
- raise "Invalid plist file".red unless value[-6..-1].casecmp(".plist").zero?
76
+ UI.user_error!("Invalid plist file") unless value[-6..-1].casecmp(".plist").zero?
77
77
  end),
78
78
  FastlaneCore::ConfigItem.new(key: :app_identifier,
79
79
  env_name: 'FL_UPDATE_APP_IDENTIFIER',
@@ -19,7 +19,7 @@ module Fastlane
19
19
 
20
20
  # Read existing plist file
21
21
  info_plist_path = File.join(folder, "..", params[:plist_path])
22
- raise "Couldn't find info plist file at path '#{params[:plist_path]}'".red unless File.exist?(info_plist_path)
22
+ UI.user_error!("Couldn't find info plist file at path '#{params[:plist_path]}'") unless File.exist?(info_plist_path)
23
23
  plist = Plist.parse_xml(info_plist_path)
24
24
 
25
25
  # Update plist values
@@ -59,14 +59,14 @@ module Fastlane
59
59
  description: "Path to your Xcode project",
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 unless File.exist?(value)
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") unless File.exist?(value)
64
64
  end),
65
65
  FastlaneCore::ConfigItem.new(key: :plist_path,
66
66
  env_name: "FL_UPDATE_PLIST_PATH",
67
67
  description: "Path to info plist",
68
68
  verify_block: proc do |value|
69
- raise "Invalid plist file".red unless value[-6..-1].casecmp(".plist").zero?
69
+ UI.user_error!("Invalid plist file") unless value[-6..-1].casecmp(".plist").zero?
70
70
  end),
71
71
  FastlaneCore::ConfigItem.new(key: :app_identifier,
72
72
  env_name: 'FL_UPDATE_PLIST_APP_IDENTIFIER',
@@ -11,7 +11,7 @@ module Fastlane
11
11
 
12
12
  path = params[:path]
13
13
  path = File.join(path, "project.pbxproj")
14
- raise "Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!".red unless File.exist?(path)
14
+ UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
15
15
 
16
16
  UI.message("Updating provisioning profile UDID (#{params[:udid]}) for the given project '#{path}'")
17
17
 
@@ -35,7 +35,7 @@ module Fastlane
35
35
  env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
36
36
  description: "Path to your Xcode project",
37
37
  verify_block: proc do |value|
38
- raise "Path is invalid".red unless File.exist?(value)
38
+ UI.user_error!("Path is invalid") unless File.exist?(value)
39
39
  end),
40
40
  FastlaneCore::ConfigItem.new(key: :udid,
41
41
  env_name: "FL_PROJECT_SIGNING_UDID",
@@ -15,7 +15,7 @@ module Fastlane
15
15
 
16
16
  # validate folder
17
17
  project_file_path = File.join(folder, "project.pbxproj")
18
- raise "Could not find path to project config '#{project_file_path}'. Pass the path to your project (not workspace)!".red unless File.exist?(project_file_path)
18
+ UI.user_error!("Could not find path to project config '#{project_file_path}'. Pass the path to your project (not workspace)!") unless File.exist?(project_file_path)
19
19
 
20
20
  # download certificate
21
21
  unless File.exist?(params[:certificate])
@@ -31,7 +31,7 @@ module Fastlane
31
31
  profile = File.read(params[:profile])
32
32
  p7 = OpenSSL::PKCS7.new(profile)
33
33
  store = OpenSSL::X509::Store.new
34
- raise "Could not find valid certificate at '#{params[:certificate]}'" unless File.size(params[:certificate]) > 0
34
+ UI.user_error!("Could not find valid certificate at '#{params[:certificate]}'") unless File.size(params[:certificate]) > 0
35
35
  cert = OpenSSL::X509::Certificate.new(File.read(params[:certificate]))
36
36
  store.add_cert(cert)
37
37
  p7.verify([cert], store)
@@ -94,14 +94,14 @@ module Fastlane
94
94
  description: "Path to your Xcode project",
95
95
  optional: true,
96
96
  verify_block: proc do |value|
97
- raise "Path to xcode project is invalid".red unless File.exist?(value)
97
+ UI.user_error!("Path to xcode project is invalid") unless File.exist?(value)
98
98
  end),
99
99
  FastlaneCore::ConfigItem.new(key: :profile,
100
100
  env_name: "FL_PROJECT_PROVISIONING_PROFILE_FILE",
101
101
  description: "Path to provisioning profile (.mobileprovision)",
102
102
  default_value: Actions.lane_context[SharedValues::SIGH_PROFILE_PATH],
103
103
  verify_block: proc do |value|
104
- raise "Path to provisioning profile is invalid".red unless File.exist?(value)
104
+ UI.user_error!("Path to provisioning profile is invalid") unless File.exist?(value)
105
105
  end),
106
106
  FastlaneCore::ConfigItem.new(key: :target_filter,
107
107
  env_name: "FL_PROJECT_PROVISIONING_PROFILE_TARGET_FILTER",
@@ -7,7 +7,7 @@ module Fastlane
7
7
  def self.run(params)
8
8
  path = params[:path]
9
9
  path = File.join(path, "project.pbxproj")
10
- raise "Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!".red unless File.exist?(path)
10
+ UI.user_error!("Could not find path to project config '#{path}'. Pass the path to your project (not workspace)!") unless File.exist?(path)
11
11
 
12
12
  UI.message("Updating development team (#{params[:teamid]}) for the given project '#{path}'")
13
13
 
@@ -31,7 +31,7 @@ module Fastlane
31
31
  env_name: "FL_PROJECT_SIGNING_PROJECT_PATH",
32
32
  description: "Path to your Xcode project",
33
33
  verify_block: proc do |value|
34
- raise "Path is invalid".red unless File.exist?(value)
34
+ UI.user_error!("Path is invalid") unless File.exist?(value)
35
35
  end),
36
36
  FastlaneCore::ConfigItem.new(key: :teamid,
37
37
  env_name: "FL_PROJECT_TEAM_ID",
@@ -25,7 +25,7 @@ module Fastlane
25
25
  is_string: true,
26
26
  optional: false,
27
27
  verify_block: proc do |path|
28
- raise "Could not find plist at path '#{path}'".red unless File.exist?(path)
28
+ UI.user_error!("Could not find plist at path '#{path}'") unless File.exist?(path)
29
29
  end
30
30
  ),
31
31
 
@@ -9,6 +9,7 @@ module Fastlane
9
9
  Dir["./**/Info.plist"].each do |current|
10
10
  result = Actions::GetInfoPlistValueAction.run(path: current, key: "Fabric")
11
11
  next unless result
12
+ next unless result.kind_of?(Hash)
12
13
  params[:api_token] ||= result["APIKey"]
13
14
  end
14
15
  end
@@ -69,19 +69,19 @@ module Fastlane
69
69
  env_name: "SENTRY_API_KEY",
70
70
  description: "API Key for Sentry",
71
71
  verify_block: proc do |value|
72
- raise "No API token for SentryAction given, pass using `api_key: 'key'`".red unless value and !value.empty?
72
+ UI.user_error!("No API token for SentryAction given, pass using `api_key: 'key'`") unless value and !value.empty?
73
73
  end),
74
74
  FastlaneCore::ConfigItem.new(key: :org_slug,
75
75
  env_name: "SENTRY_ORG_SLUG",
76
76
  description: "Organization slug for Sentry project",
77
77
  verify_block: proc do |value|
78
- raise "No organization slug for SentryAction given, pass using `org_slug: 'org'`".red unless value and !value.empty?
78
+ UI.user_error!("No organization slug for SentryAction given, pass using `org_slug: 'org'`") unless value and !value.empty?
79
79
  end),
80
80
  FastlaneCore::ConfigItem.new(key: :project_slug,
81
81
  env_name: "SENTRY_PROJECT_SLUG",
82
82
  description: "Prgoject slug for Sentry",
83
83
  verify_block: proc do |value|
84
- raise "No project slug for SentryAction given, pass using `project_slug: 'project'`".red unless value and !value.empty?
84
+ UI.user_error!("No project slug for SentryAction given, pass using `project_slug: 'project'`") unless value and !value.empty?
85
85
  end),
86
86
  FastlaneCore::ConfigItem.new(key: :dsym_path,
87
87
  env_name: "SENTRY_DSYM_PATH",
@@ -23,11 +23,11 @@ module Fastlane
23
23
 
24
24
  def self.app_path(params, dir)
25
25
  ipa_path = params[:ipa_path] || Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] || ''
26
- raise "Unable to find ipa file '#{ipa_path}'." unless File.exist?(ipa_path)
26
+ UI.user_error!("Unable to find ipa file '#{ipa_path}'.") unless File.exist?(ipa_path)
27
27
  ipa_path = File.expand_path(ipa_path)
28
28
 
29
29
  `unzip '#{ipa_path}' -d #{dir}`
30
- raise "Unable to unzip ipa".red unless $? == 0
30
+ UI.user_error!("Unable to unzip ipa") unless $? == 0
31
31
 
32
32
  app_path = File.expand_path("#{dir}/Payload/*.app")
33
33
 
@@ -36,7 +36,7 @@ module Fastlane
36
36
 
37
37
  def self.gather_cert_info(app_path)
38
38
  cert_info = `codesign -vv -d #{app_path} 2>&1`
39
- raise "Unable to verify code signing".red unless $? == 0
39
+ UI.user_error!("Unable to verify code signing") unless $? == 0
40
40
 
41
41
  values = {}
42
42
 
@@ -59,7 +59,7 @@ module Fastlane
59
59
 
60
60
  def self.update_with_profile_info(app_path, values)
61
61
  profile = `cat #{app_path}/embedded.mobileprovision | security cms -D`
62
- raise "Unable to extract profile".red unless $? == 0
62
+ UI.user_error!("Unable to extract profile") unless $? == 0
63
63
 
64
64
  plist = Plist.parse_xml(profile)
65
65
 
@@ -70,8 +70,8 @@ module Fastlane
70
70
  application_identifier_prefix = plist['ApplicationIdentifierPrefix'][0]
71
71
  full_bundle_identifier = "#{application_identifier_prefix}.#{values['bundle_identifier']}"
72
72
 
73
- raise "Inconsistent identifier found; #{plist['Entitlements']['application-identifier']}, found in the embedded.mobileprovision file, should match #{full_bundle_identifier}, which is embedded in the codesign identity" unless plist['Entitlements']['application-identifier'] == full_bundle_identifier
74
- raise "Inconsistent identifier found" unless plist['Entitlements']['com.apple.developer.team-identifier'] == values['team_identifier']
73
+ UI.user_error!("Inconsistent identifier found; #{plist['Entitlements']['application-identifier']}, found in the embedded.mobileprovision file, should match #{full_bundle_identifier}, which is embedded in the codesign identity") unless plist['Entitlements']['application-identifier'] == full_bundle_identifier
74
+ UI.user_error!("Inconsistent identifier found") unless plist['Entitlements']['com.apple.developer.team-identifier'] == values['team_identifier']
75
75
 
76
76
  values
77
77
  end
@@ -103,22 +103,22 @@ module Fastlane
103
103
 
104
104
  def self.evaulate(params, values)
105
105
  if params[:provisioning_type]
106
- raise "Mismatched provisioning_type. Required: '#{params[:provisioning_type]}''; Found: '#{values['provisioning_type']}'".red unless params[:provisioning_type] == values['provisioning_type']
106
+ UI.user_error!("Mismatched provisioning_type. Required: '#{params[:provisioning_type]}''; Found: '#{values['provisioning_type']}'") unless params[:provisioning_type] == values['provisioning_type']
107
107
  end
108
108
  if params[:provisioning_uuid]
109
- raise "Mismatched provisioning_uuid. Required: '#{params[:provisioning_uuid]}'; Found: '#{values['provisioning_uuid']}'".red unless params[:provisioning_uuid] == values['provisioning_uuid']
109
+ UI.user_error!("Mismatched provisioning_uuid. Required: '#{params[:provisioning_uuid]}'; Found: '#{values['provisioning_uuid']}'") unless params[:provisioning_uuid] == values['provisioning_uuid']
110
110
  end
111
111
  if params[:team_identifier]
112
- raise "Mismatched team_identifier. Required: '#{params[:team_identifier]}'; Found: '#{values['team_identifier']}'".red unless params[:team_identifier] == values['team_identifier']
112
+ UI.user_error!("Mismatched team_identifier. Required: '#{params[:team_identifier]}'; Found: '#{values['team_identifier']}'") unless params[:team_identifier] == values['team_identifier']
113
113
  end
114
114
  if params[:team_name]
115
- raise "Mismatched team_name. Required: '#{params[:team_name]}'; Found: 'values['team_name']'".red unless params[:team_name] == values['team_name']
115
+ UI.user_error!("Mismatched team_name. Required: '#{params[:team_name]}'; Found: 'values['team_name']'") unless params[:team_name] == values['team_name']
116
116
  end
117
117
  if params[:app_name]
118
- raise "Mismatched app_name. Required: '#{params[:app_name]}'; Found: '#{values['app_name']}'".red unless params[:app_name] == values['app_name']
118
+ UI.user_error!("Mismatched app_name. Required: '#{params[:app_name]}'; Found: '#{values['app_name']}'") unless params[:app_name] == values['app_name']
119
119
  end
120
120
  if params[:bundle_identifier]
121
- raise "Mismatched bundle_identifier. Required: '#{params[:bundle_identifier]}'; Found: '#{values['bundle_identifier']}'".red unless params[:bundle_identifier] == values['bundle_identifier']
121
+ UI.user_error!("Mismatched bundle_identifier. Required: '#{params[:bundle_identifier]}'; Found: '#{values['bundle_identifier']}'") unless params[:bundle_identifier] == values['bundle_identifier']
122
122
  end
123
123
 
124
124
  UI.success "Build is verified, have a 🍪."
@@ -143,7 +143,7 @@ module Fastlane
143
143
  optional: true,
144
144
  verify_block: proc do |value|
145
145
  av = %w(distribution development)
146
- raise "Unsupported provisioning_type, must be: #{av}" unless av.include?(value)
146
+ UI.user_error!("Unsupported provisioning_type, must be: #{av}") unless av.include?(value)
147
147
  end),
148
148
  FastlaneCore::ConfigItem.new(key: :provisioning_uuid,
149
149
  env_name: "FL_VERIFY_BUILD_PROVISIONING_UUID",
@@ -64,7 +64,7 @@ module Fastlane
64
64
  UI.error("This might be a false alarm, if so, please submit an issue on GitHub")
65
65
  UI.error("The following information couldn't be found:")
66
66
  UI.error(error)
67
- raise "The Xcode installation at path '#{xcode_path}' might be compromised."
67
+ UI.user_error!("The Xcode installation at path '#{xcode_path}' might be compromised.")
68
68
  end
69
69
 
70
70
  #####################################################
@@ -90,7 +90,7 @@ module Fastlane
90
90
  description: "The path to the Xcode installation to test",
91
91
  default_value: File.expand_path('../../', FastlaneCore::Helper.xcode_path),
92
92
  verify_block: proc do |value|
93
- raise "Couldn't find Xcode at path '#{value}'".red unless File.exist?(value)
93
+ UI.user_error!("Couldn't find Xcode at path '#{value}'") unless File.exist?(value)
94
94
  end)
95
95
  ]
96
96
  end
@@ -8,7 +8,7 @@ module Fastlane
8
8
  def self.run(params)
9
9
  podspec_path = params[:path]
10
10
 
11
- raise "Could not find podspec file at path #{podspec_path}".red unless File.exist? podspec_path
11
+ UI.user_error!("Could not find podspec file at path #{podspec_path}") unless File.exist? podspec_path
12
12
 
13
13
  version_podspec_file = Helper::PodspecHelper.new(podspec_path)
14
14
 
@@ -45,14 +45,14 @@ module Fastlane
45
45
  description: "You must specify the path to the podspec file to update",
46
46
  default_value: Dir["*.podspec"].last,
47
47
  verify_block: proc do |value|
48
- raise "Please pass a path to the `version_bump_podspec` action".red if value.length == 0
48
+ UI.user_error!("Please pass a path to the `version_bump_podspec` action") if value.length == 0
49
49
  end),
50
50
  FastlaneCore::ConfigItem.new(key: :bump_type,
51
51
  env_name: "FL_VERSION_BUMP_PODSPEC_BUMP_TYPE",
52
52
  description: "The type of this version bump. Available: patch, minor, major",
53
53
  default_value: "patch",
54
54
  verify_block: proc do |value|
55
- raise "Available values are 'patch', 'minor' and 'major'" unless ['patch', 'minor', 'major'].include? value
55
+ UI.user_error!("Available values are 'patch', 'minor' and 'major'") unless ['patch', 'minor', 'major'].include? value
56
56
  end),
57
57
  FastlaneCore::ConfigItem.new(key: :version_number,
58
58
  env_name: "FL_VERSION_BUMP_PODSPEC_VERSION_NUMBER",
@@ -4,7 +4,7 @@ module Fastlane
4
4
  def self.run(params)
5
5
  podspec_path = params[:path]
6
6
 
7
- raise "Could not find podspec file at path '#{podspec_path}'".red unless File.exist? podspec_path
7
+ UI.user_error!("Could not find podspec file at path '#{podspec_path}'") unless File.exist? podspec_path
8
8
 
9
9
  version_podspec_file = Helper::PodspecHelper.new(podspec_path)
10
10
 
@@ -27,7 +27,7 @@ module Fastlane
27
27
  is_string: true,
28
28
  default_value: Dir["*.podspec"].last,
29
29
  verify_block: proc do |value|
30
- raise "Please pass a path to the `version_get_podspec` action".red if value.length == 0
30
+ UI.user_error!("Please pass a path to the `version_get_podspec` action") if value.length == 0
31
31
  end)
32
32
  ]
33
33
  end
@@ -20,7 +20,7 @@ module Fastlane
20
20
  end
21
21
 
22
22
  xcode = installer.installed_versions.find { |x| x.version == params[:version] }
23
- raise "Could not find Xcode with version '#{params[:version]}'" unless xcode
23
+ UI.user_error!("Could not find Xcode with version '#{params[:version]}'") unless xcode
24
24
  UI.message("Using Xcode #{params[:version]} on path '#{xcode.path}'")
25
25
  xcode.approve_license
26
26
 
@@ -23,10 +23,10 @@ module Fastlane
23
23
  xcode_path = (params || []).first
24
24
 
25
25
  # Verify that a param was passed in
26
- raise "Path to Xcode application required (e.x. \"/Applications/Xcode.app\")".red unless xcode_path.to_s.length > 0
26
+ UI.user_error!("Path to Xcode application required (e.x. \"/Applications/Xcode.app\")") unless xcode_path.to_s.length > 0
27
27
 
28
28
  # Verify that a path to a directory was passed in
29
- raise "Path '#{xcode_path}' doesn't exist".red unless Dir.exist?(xcode_path)
29
+ UI.user_error!("Path '#{xcode_path}' doesn't exist") unless Dir.exist?(xcode_path)
30
30
 
31
31
  UI.message("Setting Xcode version to #{xcode_path} for all build steps")
32
32
 
@@ -37,7 +37,7 @@ module Fastlane
37
37
 
38
38
  # match the bot name with a found bot, otherwise fail
39
39
  found_bots = bots.select { |bot| bot['name'] == bot_name }
40
- raise "Failed to find a Bot with name #{bot_name} on server #{host}, only available Bots: #{bot_names}".red if found_bots.count == 0
40
+ UI.user_error!("Failed to find a Bot with name #{bot_name} on server #{host}, only available Bots: #{bot_names}") if found_bots.count == 0
41
41
 
42
42
  bot = found_bots[0]
43
43
 
@@ -45,12 +45,12 @@ module Fastlane
45
45
 
46
46
  # we have our bot, get finished integrations, sorted from newest to oldest
47
47
  integrations = xcs.fetch_integrations(bot['_id']).select { |i| i['currentStep'] == 'completed' }
48
- raise "Failed to find any completed integration for Bot \"#{bot_name}\"".red if (integrations || []).count == 0
48
+ UI.user_error!("Failed to find any completed integration for Bot \"#{bot_name}\"") if (integrations || []).count == 0
49
49
 
50
50
  # if no integration number is specified, pick the newest one (this is sorted from newest to oldest)
51
51
  if integration_number_override
52
52
  integration = integrations.find { |i| i['number'] == integration_number_override }
53
- raise "Specified integration number #{integration_number_override} does not exist.".red unless integration
53
+ UI.user_error!("Specified integration number #{integration_number_override} does not exist.") unless integration
54
54
  else
55
55
  integration = integrations.first
56
56
  end
@@ -61,7 +61,7 @@ module Fastlane
61
61
 
62
62
  # fetch assets for this integration
63
63
  assets_path = xcs.fetch_assets(integration['_id'], target_folder, self)
64
- raise "Failed to fetch assets for integration #{integration['number']}." unless assets_path
64
+ UI.user_error!("Failed to fetch assets for integration #{integration['number']}.") unless assets_path
65
65
 
66
66
  asset_entries = Dir.entries(assets_path).map { |i| File.join(assets_path, i) }
67
67
 
@@ -117,14 +117,14 @@ module Fastlane
117
117
 
118
118
  def fetch_all_bots
119
119
  response = get_endpoint('/bots')
120
- raise "You are unauthorized to access data on #{@host}, please check that you're passing in a correct username and password.".red if response.status == 401
121
- raise "Failed to fetch Bots from Xcode Server at #{@host}, response: #{response.status}: #{response.body}.".red if response.status != 200
120
+ UI.user_error!("You are unauthorized to access data on #{@host}, please check that you're passing in a correct username and password.") if response.status == 401
121
+ UI.user_error!("Failed to fetch Bots from Xcode Server at #{@host}, response: #{response.status}: #{response.body}.") if response.status != 200
122
122
  JSON.parse(response.body)['results']
123
123
  end
124
124
 
125
125
  def fetch_integrations(bot_id)
126
126
  response = get_endpoint("/bots/#{bot_id}/integrations?last=10")
127
- raise "Failed to fetch Integrations for Bot #{bot_id} from Xcode Server at #{@host}, response: #{response.status}: #{response.body}".red if response.status != 200
127
+ UI.user_error!("Failed to fetch Integrations for Bot #{bot_id} from Xcode Server at #{@host}, response: #{response.status}: #{response.body}") if response.status != 200
128
128
  JSON.parse(response.body)['results']
129
129
  end
130
130
 
@@ -145,8 +145,8 @@ module Fastlane
145
145
  response = self.get_endpoint("/integrations/#{integration_id}/assets", streamer)
146
146
  f.close
147
147
 
148
- raise "Integration doesn't have any assets (it probably never ran).".red if response.status == 500
149
- raise "Failed to fetch Assets zip for Integration #{integration_id} from Xcode Server at #{@host}, response: #{response.status}: #{response.body}".red if response.status != 200
148
+ UI.user_error!("Integration doesn't have any assets (it probably never ran).") if response.status == 500
149
+ UI.user_error!("Failed to fetch Assets zip for Integration #{integration_id} from Xcode Server at #{@host}, response: #{response.status}: #{response.body}") if response.status != 200
150
150
 
151
151
  # unzip it, it's a .tar.gz file
152
152
  out_folder = File.join(dir, "out_#{rand(1000000)}")
@@ -161,7 +161,7 @@ module Fastlane
161
161
  # rename the folder in out_folder to asset_foldername
162
162
  found_folder = Dir.entries(out_folder).select { |item| item != '.' && item != '..' }[0]
163
163
 
164
- raise "Internal error, couldn't find unzipped folder".red if found_folder.nil?
164
+ UI.user_error!("Internal error, couldn't find unzipped folder") if found_folder.nil?
165
165
 
166
166
  unzipped_folder_temp_name = File.join(out_folder, found_folder)
167
167
  unzipped_folder = File.join(out_folder, asset_foldername)