fastlane 2.177.0 → 2.181.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +83 -70
  4. data/cert/lib/cert/options.rb +1 -0
  5. data/cert/lib/cert/runner.rb +5 -1
  6. data/deliver/lib/deliver/download_screenshots.rb +1 -2
  7. data/deliver/lib/deliver/options.rb +1 -0
  8. data/deliver/lib/deliver/runner.rb +10 -2
  9. data/deliver/lib/deliver/setup.rb +0 -1
  10. data/deliver/lib/deliver/upload_metadata.rb +2 -1
  11. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +6 -1
  12. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +7 -4
  13. data/fastlane/lib/fastlane/actions/backup_file.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
  15. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
  16. data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
  17. data/fastlane/lib/fastlane/actions/commit_github_file.rb +11 -1
  18. data/fastlane/lib/fastlane/actions/create_xcframework.rb +5 -0
  19. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
  20. data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
  21. data/fastlane/lib/fastlane/actions/get_github_release.rb +11 -1
  22. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
  23. data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
  24. data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
  25. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
  26. data/fastlane/lib/fastlane/actions/github_api.rb +2 -1
  27. data/fastlane/lib/fastlane/actions/increment_build_number.rb +8 -1
  28. data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
  29. data/fastlane/lib/fastlane/actions/jira.rb +61 -14
  30. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
  31. data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
  32. data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
  33. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/register_devices.rb +1 -1
  35. data/fastlane/lib/fastlane/actions/restore_file.rb +1 -1
  36. data/fastlane/lib/fastlane/actions/set_changelog.rb +1 -1
  37. data/fastlane/lib/fastlane/actions/slack.rb +148 -127
  38. data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
  39. data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
  40. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -2
  41. data/fastlane/lib/fastlane/erb_template_helper.rb +7 -1
  42. data/fastlane/lib/fastlane/fast_file.rb +9 -5
  43. data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
  44. data/fastlane/lib/fastlane/helper/git_helper.rb +19 -7
  45. data/fastlane/lib/fastlane/lane_manager.rb +3 -2
  46. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
  47. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
  48. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
  49. data/fastlane/lib/fastlane/setup/setup.rb +23 -10
  50. data/fastlane/lib/fastlane/swift_fastlane_function.rb +4 -0
  51. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
  52. data/fastlane/lib/fastlane/version.rb +1 -1
  53. data/fastlane/swift/Deliverfile.swift +1 -1
  54. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  55. data/fastlane/swift/Fastlane.swift +550 -328
  56. data/fastlane/swift/Gymfile.swift +1 -1
  57. data/fastlane/swift/GymfileProtocol.swift +1 -1
  58. data/fastlane/swift/LaneFileProtocol.swift +9 -3
  59. data/fastlane/swift/Matchfile.swift +1 -1
  60. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  61. data/fastlane/swift/Precheckfile.swift +1 -1
  62. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  63. data/fastlane/swift/RubyCommand.swift +1 -1
  64. data/fastlane/swift/Scanfile.swift +1 -1
  65. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  66. data/fastlane/swift/Screengrabfile.swift +1 -1
  67. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  68. data/fastlane/swift/Snapshotfile.swift +1 -1
  69. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  70. data/fastlane/swift/SocketClient.swift +2 -1
  71. data/fastlane/swift/SocketResponse.swift +4 -2
  72. data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
  73. data/fastlane_core/lib/fastlane_core.rb +22 -21
  74. data/fastlane_core/lib/fastlane_core/build_watcher.rb +50 -9
  75. data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
  76. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
  77. data/fastlane_core/lib/fastlane_core/helper.rb +24 -1
  78. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +10 -6
  79. data/fastlane_core/lib/fastlane_core/project.rb +3 -14
  80. data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
  81. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
  82. data/fastlane_core/lib/fastlane_core/ui/interface.rb +1 -1
  83. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  84. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
  85. data/gym/lib/gym/runner.rb +15 -4
  86. data/match/lib/match/change_password.rb +3 -3
  87. data/match/lib/match/encryption/interface.rb +1 -1
  88. data/match/lib/match/encryption/openssl.rb +2 -2
  89. data/match/lib/match/importer.rb +1 -1
  90. data/match/lib/match/migrate.rb +1 -1
  91. data/match/lib/match/module.rb +1 -0
  92. data/match/lib/match/nuke.rb +1 -1
  93. data/match/lib/match/runner.rb +1 -1
  94. data/match/lib/match/storage/google_cloud_storage.rb +1 -1
  95. data/match/lib/match/storage/s3_storage.rb +1 -1
  96. data/pilot/lib/pilot/build_manager.rb +9 -4
  97. data/pilot/lib/pilot/manager.rb +5 -1
  98. data/pilot/lib/pilot/options.rb +3 -2
  99. data/precheck/lib/precheck/options.rb +1 -0
  100. data/precheck/lib/precheck/runner.rb +5 -1
  101. data/scan/lib/scan/options.rb +10 -5
  102. data/scan/lib/scan/runner.rb +54 -1
  103. data/scan/lib/scan/test_command_generator.rb +10 -8
  104. data/screengrab/lib/screengrab/android_environment.rb +6 -4
  105. data/screengrab/lib/screengrab/runner.rb +1 -1
  106. data/sigh/lib/sigh/download_all.rb +1 -1
  107. data/sigh/lib/sigh/options.rb +1 -0
  108. data/sigh/lib/sigh/runner.rb +5 -1
  109. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  110. data/snapshot/lib/snapshot/reports_generator.rb +4 -0
  111. data/spaceship/README.md +2 -12
  112. data/spaceship/lib/spaceship/commands_generator.rb +2 -1
  113. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
  114. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +5 -0
  115. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +13 -0
  116. data/spaceship/lib/spaceship/connect_api/token.rb +8 -2
  117. data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
  118. data/spaceship/lib/spaceship/tunes/members.rb +1 -1
  119. data/supply/lib/supply/client.rb +3 -1
  120. data/supply/lib/supply/options.rb +2 -2
  121. data/supply/lib/supply/uploader.rb +1 -0
  122. metadata +28 -24
  123. data/gym/lib/gym/.runner.rb.swp +0 -0
@@ -0,0 +1,164 @@
1
+ module Fastlane
2
+ module Actions
3
+ class SourcedocsAction < Action
4
+ def self.run(params)
5
+ UI.user_error!("You have to install sourcedocs using `brew install sourcedocs`") if `which sourcedocs`.to_s.length == 0 && !Helper.test?
6
+
7
+ command = "sourcedocs generate"
8
+ command << " --all-modules" if params[:all_modules]
9
+ command << " --spm-module #{params[:spm_module]}" unless params[:spm_module].nil?
10
+ command << " --module-name #{params[:module_name]}" unless params[:module_name].nil?
11
+ command << " --link-beginning #{params[:link_beginning]}" unless params[:link_beginning].nil?
12
+ command << " --link-ending #{params[:link_ending]}" unless params[:link_ending].nil?
13
+ command << " --output-folder #{params[:output_folder]}" unless params[:output_folder].nil?
14
+ command << " --min-acl #{params[:min_acl]}" unless params[:min_acl].nil?
15
+ command << " --module-name-path" if params[:module_name_path]
16
+ command << " --clean" if params[:clean]
17
+ command << " --collapsible" if params[:collapsible]
18
+ command << " --table-of-contents" if params[:table_of_contents]
19
+ command << " --reproducible-docs" if params[:reproducible]
20
+ unless params[:scheme].nil?
21
+ command << " -- -scheme #{params[:scheme]}"
22
+ command << " -sdk #{params[:sdk_platform]}" unless params[:sdk_platform].nil?
23
+ end
24
+ Actions.sh(command)
25
+ end
26
+
27
+ #####################################################
28
+ # @!group Documentation
29
+ #####################################################
30
+
31
+ def self.description
32
+ "Generate docs using SourceDocs"
33
+ end
34
+
35
+ def self.available_options
36
+ [
37
+ FastlaneCore::ConfigItem.new(
38
+ key: :all_modules,
39
+ env_name: 'FL_SOURCEDOCS_OUTPUT_ALL_MODULES',
40
+ description: 'Generate documentation for all modules in a Swift package',
41
+ type: Boolean,
42
+ optional: true
43
+ ),
44
+ FastlaneCore::ConfigItem.new(
45
+ key: :spm_module,
46
+ env_name: 'FL_SOURCEDOCS_SPM_MODULE',
47
+ description: 'Generate documentation for Swift Package Manager module',
48
+ type: String,
49
+ optional: true
50
+ ),
51
+ FastlaneCore::ConfigItem.new(
52
+ key: :module_name,
53
+ env_name: 'FL_SOURCEDOCS_MODULE_NAME',
54
+ description: 'Generate documentation for a Swift module',
55
+ type: String,
56
+ optional: true
57
+ ),
58
+ FastlaneCore::ConfigItem.new(
59
+ key: :link_beginning,
60
+ env_name: 'FL_SOURCEDOCS_LINK_BEGINNING',
61
+ description: 'The text to begin links with',
62
+ type: String,
63
+ optional: true
64
+ ),
65
+ FastlaneCore::ConfigItem.new(
66
+ key: :link_ending,
67
+ env_name: 'FL_SOURCEDOCS_LINK_ENDING',
68
+ description: 'The text to end links with (default: .md)',
69
+ type: String,
70
+ optional: true
71
+ ),
72
+ FastlaneCore::ConfigItem.new(
73
+ key: :output_folder,
74
+ env_name: 'FL_SOURCEDOCS_OUTPUT_FOLDER',
75
+ description: 'Output directory to clean (default: Documentation/Reference)',
76
+ type: String,
77
+ optional: false
78
+ ),
79
+ FastlaneCore::ConfigItem.new(
80
+ key: :min_acl,
81
+ env_name: 'FL_SOURCEDOCS_MIN_ACL',
82
+ description: 'Access level to include in documentation [private, fileprivate, internal, public, open] (default: public)',
83
+ type: String,
84
+ optional: true
85
+ ),
86
+ FastlaneCore::ConfigItem.new(
87
+ key: :module_name_path,
88
+ env_name: 'FL_SOURCEDOCS_MODULE_NAME_PATH',
89
+ description: 'Include the module name as part of the output folder path',
90
+ type: Boolean,
91
+ optional: true
92
+ ),
93
+ FastlaneCore::ConfigItem.new(
94
+ key: :clean,
95
+ env_name: 'FL_SOURCEDOCS_CLEAN',
96
+ description: 'Delete output folder before generating documentation',
97
+ type: Boolean,
98
+ optional: true
99
+ ),
100
+ FastlaneCore::ConfigItem.new(
101
+ key: :collapsible,
102
+ env_name: 'FL_SOURCEDOCS_COLLAPSIBLE',
103
+ description: 'Put methods, properties and enum cases inside collapsible blocks',
104
+ type: Boolean,
105
+ optional: true
106
+ ),
107
+ FastlaneCore::ConfigItem.new(
108
+ key: :table_of_contents,
109
+ env_name: 'FL_SOURCEDOCS_TABLE_OF_CONTENT',
110
+ description: 'Generate a table of contents with properties and methods for each type',
111
+ type: Boolean,
112
+ optional: true
113
+ ),
114
+ FastlaneCore::ConfigItem.new(
115
+ key: :reproducible,
116
+ env_name: 'FL_SOURCEDOCS_REPRODUCIBLE',
117
+ description: 'Generate documentation that is reproducible: only depends on the sources',
118
+ type: Boolean,
119
+ optional: true
120
+ ),
121
+ FastlaneCore::ConfigItem.new(
122
+ key: :scheme,
123
+ env_name: 'FL_SOURCEDOCS_SCHEME',
124
+ description: 'Create documentation for specific scheme',
125
+ type: String,
126
+ optional: true
127
+ ),
128
+ FastlaneCore::ConfigItem.new(
129
+ key: :sdk_platform,
130
+ env_name: 'FL_SOURCEDOCS_SDK_PlATFORM',
131
+ description: 'Create documentation for specific sdk platform',
132
+ type: String,
133
+ optional: true
134
+ )
135
+ ]
136
+ end
137
+
138
+ def self.output
139
+ end
140
+
141
+ def self.return_value
142
+ end
143
+
144
+ def self.authors
145
+ ["Kukurijek"]
146
+ end
147
+
148
+ def self.is_supported?(platform)
149
+ [:ios, :mac].include?(platform)
150
+ end
151
+
152
+ def self.example_code
153
+ [
154
+ "sourcedocs(output_folder: 'docs')",
155
+ "sourcedocs(output_folder: 'docs', clean: true, reproducible: true, scheme: 'MyApp')"
156
+ ]
157
+ end
158
+
159
+ def self.category
160
+ :documentation
161
+ end
162
+ end
163
+ end
164
+ end
@@ -124,7 +124,7 @@ module Fastlane
124
124
  end
125
125
 
126
126
  def self.return_type
127
- :array
127
+ :array_of_strings
128
128
  end
129
129
 
130
130
  def self.author
@@ -21,9 +21,8 @@ module Fastlane
21
21
  # download certificate
22
22
  unless File.exist?(params[:certificate])
23
23
  UI.message("Downloading root certificate from (#{ROOT_CERTIFICATE_URL}) to path '#{params[:certificate]}'")
24
- require 'open-uri'
25
24
  File.open(params[:certificate], "w:ASCII-8BIT") do |file|
26
- file.write(open(ROOT_CERTIFICATE_URL, "rb").read)
25
+ file.write(FastlaneCore::Helper.open_uri(ROOT_CERTIFICATE_URL, "rb").read)
27
26
  end
28
27
  end
29
28
 
@@ -24,7 +24,13 @@ module Fastlane
24
24
  end
25
25
 
26
26
  def render(template)
27
- ERB.new(template, nil, @trim_mode).result(binding)
27
+ # From Ruby 2.6, ERB.new takes keyword arguments and positional ones are deprecated
28
+ # https://bugs.ruby-lang.org/issues/14256
29
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.6.0")
30
+ ERB.new(template, trim_mode: @trim_mode).result(binding)
31
+ else
32
+ ERB.new(template, nil, @trim_mode).result(binding)
33
+ end
28
34
  end
29
35
  end
30
36
  end
@@ -201,13 +201,17 @@ module Fastlane
201
201
  # First accepts hash (or named keywords) like other actions
202
202
  # Otherwise uses sh method that doesn't have an interface like an action
203
203
  if args.count == 1 && args.first.kind_of?(Hash)
204
- hash = args.first
205
- command = hash.delete(:command)
204
+ options = args.first
205
+ command = options.delete(:command)
206
206
 
207
207
  raise ArgumentError, "sh requires :command keyword in argument" if command.nil?
208
-
209
- new_args = [*command, hash]
210
- FastFile.sh(*new_args, &b)
208
+ log = options[:log].nil? ? true : options[:log]
209
+ FastFile.sh(*command, step_name: options[:step_name], log: log, error_callback: options[:error_callback], &b)
210
+ elsif args.count != 1 && args.last.kind_of?(Hash)
211
+ new_args = args.dup
212
+ options = new_args.pop
213
+ log = options[:log].nil? ? true : options[:log]
214
+ FastFile.sh(*new_args, step_name: options[:step_name], log: log, error_callback: options[:error_callback], &b)
211
215
  else
212
216
  FastFile.sh(*args, &b)
213
217
  end
@@ -59,8 +59,14 @@ module Fastlane
59
59
 
60
60
  def find_gem_name(user_supplied_name)
61
61
  fetcher = Gem::SpecFetcher.fetcher
62
- gems = fetcher.suggest_gems_from_name(user_supplied_name)
63
62
 
63
+ # RubyGems 3.2.0 changed behavior of suggest_gems_from_name to no longer return user supplied name (only similar suggestions)
64
+ # First search for exact gem with detect then use suggest_gems_from_name
65
+ if (detected_gem = fetcher.detect(:latest) { |nt| nt.name == user_supplied_name }.first)
66
+ return detected_gem[0].name
67
+ end
68
+
69
+ gems = fetcher.suggest_gems_from_name(user_supplied_name)
64
70
  return gems.first
65
71
  end
66
72
 
@@ -2,6 +2,13 @@ module Fastlane
2
2
  module Actions
3
3
  GIT_MERGE_COMMIT_FILTERING_OPTIONS = [:include_merges, :exclude_merges, :only_include_merges].freeze
4
4
 
5
+ module SharedValues
6
+ GIT_BRANCH_ENV_VARS = %w(GIT_BRANCH BRANCH_NAME TRAVIS_BRANCH BITRISE_GIT_BRANCH CI_BUILD_REF_NAME CI_COMMIT_REF_NAME WERCKER_GIT_BRANCH BUILDKITE_BRANCH APPCENTER_BRANCH CIRCLE_BRANCH).reject do |branch|
7
+ # Removing because tests break on CircleCI
8
+ Helper.test? && branch == "CIRCLE_BRANCH"
9
+ end.freeze
10
+ end
11
+
5
12
  def self.git_log_between(pretty_format, from, to, merge_commit_filtering, date_format = nil, ancestry_path)
6
13
  command = %w(git log)
7
14
  command << "--pretty=#{pretty_format}"
@@ -112,14 +119,19 @@ module Fastlane
112
119
  return nil
113
120
  end
114
121
 
115
- # Returns the current git branch - can be replaced using the environment variable `GIT_BRANCH`
122
+ # Returns the current git branch, or "HEAD" if it's not checked out to any branch
123
+ # Can be replaced using the environment variable `GIT_BRANCH`
116
124
  def self.git_branch
117
- return ENV['GIT_BRANCH'] if ENV['GIT_BRANCH'].to_s.length > 0 # set by Jenkins
118
- s = Actions.sh("git rev-parse --abbrev-ref HEAD", log: false).chomp
119
- return s.to_s.strip if s.to_s.length > 0
120
- nil
121
- rescue
122
- nil
125
+ env_name = SharedValues::GIT_BRANCH_ENV_VARS.find { |env_var| FastlaneCore::Env.truthy?(env_var) }
126
+ ENV.fetch(env_name.to_s) do
127
+ # Rescues if not a git repo or no commits in a git repo
128
+ begin
129
+ Actions.sh("git rev-parse --abbrev-ref HEAD", log: false).chomp
130
+ rescue => err
131
+ UI.verbose("Error getting git branch: #{err.message}")
132
+ nil
133
+ end
134
+ end
123
135
  end
124
136
 
125
137
  private_class_method
@@ -107,12 +107,13 @@ module Fastlane
107
107
 
108
108
  puts(table)
109
109
 
110
+ fastlane_command = Helper.bundler? ? "bundle exec fastlane" : "fastlane"
110
111
  i = UI.input("Which number would you like run?")
111
112
 
112
113
  i = i.to_i - 1
113
114
  if i >= 0 && available[i]
114
115
  selection = available[i].last.pretty_name
115
- UI.important("Running lane `#{selection}`. Next time you can do this by directly typing `fastlane #{selection}` 🚀.")
116
+ UI.important("Running lane `#{selection}`. Next time you can do this by directly typing `#{fastlane_command} #{selection}` 🚀.")
116
117
  platform = selection.split(' ')[0]
117
118
  lane_name = selection.split(' ')[1]
118
119
 
@@ -123,7 +124,7 @@ module Fastlane
123
124
 
124
125
  return platform, lane_name # yeah
125
126
  else
126
- UI.user_error!("Run `fastlane` the next time you need to build, test or release your app 🚀")
127
+ UI.user_error!("Run `#{fastlane_command}` the next time you need to build, test or release your app 🚀")
127
128
  end
128
129
  end
129
130
  end
@@ -7,14 +7,13 @@ module Fastlane
7
7
  # Returns an array of FastlanePlugin objects
8
8
  def self.fetch_gems(search_query: nil)
9
9
  require 'json'
10
- require 'open-uri'
11
10
 
12
11
  page = 1
13
12
  plugins = []
14
13
  loop do
15
14
  url = "https://rubygems.org/api/v1/search.json?query=#{PluginManager.plugin_prefix}&page=#{page}"
16
15
  FastlaneCore::UI.verbose("RubyGems API Request: #{url}")
17
- results = JSON.parse(open(url).read)
16
+ results = JSON.parse(FastlaneCore::Helper.open_uri(url).read)
18
17
  break if results.count == 0
19
18
 
20
19
  plugins += results.collect do |current|
@@ -65,10 +65,9 @@ module Fastlane
65
65
 
66
66
  # Checks if the gem name is still free on RubyGems
67
67
  def gem_name_taken?(name)
68
- require 'open-uri'
69
68
  require 'json'
70
69
  url = "https://rubygems.org/api/v1/gems/#{name}.json"
71
- response = JSON.parse(open(url).read)
70
+ response = JSON.parse(FastlaneCore::Helper.open_uri(url).read)
72
71
  return !!response['version']
73
72
  rescue
74
73
  false
@@ -155,11 +155,10 @@ module Fastlane
155
155
  #####################################################
156
156
 
157
157
  def self.fetch_gem_info_from_rubygems(gem_name)
158
- require 'open-uri'
159
158
  require 'json'
160
159
  url = "https://rubygems.org/api/v1/gems/#{gem_name}.json"
161
160
  begin
162
- JSON.parse(URI.open(url).read)
161
+ JSON.parse(FastlaneCore::Helper.open_uri(url).read)
163
162
  rescue
164
163
  nil
165
164
  end
@@ -35,6 +35,10 @@ module Fastlane
35
35
  # rubocop:disable Metrics/BlockNesting
36
36
  def self.start(user: nil, is_swift_fastfile: false)
37
37
  if FastlaneCore::FastlaneFolder.setup? && !Helper.test?
38
+
39
+ # If Fastfile.swift exists, but the swift sources folder does not, rebuild it
40
+ setup_swift_support if is_swift_fastfile
41
+
38
42
  require 'fastlane/lane_list'
39
43
  Fastlane::LaneList.output(FastlaneCore::FastlaneFolder.fastfile_path)
40
44
  UI.important("------------------")
@@ -127,6 +131,24 @@ module Fastlane
127
131
  end
128
132
  # rubocop:enable Metrics/BlockNesting
129
133
 
134
+ def self.setup_swift_support
135
+ runner_source_resources = "#{Fastlane::ROOT}/swift/."
136
+ destination_path = File.expand_path('swift', FastlaneCore::FastlaneFolder.path)
137
+
138
+ # Return eearly if already setup
139
+ return if File.exist?(destination_path)
140
+
141
+ # Show message if Fastfile.swift exists but missing Swift classes and Xcode project
142
+ if FastlaneCore::FastlaneFolder.swift?
143
+ UI.important("Restoring Swift classes and FastlaneSwiftRunner.xcodeproj...")
144
+ end
145
+
146
+ FileUtils.cp_r(runner_source_resources, destination_path)
147
+ UI.success("Copied Swift fastlane runner project to '#{destination_path}'.")
148
+
149
+ Fastlane::SwiftLaneManager.first_time_setup
150
+ end
151
+
130
152
  def initialize(is_swift_fastfile: nil, user: nil, project_path: nil, had_multiple_projects_to_choose_from: nil, preferred_setup_method: nil)
131
153
  self.is_swift_fastfile = is_swift_fastfile
132
154
  self.user = user
@@ -260,21 +282,12 @@ module Fastlane
260
282
 
261
283
  def finish_up
262
284
  write_fastfile!
263
- setup_swift_support if is_swift_fastfile
285
+ self.class.setup_swift_support if is_swift_fastfile
264
286
  show_analytics_note
265
287
  explain_concepts
266
288
  suggest_next_steps
267
289
  end
268
290
 
269
- def setup_swift_support
270
- runner_source_resources = "#{Fastlane::ROOT}/swift/."
271
- destination_path = File.expand_path('swift', FastlaneCore::FastlaneFolder.path)
272
- FileUtils.cp_r(runner_source_resources, destination_path)
273
- UI.success("Copied Swift fastlane runner project to '#{destination_path}'.")
274
-
275
- Fastlane::SwiftLaneManager.first_time_setup
276
- end
277
-
278
291
  def fastfile_template_content
279
292
  if self.is_swift_fastfile
280
293
  path = "#{Fastlane::ROOT}/lib/assets/DefaultFastfileTemplate.swift"
@@ -116,6 +116,7 @@ module Fastlane
116
116
  end
117
117
 
118
118
  def get_type(param: nil, default_value: nil, optional: nil, param_type_override: nil, is_string: true)
119
+ require 'bigdecimal'
119
120
  unless param_type_override.nil?
120
121
  type = determine_type_from_override(type_override: param_type_override)
121
122
  end
@@ -168,6 +169,9 @@ module Fastlane
168
169
  default_value = "[:]"
169
170
  elsif type != "Bool" && type != "[String]" && type != "Int" && type != "@escaping ((String) -> Void)" && type != "Float" && type != "Double"
170
171
  default_value = "\"#{default_value}\""
172
+ elsif type == "Float" || type == "Double"
173
+ require 'bigdecimal'
174
+ default_value = BigDecimal(default_value).to_s
171
175
  end
172
176
  end
173
177
 
@@ -29,6 +29,8 @@ module Fastlane
29
29
  @source_swift_code_file_folder_path = File.expand_path(File.join(Fastlane::ROOT, "/swift"))
30
30
  @target_swift_code_file_folder_path = FastlaneCore::FastlaneFolder.swift_folder_path
31
31
 
32
+ Fastlane::Setup.setup_swift_support
33
+
32
34
  manifest_file = File.join(@source_swift_code_file_folder_path, "/upgrade_manifest.json")
33
35
  UI.success("loading manifest: #{manifest_file}")
34
36
  @manifest_hash = JSON.parse(File.read(manifest_file))
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.177.0'.freeze
2
+ VERSION = '2.181.0'.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