fastlane 2.148.0 → 2.150.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +86 -86
  3. data/deliver/lib/deliver.rb +0 -1
  4. data/deliver/lib/deliver/app_screenshot.rb +28 -27
  5. data/deliver/lib/deliver/options.rb +6 -11
  6. data/deliver/lib/deliver/runner.rb +7 -21
  7. data/deliver/lib/deliver/setup.rb +5 -30
  8. data/deliver/lib/deliver/submit_for_review.rb +155 -90
  9. data/deliver/lib/deliver/upload_metadata.rb +355 -143
  10. data/deliver/lib/deliver/upload_price_tier.rb +22 -8
  11. data/deliver/lib/deliver/upload_screenshots.rb +112 -37
  12. data/fastlane/lib/assets/s3_html_template.erb +1 -1
  13. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +42 -2
  14. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  15. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +77 -96
  16. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +3 -2
  17. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  18. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  19. data/fastlane/lib/fastlane/actions/hipchat.rb +1 -1
  20. data/fastlane/lib/fastlane/actions/set_changelog.rb +23 -20
  21. data/fastlane/lib/fastlane/actions/slack.rb +2 -2
  22. data/fastlane/lib/fastlane/actions/slather.rb +8 -1
  23. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  24. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +2 -33
  25. data/fastlane/lib/fastlane/documentation/actions_list.rb +1 -1
  26. data/fastlane/lib/fastlane/lane.rb +3 -3
  27. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -1
  28. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +29 -0
  29. data/fastlane/lib/fastlane/swift_fastlane_function.rb +22 -5
  30. data/fastlane/lib/fastlane/version.rb +1 -1
  31. data/fastlane/swift/ControlCommand.swift +1 -0
  32. data/fastlane/swift/Deliverfile.swift +1 -1
  33. data/fastlane/swift/Fastlane.swift +79 -22
  34. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  35. data/fastlane/swift/Gymfile.swift +1 -1
  36. data/fastlane/swift/GymfileProtocol.swift +1 -1
  37. data/fastlane/swift/LaneFileProtocol.swift +2 -5
  38. data/fastlane/swift/Matchfile.swift +1 -1
  39. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  40. data/fastlane/swift/Precheckfile.swift +1 -1
  41. data/fastlane/swift/RubyCommand.swift +29 -6
  42. data/fastlane/swift/RubyCommandable.swift +1 -0
  43. data/fastlane/swift/Runner.swift +85 -13
  44. data/fastlane/swift/Scanfile.swift +1 -1
  45. data/fastlane/swift/ScanfileProtocol.swift +2 -2
  46. data/fastlane/swift/Screengrabfile.swift +1 -1
  47. data/fastlane/swift/Snapshotfile.swift +1 -1
  48. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  49. data/fastlane/swift/SocketClient.swift +76 -45
  50. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  51. data/fastlane/swift/SocketResponse.swift +1 -0
  52. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  53. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  54. data/frameit/lib/frameit/device_types.rb +100 -100
  55. data/gym/lib/gym/options.rb +1 -1
  56. data/match/lib/match/nuke.rb +21 -16
  57. data/match/lib/match/storage/git_storage.rb +4 -0
  58. data/match/lib/match/storage/google_cloud_storage.rb +4 -0
  59. data/match/lib/match/storage/interface.rb +4 -0
  60. data/match/lib/match/storage/s3_storage.rb +4 -0
  61. data/produce/lib/produce/itunes_connect.rb +32 -21
  62. data/produce/lib/produce/options.rb +3 -3
  63. data/scan/lib/scan/options.rb +1 -1
  64. data/scan/lib/scan/test_result_parser.rb +9 -2
  65. data/sigh/lib/assets/resign.sh +7 -7
  66. data/snapshot/lib/assets/SnapshotHelper.swift +5 -5
  67. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  68. data/snapshot/lib/snapshot/options.rb +11 -1
  69. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  70. data/snapshot/lib/snapshot/test_command_generator.rb +8 -3
  71. data/spaceship/lib/spaceship/.DS_Store +0 -0
  72. data/spaceship/lib/spaceship/client.rb +13 -4
  73. data/spaceship/lib/spaceship/connect_api.rb +25 -2
  74. data/spaceship/lib/spaceship/connect_api/client.rb +97 -31
  75. data/spaceship/lib/spaceship/connect_api/file_uploader.rb +66 -0
  76. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  77. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +113 -0
  78. data/spaceship/lib/spaceship/connect_api/models/app.rb +117 -3
  79. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  80. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +66 -0
  81. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  82. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +77 -0
  83. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +71 -0
  84. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  85. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  86. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  87. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +97 -0
  88. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  89. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  90. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  91. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +86 -0
  92. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  93. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  94. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  95. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  96. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  97. data/spaceship/lib/spaceship/connect_api/models/territory.rb +27 -0
  98. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  99. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  100. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +832 -0
  101. data/spaceship/lib/spaceship/errors.rb +3 -0
  102. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  103. data/supply/lib/supply/client.rb +19 -0
  104. data/supply/lib/supply/reader.rb +16 -0
  105. metadata +50 -42
  106. data/deliver/lib/deliver/upload_assets.rb +0 -27
  107. data/snapshot/lib/snapshot/.options.rb.swp +0 -0
  108. data/snapshot/lib/snapshot/.test_command_generator_base.rb.swp +0 -0
@@ -171,9 +171,10 @@ A common Play publishing scenario might involve uploading an APK version to a te
171
171
 
172
172
  This can be done using the `--track_promote_to` parameter. The `--track_promote_to` parameter works with the `--track` parameter to command the Play API to promote existing Play track APK version(s) (those active on the track identified by the `--track` param value) to a new track (`--track_promote_to` value).
173
173
 
174
- ## Retrieve Track Version Codes
174
+ ## Retrieve Track Release Names & Version Codes
175
175
 
176
- Before performing a new APK upload you may want to check existing track version codes, or you may simply want to provide an informational lane that displays the currently promoted version codes for the production track. You can use the `google_play_track_version_codes` action to retrieve existing version codes for a package and track. For more information, see `fastlane action google_play_track_version_codes` help output.
176
+ Before performing a new APK upload you may want to check existing track version codes or release names, or you may simply want to provide an informational lane that displays the currently promoted version codes or release name for the production track. You can use the `google_play_track_version_codes` action to retrieve existing version codes for a package and track. You can use the `google_play_track_release_names` action to retrieve existing release names for a package and track.
177
+ For more information, see the `fastlane action google_play_track_version_codes` and `fastlane action google_play_track_release_names` help output.
177
178
 
178
179
  ## Migration from AndroidPublisherV2 to AndroidPublisherV3 in _fastlane_ 2.135.0
179
180
 
@@ -164,7 +164,13 @@ module Fastlane
164
164
 
165
165
  def self.download_file(url)
166
166
  uri = URI.parse(url)
167
- http = Net::HTTP.new(uri.host, uri.port)
167
+ if ENV['http_proxy']
168
+ UI.verbose("Found 'http_proxy' environment variable so connect via proxy")
169
+ proxy_uri = URI.parse(ENV['http_proxy'])
170
+ http = Net::HTTP.new(uri.host, uri.port, proxy_uri.host, proxy_uri.port)
171
+ else
172
+ http = Net::HTTP.new(uri.host, uri.port)
173
+ end
168
174
  http.use_ssl = (uri.scheme == "https")
169
175
  res = http.get(uri.request_uri)
170
176
  res.body
@@ -0,0 +1,74 @@
1
+ module Fastlane
2
+ module Actions
3
+ class GooglePlayTrackReleaseNamesAction < Action
4
+ # Supply::Options.available_options keys that apply to this action.
5
+ OPTIONS = [
6
+ :package_name,
7
+ :track,
8
+ :key,
9
+ :issuer,
10
+ :json_key,
11
+ :json_key_data,
12
+ :root_url,
13
+ :timeout
14
+ ]
15
+
16
+ def self.run(params)
17
+ require 'supply'
18
+ require 'supply/options'
19
+ require 'supply/reader'
20
+
21
+ Supply.config = params
22
+
23
+ release_names = Supply::Reader.new.track_release_names || []
24
+ return release_names.compact
25
+ end
26
+
27
+ #####################################################
28
+ # @!group Documentation
29
+ #####################################################
30
+
31
+ def self.description
32
+ "Retrieves release names for a Google Play track"
33
+ end
34
+
35
+ def self.details
36
+ "More information: [https://docs.fastlane.tools/actions/supply/](https://docs.fastlane.tools/actions/supply/)"
37
+ end
38
+
39
+ def self.available_options
40
+ require 'supply'
41
+ require 'supply/options'
42
+
43
+ Supply::Options.available_options.select do |option|
44
+ OPTIONS.include?(option.key)
45
+ end
46
+ end
47
+
48
+ def self.output
49
+ end
50
+
51
+ def self.return_value
52
+ "Array of strings representing the release names for the given Google Play track"
53
+ end
54
+
55
+ def self.authors
56
+ ["raldred"]
57
+ end
58
+
59
+ def self.is_supported?(platform)
60
+ platform == :android
61
+ end
62
+
63
+ def self.example_code
64
+ [
65
+ 'google_play_track_release_names'
66
+ ]
67
+ end
68
+
69
+ def self.category
70
+ :misc
71
+ end
72
+ end
73
+ end
74
+ end
@@ -25,7 +25,7 @@ module Fastlane
25
25
 
26
26
  message = options[:message]
27
27
  if (message_format == "html") && (options[:include_html_header] == true)
28
- message = "<table><tr><td><img src='https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png' width='50' height='50'></td><td>#{message[0..9999]}</td></tr></table>"
28
+ message = "<table><tr><td><img src='https://fastlane.tools/assets/img/fastlane_icon.png' width='50' height='50'></td><td>#{message[0..9999]}</td></tr></table>"
29
29
  end
30
30
 
31
31
  if api_version.to_i == 1
@@ -9,16 +9,18 @@ module Fastlane
9
9
  Spaceship::Tunes.select_team
10
10
  UI.message("Login successful")
11
11
 
12
- app = Spaceship::Application.find(params[:app_identifier]) || Spaceship::Application.find(params[:app_identifier], mac: true)
12
+ app = Spaceship::ConnectAPI::App.find(params[:app_identifier])
13
13
  UI.user_error!("Couldn't find app with identifier #{params[:app_identifier]}") if app.nil?
14
14
 
15
15
  version_number = params[:version]
16
- platform = params[:platform]
16
+ platform = Spaceship::ConnectAPI::Platform.map(params[:platform])
17
+
17
18
  unless version_number
18
19
  # Automatically fetch the latest version
19
20
  UI.message("Fetching the latest version for this app")
20
- if app.edit_version(platform: platform) && app.edit_version(platform: platform).version
21
- version_number = app.edit_version(platform: platform).version
21
+ edit_version = app.get_edit_app_store_version(platform: platform)
22
+ if edit_version
23
+ version_number = edit_version.version_string
22
24
  else
23
25
  UI.message("You have to specify a new version number: ")
24
26
  version_number = STDIN.gets.strip
@@ -42,31 +44,32 @@ module Fastlane
42
44
 
43
45
  UI.important("Going to update the changelog to:\n\n#{changelog}\n\n")
44
46
 
45
- if (v = app.edit_version(platform: platform))
46
- if v.version != version_number
47
+ edit_version = app.get_edit_app_store_version(platform: platform)
48
+ if edit_version
49
+ if edit_version.version_string != version_number
47
50
  # Version is already there, make sure it matches the one we want to create
48
- UI.message("Changing existing version number from '#{v.version}' to '#{version_number}'")
49
- v.version = version_number
50
- v.save!
51
+ UI.message("Changing existing version number from '#{edit_version.version_string}' to '#{version_number}'")
52
+ edit_version = edit_version.update(attributes: {
53
+ versionString: version_number
54
+ })
51
55
  else
52
- UI.message("Updating changelog for existing version #{v.version}")
56
+ UI.message("Updating changelog for existing version #{edit_version.version_string}")
53
57
  end
54
58
  else
55
59
  UI.message("Creating the new version: #{version_number}")
56
- app.create_version!(version_number)
57
- app = Spaceship::Application.find(params[:app_identifier]) # Replace with .reload method once available
58
- v = app.edit_version(platform: platform)
60
+ attributes = { versionString: version_number, platform: platform }
61
+ edit_version = Spaceship::ConnectAPI.post_app_store_version(app_id: app.id, attributes: attributes).first
59
62
  end
60
63
 
61
- v.release_notes.languages.each do |lang|
62
- v.release_notes[lang] = changelog
64
+ localizations = edit_version.get_app_store_version_localizations
65
+ localizations.each do |localization|
66
+ UI.message("Updating changelog for the '#{localization.locale}'")
67
+ localization.update(attributes: {
68
+ whatsNew: changelog
69
+ })
63
70
  end
64
71
 
65
- UI.message("Found and updated changelog for the following languages: #{v.release_notes.languages.join(', ')}")
66
- UI.message("Uploading changes to App Store Connect...")
67
- v.save!
68
-
69
- UI.success("👼 Successfully pushed the new changelog to #{v.url}")
72
+ UI.success("👼 Successfully pushed the new changelog to for #{edit_version.version_string}")
70
73
  end
71
74
 
72
75
  def self.default_changelog_path
@@ -105,7 +105,7 @@ module Fastlane
105
105
  FastlaneCore::ConfigItem.new(key: :icon_url,
106
106
  env_name: "FL_SLACK_ICON_URL",
107
107
  description: "Overrides the webhook's image property if use_webhook_configured_username_and_icon is false",
108
- default_value: "https://s3-eu-west-1.amazonaws.com/fastlane.tools/fastlane.png",
108
+ default_value: "https://fastlane.tools/assets/img/fastlane_icon.png",
109
109
  is_string: true,
110
110
  optional: true),
111
111
  FastlaneCore::ConfigItem.new(key: :payload,
@@ -159,7 +159,7 @@ module Fastlane
159
159
  "Build Date" => Time.new.to_s,
160
160
  "Built by" => "Jenkins",
161
161
  },
162
- default_payloads: [:git_branch, :git_author], # Optional, lets you specify a whitelist of default payloads to include. Pass an empty array to suppress all the default payloads.
162
+ default_payloads: [:git_branch, :git_author], # Optional, lets you specify an allowlist of default payloads to include. Pass an empty array to suppress all the default payloads.
163
163
  # Don\'t add this key, or pass nil, if you want all the default payloads. The available default payloads are: `lane`, `test_result`, `git_branch`, `git_author`, `last_git_commit`, `last_git_commit_hash`.
164
164
  attachment_properties: { # Optional, lets you specify any other properties available for attachments in the slack API (see https://api.slack.com/docs/attachments).
165
165
  # This hash is deep merged with the existing properties set using the other properties above. This allows your own fields properties to be appended to the existing fields that were created using the `payload` property for instance.
@@ -1,7 +1,7 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  class SlatherAction < Action
4
- # https://github.com/SlatherOrg/slather/blob/v2.4.2/lib/slather/command/coverage_command.rb
4
+ # https://github.com/SlatherOrg/slather/blob/v2.4.9/lib/slather/command/coverage_command.rb
5
5
  ARGS_MAP = {
6
6
  travis: '--travis',
7
7
  travis_pro: '--travispro',
@@ -14,6 +14,7 @@ module Fastlane
14
14
  simple_output: '--simple-output',
15
15
  gutter_json: '--gutter-json',
16
16
  cobertura_xml: '--cobertura-xml',
17
+ sonarqube_xml: '--sonarqube-xml',
17
18
  llvm_cov: '--llvm-cov',
18
19
  html: '--html',
19
20
  show: '--show',
@@ -213,6 +214,12 @@ module Fastlane
213
214
  is_string: false,
214
215
  type: Boolean,
215
216
  optional: true),
217
+ FastlaneCore::ConfigItem.new(key: :sonarqube_xml,
218
+ env_name: "FL_SLATHER_SONARQUBE_XML_ENABLED",
219
+ description: "Tell slather that it should output results as SonarQube Generic XML format",
220
+ is_string: false,
221
+ type: Boolean,
222
+ optional: true),
216
223
  FastlaneCore::ConfigItem.new(key: :llvm_cov,
217
224
  env_name: "FL_SLATHER_LLVM_COV_ENABLED",
218
225
  description: "Tell slather that it should output results as llvm-cov show format",
@@ -8,6 +8,7 @@ module Fastlane
8
8
  cmd << "--build-path #{params[:build_path]}" if params[:build_path]
9
9
  cmd << "--package-path #{params[:package_path]}" if params[:package_path]
10
10
  cmd << "--configuration #{params[:configuration]}" if params[:configuration]
11
+ cmd << "--disable-sandbox" if params[:disable_sandbox]
11
12
  cmd << "--verbose" if params[:verbose]
12
13
  cmd << params[:command] if package_commands.include?(params[:command])
13
14
  if params[:xcconfig]
@@ -63,6 +64,12 @@ module Fastlane
63
64
  verify_block: proc do |value|
64
65
  UI.user_error!("Please pass a valid configuration: (debug|release)") unless valid_configurations.include?(value)
65
66
  end),
67
+ FastlaneCore::ConfigItem.new(key: :disable_sandbox,
68
+ env_name: "FL_SPM_DISABLE_SANDBOX",
69
+ description: "Disable using the sandbox when executing subprocesses",
70
+ optional: true,
71
+ is_string: false,
72
+ default_value: false),
66
73
  FastlaneCore::ConfigItem.new(key: :xcpretty_output,
67
74
  env_name: "FL_SPM_XCPRETTY_OUTPUT",
68
75
  description: "Specifies the output type for xcpretty. eg. 'test', or 'simple'",
@@ -45,44 +45,13 @@ module Fastlane
45
45
  # @param current_path this is a path to either a dSYM or a zipped dSYM
46
46
  # this might also be either nested or not, we're flexible
47
47
  def self.handle_dsym(params, current_path, max_worker_threads)
48
- if current_path.end_with?(".dSYM")
48
+ if current_path.end_with?(".dSYM", ".zip")
49
49
  upload_dsym(params, current_path)
50
- elsif current_path.end_with?(".zip")
51
- UI.message("Extracting '#{current_path}'...")
52
-
53
- current_path = File.expand_path(current_path)
54
- Dir.mktmpdir do |dir|
55
- Dir.chdir(dir) do
56
- Actions.sh("unzip -qo #{current_path.shellescape}")
57
- work_q = Queue.new
58
- Dir["*.dSYM"].each do |sub|
59
- work_q.push(sub)
60
- end
61
- execute_uploads(params, max_worker_threads, work_q)
62
- end
63
- end
64
50
  else
65
51
  UI.error("Don't know how to handle '#{current_path}'")
66
52
  end
67
53
  end
68
54
 
69
- def self.execute_uploads(params, max_worker_threads, work_q)
70
- number_of_threads = [max_worker_threads, work_q.size].min
71
- workers = (0...number_of_threads).map do
72
- Thread.new do
73
- begin
74
- while work_q.size > 0
75
- current_path = work_q.pop(true)
76
- upload_dsym(params, current_path)
77
- end
78
- rescue => ex
79
- UI.error(ex.to_s)
80
- end
81
- end
82
- end
83
- workers.map(&:join)
84
- end
85
-
86
55
  def self.upload_dsym(params, path)
87
56
  UI.message("Uploading '#{path}'...")
88
57
  command = []
@@ -119,7 +88,7 @@ module Fastlane
119
88
  end
120
89
 
121
90
  def self.find_gsp_path(params)
122
- return if params[:api_token]
91
+ return if params[:api_token] && params[:gsp_path].nil?
123
92
 
124
93
  if params[:gsp_path].to_s.length > 0
125
94
  params[:gsp_path] = File.expand_path(params[:gsp_path])
@@ -176,7 +176,7 @@ module Fastlane
176
176
  # them as broken actions in the table, regardless of platform specification
177
177
  next if platform && action.respond_to?(:is_supported?) && !action.is_supported?(platform.to_sym)
178
178
 
179
- name = symbol.to_s.gsub('Action', '').fastlane_underscore
179
+ name = symbol.to_s.gsub(/Action$/, '').fastlane_underscore
180
180
  yield(action, name)
181
181
  end
182
182
  end
@@ -41,8 +41,8 @@ module Fastlane
41
41
  class << self
42
42
  # Makes sure the lane name is valid
43
43
  def verify_lane_name(name)
44
- if self.black_list.include?(name.to_s)
45
- UI.error("Lane name '#{name}' is invalid! Invalid names are #{self.black_list.join(', ')}.")
44
+ if self.deny_list.include?(name.to_s)
45
+ UI.error("Lane name '#{name}' is invalid! Invalid names are #{self.deny_list.join(', ')}.")
46
46
  UI.user_error!("Lane name '#{name}' is invalid")
47
47
  end
48
48
 
@@ -59,7 +59,7 @@ module Fastlane
59
59
  self.ensure_name_not_conflicts(name.to_s)
60
60
  end
61
61
 
62
- def black_list
62
+ def deny_list
63
63
  %w(
64
64
  run
65
65
  init
@@ -375,7 +375,7 @@ module Fastlane
375
375
  references = Fastlane.const_get(module_name).all_classes.collect do |path|
376
376
  next unless File.dirname(path).include?("/actions") # we only want to match actions
377
377
 
378
- File.basename(path).gsub("_action", "").gsub(".rb", "").to_sym # the _action is optional
378
+ File.basename(path).gsub(".rb", "").gsub(/_action$/, '').to_sym # the _action is optional
379
379
  end
380
380
  references.compact!
381
381
 
@@ -0,0 +1,29 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+
6
+ jobs:
7
+ test:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@v2
11
+ - uses: actions/cache@v1
12
+ with:
13
+ path: vendor/bundle
14
+ key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile') }}
15
+ restore-keys: |
16
+ ${{ runner.os }}-gem-
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: 2.4
21
+ - name: Install dependencies
22
+ run: bundle check || bundle install --jobs=4 --retry=3 --path vendor/bundle
23
+ - name: Run tests
24
+ run: bundle exec rake
25
+ - name: Upload artifact
26
+ uses: actions/upload-artifact@v2
27
+ with:
28
+ name: test-results
29
+ path: test-results
@@ -95,8 +95,14 @@ module Fastlane
95
95
  return "Int"
96
96
  elsif type_override == Boolean
97
97
  return "Bool"
98
+ elsif type_override == Float
99
+ return "Float"
98
100
  elsif type_override == :string_callback
99
- return "((String) -> Void)"
101
+ # David Hart:
102
+ # It doesn't make sense to add escaping annotations to optional closures because they aren't function types:
103
+ # they are basically an enum (Optional) containing a function, the same way you would store a closure in any type:
104
+ # it's implicitly escaping because it's owned by another type.
105
+ return "((String) -> Void)?"
100
106
  else
101
107
  return default_type
102
108
  end
@@ -104,7 +110,7 @@ module Fastlane
104
110
 
105
111
  def override_default_value_if_not_correct_type(param_name: nil, param_type: nil, default_value: nil)
106
112
  return "[]" if param_type == "[String]" && default_value == ""
107
- return "{_ in }" if param_type == "((String) -> Void)"
113
+ return "nil" if param_type == "((String) -> Void)?"
108
114
 
109
115
  return default_value
110
116
  end
@@ -119,7 +125,7 @@ module Fastlane
119
125
 
120
126
  optional_specifier = ""
121
127
  # if we are optional and don't have a default value, we'll need to use ?
122
- optional_specifier = "?" if (optional && default_value.nil?) && type != "((String) -> Void)"
128
+ optional_specifier = "?" if (optional && default_value.nil?) && type != "((String) -> Void)?"
123
129
 
124
130
  # If we have a default value of true or false, we can infer it is a Bool
125
131
  if default_value.class == FalseClass
@@ -130,8 +136,19 @@ module Fastlane
130
136
  type = "[String]"
131
137
  elsif default_value.kind_of?(Hash)
132
138
  type = "[String : Any]"
139
+ # Altough we can have a default value of Integer type, if param_type_override overridden that value, respect it.
133
140
  elsif default_value.kind_of?(Integer)
134
- type = "Int"
141
+ if type == "Double" || type == "Float"
142
+ begin
143
+ # If we're not able to instantiate
144
+ _ = BigDecimal(default_value)
145
+ rescue
146
+ # We set it as a Int
147
+ type = "Int"
148
+ end
149
+ else
150
+ type = "Int"
151
+ end
135
152
  end
136
153
  return "#{type}#{optional_specifier}"
137
154
  end
@@ -149,7 +166,7 @@ module Fastlane
149
166
  # we can't handle default values for Hashes, yet
150
167
  # see method swift_default_implementations for similar behavior
151
168
  default_value = "[:]"
152
- elsif type != "Bool" && type != "[String]" && type != "Int" && type != "((String) -> Void)"
169
+ elsif type != "Bool" && type != "[String]" && type != "Int" && type != "@escaping ((String) -> Void)" && type != "Float" && type != "Double"
153
170
  default_value = "\"#{default_value}\""
154
171
  end
155
172
  end
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.148.0'.freeze
2
+ VERSION = '2.150.0.rc2'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze