fastlane 2.181.0 → 2.184.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +90 -90
  3. data/cert/lib/cert/commands_generator.rb +2 -1
  4. data/cert/lib/cert/runner.rb +3 -7
  5. data/deliver/lib/assets/summary.html.erb +10 -10
  6. data/deliver/lib/deliver/commands_generator.rb +3 -2
  7. data/deliver/lib/deliver/detect_values.rb +5 -3
  8. data/deliver/lib/deliver/download_screenshots.rb +1 -1
  9. data/deliver/lib/deliver/html_generator.rb +2 -2
  10. data/deliver/lib/deliver/languages.rb +1 -1
  11. data/deliver/lib/deliver/module.rb +6 -0
  12. data/deliver/lib/deliver/options.rb +38 -53
  13. data/deliver/lib/deliver/runner.rb +8 -11
  14. data/deliver/lib/deliver/setup.rb +1 -1
  15. data/deliver/lib/deliver/submit_for_review.rb +4 -4
  16. data/deliver/lib/deliver/upload_metadata.rb +20 -6
  17. data/deliver/lib/deliver/upload_price_tier.rb +1 -1
  18. data/deliver/lib/deliver/upload_screenshots.rb +1 -1
  19. data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
  20. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +7 -11
  21. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +12 -2
  22. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -1
  23. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +5 -1
  24. data/fastlane/lib/fastlane/actions/danger.rb +7 -1
  25. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  26. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +18 -1
  27. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +32 -12
  28. data/fastlane/lib/fastlane/actions/get_certificates.rb +5 -1
  29. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +3 -1
  30. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +5 -1
  31. data/fastlane/lib/fastlane/actions/git_commit.rb +3 -1
  32. data/fastlane/lib/fastlane/actions/git_pull.rb +4 -10
  33. data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
  34. data/fastlane/lib/fastlane/actions/hipchat.rb +2 -1
  35. data/fastlane/lib/fastlane/actions/import_from_git.rb +5 -5
  36. data/fastlane/lib/fastlane/actions/notification.rb +1 -1
  37. data/fastlane/lib/fastlane/actions/register_device.rb +7 -10
  38. data/fastlane/lib/fastlane/actions/register_devices.rb +7 -10
  39. data/fastlane/lib/fastlane/actions/set_changelog.rb +7 -10
  40. data/fastlane/lib/fastlane/actions/slack.rb +19 -18
  41. data/fastlane/lib/fastlane/actions/swiftlint.rb +16 -4
  42. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +6 -1
  43. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -2
  44. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +5 -1
  45. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +2 -1
  46. data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -5
  47. data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
  48. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  49. data/fastlane/lib/fastlane/fast_file.rb +10 -2
  50. data/fastlane/lib/fastlane/notification/slack.rb +56 -0
  51. data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
  52. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
  53. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
  54. data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
  55. data/fastlane/lib/fastlane/swift_fastlane_function.rb +37 -14
  56. data/fastlane/lib/fastlane/version.rb +2 -2
  57. data/fastlane/swift/Deliverfile.swift +1 -1
  58. data/fastlane/swift/DeliverfileProtocol.swift +20 -20
  59. data/fastlane/swift/Fastlane.swift +6749 -3708
  60. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
  61. data/fastlane/swift/Gymfile.swift +1 -1
  62. data/fastlane/swift/GymfileProtocol.swift +1 -1
  63. data/fastlane/swift/Matchfile.swift +1 -1
  64. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  65. data/fastlane/swift/OptionalConfigValue.swift +101 -0
  66. data/fastlane/swift/Precheckfile.swift +1 -1
  67. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  68. data/fastlane/swift/Scanfile.swift +1 -1
  69. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  70. data/fastlane/swift/Screengrabfile.swift +1 -1
  71. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  72. data/fastlane/swift/Snapshotfile.swift +1 -1
  73. data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
  74. data/fastlane/swift/formatting/Brewfile.lock.json +12 -12
  75. data/fastlane/swift/upgrade_manifest.json +1 -1
  76. data/fastlane_core/lib/fastlane_core/build_watcher.rb +39 -3
  77. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +5 -0
  78. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +2 -0
  79. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +1 -1
  80. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  81. data/fastlane_core/lib/fastlane_core/helper.rb +4 -4
  82. data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
  83. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  84. data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
  85. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
  86. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +4 -1
  87. data/frameit/lib/frameit/commands_generator.rb +2 -1
  88. data/frameit/lib/frameit/config_parser.rb +2 -2
  89. data/frameit/lib/frameit/frame_downloader.rb +2 -1
  90. data/gym/lib/gym/code_signing_mapping.rb +2 -2
  91. data/gym/lib/gym/commands_generator.rb +2 -1
  92. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +6 -5
  93. data/match/lib/match/commands_generator.rb +2 -1
  94. data/match/lib/match/importer.rb +6 -10
  95. data/match/lib/match/migrate.rb +2 -3
  96. data/match/lib/match/nuke.rb +3 -7
  97. data/match/lib/match/runner.rb +2 -3
  98. data/match/lib/match/spaceship_ensure.rb +3 -0
  99. data/match/lib/match/storage/google_cloud_storage.rb +2 -2
  100. data/match/lib/match/storage/s3_storage.rb +2 -2
  101. data/pem/lib/pem/commands_generator.rb +2 -1
  102. data/pilot/lib/pilot/build_manager.rb +5 -3
  103. data/pilot/lib/pilot/commands_generator.rb +2 -1
  104. data/pilot/lib/pilot/manager.rb +3 -7
  105. data/pilot/lib/pilot/options.rb +10 -2
  106. data/pilot/lib/pilot/tester_exporter.rb +0 -1
  107. data/pilot/lib/pilot/tester_manager.rb +0 -1
  108. data/precheck/lib/precheck/commands_generator.rb +2 -1
  109. data/precheck/lib/precheck/runner.rb +8 -7
  110. data/produce/lib/produce/commands_generator.rb +2 -1
  111. data/scan/lib/scan/commands_generator.rb +2 -1
  112. data/scan/lib/scan/runner.rb +1 -1
  113. data/screengrab/lib/screengrab/commands_generator.rb +2 -1
  114. data/sigh/lib/assets/resign.sh +77 -46
  115. data/sigh/lib/sigh/commands_generator.rb +2 -1
  116. data/sigh/lib/sigh/download_all.rb +4 -8
  117. data/sigh/lib/sigh/runner.rb +4 -8
  118. data/snapshot/lib/assets/SnapfileTemplate +1 -1
  119. data/snapshot/lib/snapshot/commands_generator.rb +3 -1
  120. data/snapshot/lib/snapshot/options.rb +5 -0
  121. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  122. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
  123. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +8 -4
  124. data/spaceship/README.md +2 -2
  125. data/spaceship/lib/spaceship/base.rb +2 -2
  126. data/spaceship/lib/spaceship/commands_generator.rb +2 -1
  127. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  128. data/spaceship/lib/spaceship/connect_api/models/.age_rating_declaration.rb.swp +0 -0
  129. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +35 -4
  130. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +10 -0
  131. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +2 -3
  132. data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
  133. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +6 -2
  134. data/spaceship/lib/spaceship/connect_api/token.rb +6 -0
  135. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +4 -2
  136. data/spaceship/lib/spaceship/ui.rb +2 -2
  137. data/supply/lib/supply/client.rb +2 -2
  138. data/supply/lib/supply/commands_generator.rb +2 -1
  139. data/supply/lib/supply/uploader.rb +2 -2
  140. metadata +74 -86
  141. data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -39,9 +39,11 @@ module Fastlane
39
39
  end
40
40
 
41
41
  require 'spaceship'
42
- if (token = api_token(params))
43
- UI.message("Using App Store Connect API token...")
44
- Spaceship::ConnectAPI.token = token
42
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
43
+ UI.message("Creating authorization token for App Store Connect API")
44
+ Spaceship::ConnectAPI.token = api_token
45
+ elsif !Spaceship::ConnectAPI.token.nil?
46
+ UI.message("Using existing authorization token for App Store Connect API")
45
47
  else
46
48
  UI.message("Login to App Store Connect (#{params[:username]})")
47
49
  credentials = CredentialsManager::AccountManager.new(user: params[:username])
@@ -83,13 +85,6 @@ module Fastlane
83
85
  UI.crash!("Failed to register new device (name: #{name}, UDID: #{udid})")
84
86
  end
85
87
 
86
- def self.api_token(params)
87
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
88
- api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key]
89
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path]
90
- return api_token
91
- end
92
-
93
88
  #####################################################
94
89
  # @!group Documentation
95
90
  #####################################################
@@ -129,6 +124,8 @@ module Fastlane
129
124
  env_names: ["FL_REGISTER_DEVICES_API_KEY", "APP_STORE_CONNECT_API_KEY"],
130
125
  description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
131
126
  type: Hash,
127
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
128
+ default_value_dynamic: true,
132
129
  optional: true,
133
130
  sensitive: true,
134
131
  conflicting_options: [:api_key_path]),
@@ -6,9 +6,11 @@ module Fastlane
6
6
 
7
7
  # Team selection passed though FASTLANE_ITC_TEAM_ID and FASTLANE_ITC_TEAM_NAME environment variables
8
8
  # Prompts select team if multiple teams and none specified
9
- if (token = self.api_token(params))
10
- UI.message("Using App Store Connect API token...")
11
- Spaceship::ConnectAPI.token = token
9
+ if (api_token = Spaceship::ConnectAPI::Token.from(hash: params[:api_key], filepath: params[:api_key_path]))
10
+ UI.message("Creating authorization token for App Store Connect API")
11
+ Spaceship::ConnectAPI.token = api_token
12
+ elsif !Spaceship::ConnectAPI.token.nil?
13
+ UI.message("Using existing authorization token for App Store Connect API")
12
14
  else
13
15
  UI.message("Login to App Store Connect (#{params[:username]})")
14
16
  Spaceship::ConnectAPI.login(params[:username], use_portal: false, use_tunes: true, tunes_team_id: params[:team_id], team_name: params[:team_name])
@@ -78,13 +80,6 @@ module Fastlane
78
80
  UI.success("👼 Successfully pushed the new changelog to for #{edit_version.version_string}")
79
81
  end
80
82
 
81
- def self.api_token(params)
82
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
83
- api_token ||= Spaceship::ConnectAPI::Token.create(**params[:api_key]) if params[:api_key]
84
- api_token ||= Spaceship::ConnectAPI::Token.from_json_file(params[:api_key_path]) if params[:api_key_path]
85
- return api_token
86
- end
87
-
88
83
  def self.default_changelog_path
89
84
  File.join(FastlaneCore::FastlaneFolder.path.to_s, 'changelog.txt')
90
85
  end
@@ -122,6 +117,8 @@ module Fastlane
122
117
  env_names: ["FL_SET_CHANGELOG_API_KEY", "APP_STORE_CONNECT_API_KEY"],
123
118
  description: "Your App Store Connect API Key information (https://docs.fastlane.tools/app-store-connect-api/#use-return-value-and-pass-in-as-an-option)",
124
119
  type: Hash,
120
+ default_value: Fastlane::Actions.lane_context[Fastlane::Actions::SharedValues::APP_STORE_CONNECT_API_KEY],
121
+ default_value_dynamic: true,
125
122
  optional: true,
126
123
  sensitive: true,
127
124
  conflicting_options: [:api_key_path]),
@@ -1,3 +1,5 @@
1
+ require 'fastlane/notification/slack'
2
+
1
3
  # rubocop:disable Style/CaseEquality
2
4
  # rubocop:disable Style/MultilineTernaryOperator
3
5
  # rubocop:disable Style/NestedTernaryOperator
@@ -6,12 +8,12 @@ module Fastlane
6
8
  class SlackAction < Action
7
9
  class Runner
8
10
  def initialize(slack_url)
9
- @notifier = Slack::Notifier.new(slack_url)
11
+ @notifier = Fastlane::Notification::Slack.new(slack_url)
10
12
  end
11
13
 
12
14
  def run(options)
13
15
  options[:message] = self.class.trim_message(options[:message].to_s || '')
14
- options[:message] = Slack::Notifier::Util::LinkFormatter.format(options[:message])
16
+ options[:message] = Fastlane::Notification::Slack::LinkConverter.convert(options[:message])
15
17
 
16
18
  options[:pretext] = options[:pretext].gsub('\n', "\n") unless options[:pretext].nil?
17
19
 
@@ -37,21 +39,21 @@ module Fastlane
37
39
  end
38
40
 
39
41
  def post_message(channel:, username:, attachments:, link_names:, icon_url:, fail_on_error:)
40
- results = @notifier.ping('', channel: channel, username: username, link_names: link_names, icon_url: icon_url, attachments: attachments)
41
- rescue => exception
42
- UI.error("Exception: #{exception}")
43
- ensure
44
- result = results.first if results
45
- if !result.nil? && result.code.to_i == 200
46
- UI.success('Successfully sent Slack notification')
42
+ @notifier.post_to_legacy_incoming_webhook(
43
+ channel: channel,
44
+ username: username,
45
+ link_names: link_names,
46
+ icon_url: icon_url,
47
+ attachments: attachments
48
+ )
49
+ UI.success('Successfully sent Slack notification')
50
+ rescue => error
51
+ UI.error("Exception: #{error}")
52
+ message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL"
53
+ if fail_on_error
54
+ UI.user_error!(message)
47
55
  else
48
- UI.verbose(result) unless result.nil?
49
- message = "Error pushing Slack message, maybe the integration has no permission to post on this channel? Try removing the channel parameter in your Fastfile, this is usually caused by a misspelled or changed group/channel name or an expired SLACK_URL"
50
- if fail_on_error
51
- UI.user_error!(message)
52
- else
53
- UI.error(message)
54
- end
56
+ UI.error(message)
55
57
  end
56
58
  end
57
59
 
@@ -84,7 +86,7 @@ module Fastlane
84
86
  slack_attachment[:fields] += options[:payload].map do |k, v|
85
87
  {
86
88
  title: k.to_s,
87
- value: Slack::Notifier::Util::LinkFormatter.format(v.to_s),
89
+ value: Fastlane::Notification::Slack::LinkConverter.convert(v.to_s),
88
90
  short: false
89
91
  }
90
92
  end
@@ -168,7 +170,6 @@ module Fastlane
168
170
  end
169
171
 
170
172
  def self.run(options)
171
- require 'slack-notifier'
172
173
  Runner.new(options[:slack_url]).run(options)
173
174
  end
174
175
 
@@ -11,8 +11,20 @@ module Fastlane
11
11
  UI.user_error!("Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
12
12
  end
13
13
 
14
+ # See 'Breaking' section release notes here: https://github.com/realm/SwiftLint/releases/tag/0.43.0
15
+ if params[:mode] == :autocorrect && version >= Gem::Version.new('0.43.0')
16
+ UI.deprecated("Your version of swiftlint (#{version}) has deprecated autocorrect mode, please start using fix mode in input param")
17
+ UI.important("For now, switching swiftlint mode `from :autocorrect to :fix` for you 😇")
18
+ params[:mode] = :fix
19
+ elsif params[:mode] == :fix && version < Gem::Version.new('0.43.0')
20
+ UI.important("Your version of swiftlint (#{version}) does not support fix mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`")
21
+ UI.important("For now, switching swiftlint mode `from :fix to :autocorrect` for you 😇")
22
+ params[:mode] = :autocorrect
23
+ end
24
+
25
+ mode_format = params[:mode] == :fix ? "--" : ""
14
26
  command = (params[:executable] || "swiftlint").dup
15
- command << " #{params[:mode]}"
27
+ command << " #{mode_format}#{params[:mode]}"
16
28
  command << optional_flags(params)
17
29
 
18
30
  if params[:files]
@@ -55,7 +67,7 @@ module Fastlane
55
67
  end
56
68
 
57
69
  def self.supported_no_cache_option(params)
58
- if params[:mode] == :autocorrect || params[:mode] == :lint
70
+ if [:autocorrect, :fix, :lint].include?(params[:mode])
59
71
  return " --no-cache"
60
72
  else
61
73
  return ""
@@ -89,8 +101,8 @@ module Fastlane
89
101
  [
90
102
  FastlaneCore::ConfigItem.new(key: :mode,
91
103
  env_name: "FL_SWIFTLINT_MODE",
92
- description: "SwiftLint mode: :lint, :autocorrect or :analyze",
93
- is_string: false,
104
+ description: "SwiftLint mode: :lint, :fix, :autocorrect or :analyze",
105
+ type: Symbol,
94
106
  default_value: :lint,
95
107
  optional: true),
96
108
  FastlaneCore::ConfigItem.new(key: :path,
@@ -10,7 +10,12 @@ module Fastlane
10
10
  require 'match'
11
11
 
12
12
  params.load_configuration_file("Matchfile")
13
- params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
13
+
14
+ # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
15
+ unless params[:api_key_path]
16
+ params[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
17
+ end
18
+
14
19
  Match::Runner.new.run(params)
15
20
 
16
21
  define_profile_type(params)
@@ -5,8 +5,10 @@ module Fastlane
5
5
  require 'tmpdir'
6
6
 
7
7
  find_binary_path(params)
8
- find_gsp_path(params)
9
- find_api_token(params)
8
+ unless params[:app_id]
9
+ find_gsp_path(params)
10
+ find_api_token(params)
11
+ end
10
12
 
11
13
  if !params[:app_id] && !params[:gsp_path] && !params[:api_token]
12
14
  UI.user_error!('Either Firebase Crashlytics App ID, path to GoogleService-Info.plist or legacy Fabric API key must be given.')
@@ -12,7 +12,11 @@ module Fastlane
12
12
  config[:screenshots_path] ||= Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] if Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
13
13
  config[:ipa] ||= Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
14
14
  config[:pkg] ||= Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
15
- config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
15
+
16
+ # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
17
+ unless config[:api_key_path]
18
+ config[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
19
+ end
16
20
 
17
21
  return config if Helper.test?
18
22
  Deliver::Runner.new(config).run
@@ -15,7 +15,8 @@ module Fastlane
15
15
  values[:ipa] = File.expand_path(values[:ipa]) if values[:ipa]
16
16
  end
17
17
 
18
- if values[:api_key_path].nil?
18
+ # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
19
+ unless values[:api_key_path]
19
20
  values[:api_key] ||= Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
20
21
  end
21
22
 
@@ -305,12 +305,12 @@ module Fastlane
305
305
 
306
306
  # Normalize some values
307
307
  export_options[:teamID] = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) if !export_options[:teamID] && CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
308
- export_options[:onDemandResourcesAssetPacksBaseURL] = URI.escape(export_options[:onDemandResourcesAssetPacksBaseURL]) if export_options[:onDemandResourcesAssetPacksBaseURL]
308
+ export_options[:onDemandResourcesAssetPacksBaseURL] = Addressable::URI.encode(export_options[:onDemandResourcesAssetPacksBaseURL]) if export_options[:onDemandResourcesAssetPacksBaseURL]
309
309
  if export_options[:manifest]
310
- export_options[:manifest][:appURL] = URI.encode_www_form_component(export_options[:manifest][:appURL]) if export_options[:manifest][:appURL]
311
- export_options[:manifest][:displayImageURL] = URI.encode_www_form_component(export_options[:manifest][:displayImageURL]) if export_options[:manifest][:displayImageURL]
312
- export_options[:manifest][:fullSizeImageURL] = URI.encode_www_form_component(export_options[:manifest][:fullSizeImageURL]) if export_options[:manifest][:fullSizeImageURL]
313
- export_options[:manifest][:assetPackManifestURL] = URI.encode_www_form_component(export_options[:manifest][:assetPackManifestURL]) if export_options[:manifest][:assetPackManifestURL]
310
+ export_options[:manifest][:appURL] = Addressable::URI.encode(export_options[:manifest][:appURL]) if export_options[:manifest][:appURL]
311
+ export_options[:manifest][:displayImageURL] = Addressable::URI.encode(export_options[:manifest][:displayImageURL]) if export_options[:manifest][:displayImageURL]
312
+ export_options[:manifest][:fullSizeImageURL] = Addressable::URI.encode(export_options[:manifest][:fullSizeImageURL]) if export_options[:manifest][:fullSizeImageURL]
313
+ export_options[:manifest][:assetPackManifestURL] = Addressable::URI.encode(export_options[:manifest][:assetPackManifestURL]) if export_options[:manifest][:assetPackManifestURL]
314
314
  end
315
315
 
316
316
  # Saves options to plist
@@ -23,7 +23,7 @@ module Fastlane
23
23
  def take_off
24
24
  before_import_time = Time.now
25
25
 
26
- if !ENV["FASTLANE_DISABLE_ANIMATION"]
26
+ if ENV["FASTLANE_DISABLE_ANIMATION"].nil?
27
27
  # Usually in the fastlane code base we use
28
28
  #
29
29
  # Helper.show_loading_indicator
@@ -1,5 +1,6 @@
1
1
  require 'commander'
2
2
  require 'fastlane/new_action'
3
+ require 'fastlane_core/ui/help_formatter'
3
4
 
4
5
  HighLine.track_eof = false
5
6
 
@@ -85,7 +86,7 @@ module Fastlane
85
86
  program :help, 'Author', 'Felix Krause <fastlane@krausefx.com>'
86
87
  program :help, 'Website', 'https://fastlane.tools'
87
88
  program :help, 'GitHub', 'https://github.com/fastlane/fastlane'
88
- program :help_formatter, :compact
89
+ program :help_formatter, FastlaneCore::HelpFormatter
89
90
 
90
91
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
91
92
  global_option('--capture_output', 'Captures the output of the current run, and generates a markdown issue template') do
@@ -284,7 +284,7 @@ module Fastlane
284
284
 
285
285
  action_launched('import_from_git')
286
286
 
287
- is_eligible_for_caching = !version.nil? && !cache_path.nil?
287
+ is_eligible_for_caching = !cache_path.nil?
288
288
 
289
289
  UI.message("Eligible for caching") if is_eligible_for_caching
290
290
 
@@ -338,7 +338,15 @@ module Fastlane
338
338
  UI.user_error!("No tag found matching #{version.inspect}") if checkout_param.nil?
339
339
  end
340
340
 
341
- Actions.sh("cd #{clone_folder.shellescape} && git checkout #{checkout_param.shellescape} #{checkout_path}")
341
+ if is_eligible_for_caching && version.nil?
342
+ # Update the repo if it's eligible for caching but the version isn't specified
343
+ UI.message("Fetching remote git branches and updating git repo...")
344
+ Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
345
+ Actions.sh("cd #{clone_folder.shellescape} && git fetch --all --quiet && git checkout #{checkout_param.shellescape} #{checkout_path} && git reset --hard && git rebase")
346
+ end
347
+ else
348
+ Actions.sh("cd #{clone_folder.shellescape} && git checkout #{checkout_param.shellescape} #{checkout_path}")
349
+ end
342
350
 
343
351
  # Knowing that we check out all the files and directories when the
344
352
  # current call is eligible for caching, we don't need to also
@@ -0,0 +1,56 @@
1
+ module Fastlane
2
+ module Notification
3
+ class Slack
4
+ def initialize(webhook_url)
5
+ @webhook_url = webhook_url
6
+ @client = Faraday.new do |conn|
7
+ conn.use(Faraday::Response::RaiseError)
8
+ end
9
+ end
10
+
11
+ # Overriding channel, icon_url and username is only supported in legacy incoming webhook.
12
+ # Also note that the use of attachments has been discouraged by Slack, in favor of Block Kit.
13
+ # https://api.slack.com/legacy/custom-integrations/messaging/webhooks
14
+ def post_to_legacy_incoming_webhook(channel:, username:, attachments:, link_names:, icon_url:)
15
+ @client.post(@webhook_url) do |request|
16
+ request.headers['Content-Type'] = 'application/json'
17
+ request.body = {
18
+ channel: channel,
19
+ username: username,
20
+ icon_url: icon_url,
21
+ attachments: attachments,
22
+ link_names: link_names
23
+ }.to_json
24
+ end
25
+ end
26
+
27
+ # This class was inspired by `LinkFormatter` in `slack-notifier` gem
28
+ # https://github.com/stevenosloan/slack-notifier/blob/4bf6582663dc9e5070afe3fdc42d67c14a513354/lib/slack-notifier/util/link_formatter.rb
29
+ class LinkConverter
30
+ HTML_PATTERN = %r{<a.*?href=['"](?<link>#{URI.regexp})['"].*?>(?<label>.+?)<\/a>}
31
+ MARKDOWN_PATTERN = /\[(?<label>[^\[\]]*?)\]\((?<link>#{URI.regexp}|mailto:#{URI::MailTo::EMAIL_REGEXP})\)/
32
+
33
+ def self.convert(string)
34
+ convert_markdown_to_slack_link(convert_html_to_slack_link(string.scrub))
35
+ end
36
+
37
+ def self.convert_html_to_slack_link(string)
38
+ string.gsub(HTML_PATTERN) do |match|
39
+ slack_link(Regexp.last_match[:link], Regexp.last_match[:label])
40
+ end
41
+ end
42
+
43
+ def self.convert_markdown_to_slack_link(string)
44
+ string.gsub(MARKDOWN_PATTERN) do |match|
45
+ slack_link(Regexp.last_match[:link], Regexp.last_match[:label])
46
+ end
47
+ end
48
+
49
+ def self.slack_link(href, text)
50
+ return "<#{href}>" if text.nil? || text.empty?
51
+ "<#{href}|#{text}>"
52
+ end
53
+ end
54
+ end
55
+ end
56
+ end
@@ -33,11 +33,11 @@ module Fastlane
33
33
 
34
34
  # Used to expose a local binding for use in ERB templating
35
35
  #
36
- # rubocop:disable Style/AccessorMethodName
36
+ # rubocop:disable Naming/AccessorMethodName
37
37
  def get_binding
38
38
  binding
39
39
  end
40
- # rubocop:enable Style/AccessorMethodName
40
+ # rubocop:enable Naming/AccessorMethodName
41
41
 
42
42
  def ==(other)
43
43
  @plugin_name == other.plugin_name &&
@@ -1,6 +1,4 @@
1
- # coding: utf-8
2
-
3
- lib = File.expand_path("../lib", __FILE__)
1
+ lib = File.expand_path("lib", __dir__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require '<%= require_path %>/version'
6
4
 
@@ -18,18 +16,21 @@ Gem::Specification.new do |spec|
18
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
17
  spec.require_paths = ['lib']
20
18
 
19
+ spec.required_ruby_version = '>= 2.5'
20
+
21
21
  # Don't add a dependency to fastlane or fastlane_re
22
22
  # since this would cause a circular dependency
23
23
 
24
24
  # spec.add_dependency 'your-dependency', '~> 1.0.0'
25
25
 
26
- spec.add_development_dependency('pry')
27
26
  spec.add_development_dependency('bundler')
27
+ spec.add_development_dependency('fastlane', '>= <%= Fastlane::VERSION %>')
28
+ spec.add_development_dependency('pry')
29
+ spec.add_development_dependency('rake')
28
30
  spec.add_development_dependency('rspec')
29
31
  spec.add_development_dependency('rspec_junit_formatter')
30
- spec.add_development_dependency('rake')
31
32
  spec.add_development_dependency('rubocop', '<%= Fastlane::RUBOCOP_REQUIREMENT %>')
33
+ spec.add_development_dependency('rubocop-performance')
32
34
  spec.add_development_dependency('rubocop-require_tools')
33
35
  spec.add_development_dependency('simplecov')
34
- spec.add_development_dependency('fastlane', '>= <%= Fastlane::VERSION %>')
35
36
  end
@@ -1,4 +1,23 @@
1
1
  ---
2
+ require:
3
+ - rubocop/require_tools
4
+ - rubocop-performance
5
+ AllCops:
6
+ TargetRubyVersion: 2.5
7
+ NewCops: enable
8
+ Include:
9
+ - "**/*.rb"
10
+ - "**/*file"
11
+ - "**/*.gemspec"
12
+ - "*/lib/assets/*Template"
13
+ - "*/lib/assets/*TemplateAndroid"
14
+ Exclude:
15
+ - "**/lib/assets/custom_action_template.rb"
16
+ - "./vendor/**/*"
17
+ - "**/lib/assets/DefaultFastfileTemplate"
18
+ - "**/lib/assets/MatchfileTemplate"
19
+ - "**/spec/fixtures/broken_files/broken_file.rb"
20
+ - "**/*.provisionprofile"
2
21
  Style/MultipleComparison:
3
22
  Enabled: false
4
23
  Style/PercentLiteralDelimiters:
@@ -19,11 +38,11 @@ Metrics/BlockLength:
19
38
  Enabled: false
20
39
  Metrics/ModuleLength:
21
40
  Enabled: false
22
- Style/VariableNumber:
41
+ Naming/VariableNumber:
23
42
  Enabled: false
24
- Style/MethodMissing:
43
+ Style/MissingRespondToMissing:
25
44
  Enabled: false
26
- MultilineBlockChain:
45
+ Style/MultilineBlockChain:
27
46
  Enabled: false
28
47
  Style/NumericLiteralPrefix:
29
48
  Enabled: false
@@ -31,8 +50,6 @@ Style/TernaryParentheses:
31
50
  Enabled: false
32
51
  Style/EmptyMethod:
33
52
  Enabled: false
34
- Style/BracesAroundHashParameters:
35
- Enabled: false
36
53
  Lint/UselessAssignment:
37
54
  Exclude:
38
55
  - "**/spec/**/*"
@@ -49,9 +66,9 @@ Require/MissingRequireStatement:
49
66
  - "**/Rakefile"
50
67
  - fastlane/**/*
51
68
  - supply/**/*
52
- Layout/IndentHash:
69
+ Layout/FirstHashElementIndentation:
53
70
  Enabled: false
54
- Layout/AlignHash:
71
+ Layout/HashAlignment:
55
72
  Enabled: false
56
73
  Layout/DotPosition:
57
74
  Enabled: false
@@ -59,12 +76,12 @@ Style/DoubleNegation:
59
76
  Enabled: false
60
77
  Style/SymbolArray:
61
78
  Enabled: false
62
- Layout/IndentHeredoc:
79
+ Layout/HeredocIndentation:
63
80
  Enabled: false
64
81
  Style/MixinGrouping:
65
82
  Exclude:
66
83
  - "**/spec/**/*"
67
- Lint/HandleExceptions:
84
+ Lint/SuppressedException:
68
85
  Enabled: false
69
86
  Lint/UnusedBlockArgument:
70
87
  Enabled: false
@@ -95,12 +112,10 @@ Style/AndOr:
95
112
  EnforcedStyle: conditionals
96
113
  Metrics/ClassLength:
97
114
  Max: 320
98
- Metrics/LineLength:
115
+ Layout/LineLength:
99
116
  Max: 370
100
117
  Metrics/ParameterLists:
101
118
  Max: 17
102
- Metrics/PerceivedComplexity:
103
- Max: 18
104
119
  Style/GuardClause:
105
120
  Enabled: false
106
121
  Style/StringLiterals:
@@ -114,25 +129,14 @@ Lint/UnusedMethodArgument:
114
129
  Lint/ParenthesesAsGroupedExpression:
115
130
  Exclude:
116
131
  - "**/spec/**/*"
117
- Style/PredicateName:
132
+ Naming/PredicateName:
118
133
  Enabled: false
119
134
  Style/PerlBackrefs:
120
135
  Enabled: false
121
136
  Layout/SpaceAroundOperators:
122
137
  Exclude:
123
138
  - "**/spec/actions_specs/xcodebuild_spec.rb"
124
- AllCops:
125
- TargetRubyVersion: 2.4
126
- Include:
127
- - "*/lib/assets/*Template"
128
- - "*/lib/assets/*TemplateAndroid"
129
- Exclude:
130
- - "**/lib/assets/custom_action_template.rb"
131
- - "./vendor/**/*"
132
- - "**/lib/assets/DefaultFastfileTemplate"
133
- - "**/lib/assets/MatchfileTemplate"
134
- - "**/spec/fixtures/broken_files/broken_file.rb"
135
- Style/FileName:
139
+ Naming/FileName:
136
140
  Exclude:
137
141
  - "**/Dangerfile"
138
142
  - "**/Brewfile"
@@ -142,6 +146,7 @@ Style/FileName:
142
146
  - "**/Fastfile"
143
147
  - "**/Deliverfile"
144
148
  - "**/Snapfile"
149
+ - "**/Pluginfile"
145
150
  - "**/*.gemspec"
146
151
  Style/Documentation:
147
152
  Enabled: false
@@ -153,16 +158,6 @@ Style/IfInsideElse:
153
158
  Enabled: false
154
159
  Style/CollectionMethods:
155
160
  Enabled: false
156
- CrossPlatform/ForkUsage:
157
- Exclude:
158
- - "**/plugins/template/**/*"
159
- Lint/IsStringUsage:
160
- Include:
161
- - cert/**/*
162
- - gym/**/*
163
- - match/**/*
164
- - screengrab/**/*
165
- - supply/**/*
166
161
  Style/MethodCallWithArgsParentheses:
167
162
  Enabled: true
168
163
  IgnoredMethods: