fastlane 2.238.0 → 2.241.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +57 -177
  3. data/bin/fastlane +4 -2
  4. data/credentials_manager/README.md +1 -1
  5. data/credentials_manager/lib/credentials_manager/account_manager.rb +6 -2
  6. data/deliver/lib/deliver/app_screenshot.rb +0 -4
  7. data/deliver/lib/deliver/commands_generator.rb +1 -1
  8. data/deliver/lib/deliver/detect_values.rb +3 -1
  9. data/deliver/lib/deliver/download_screenshots.rb +8 -1
  10. data/deliver/lib/deliver/html_generator.rb +1 -1
  11. data/deliver/lib/deliver/options.rb +8 -0
  12. data/deliver/lib/deliver/runner.rb +5 -4
  13. data/deliver/lib/deliver/sync_screenshots.rb +27 -28
  14. data/deliver/lib/deliver/upload_app_clip_default_experience_header_images.rb +3 -3
  15. data/deliver/lib/deliver/upload_metadata.rb +34 -16
  16. data/deliver/lib/deliver/upload_screenshots.rb +24 -18
  17. data/docs/README.md +25 -0
  18. data/fastlane/lib/assets/TeamTable.md.erb +28 -0
  19. data/fastlane/lib/fastlane/actions/appaloosa.rb +2 -1
  20. data/fastlane/lib/fastlane/actions/appium.rb +1 -1
  21. data/fastlane/lib/fastlane/actions/apteligent.rb +8 -1
  22. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +3 -1
  23. data/fastlane/lib/fastlane/actions/changelog_from_git_commits.rb +7 -2
  24. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +3 -0
  25. data/fastlane/lib/fastlane/actions/danger.rb +5 -5
  26. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -2
  27. data/fastlane/lib/fastlane/actions/docs/create_app_online.md +1 -2
  28. data/fastlane/lib/fastlane/actions/docs/get_certificates.md +0 -2
  29. data/fastlane/lib/fastlane/actions/docs/get_push_certificate.md +7 -3
  30. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +13 -3
  31. data/fastlane/lib/fastlane/actions/ensure_no_debug_code.rb +2 -2
  32. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +1 -0
  33. data/fastlane/lib/fastlane/actions/github_api.rb +1 -2
  34. data/fastlane/lib/fastlane/actions/hg_commit_version_bump.rb +1 -1
  35. data/fastlane/lib/fastlane/actions/increment_build_number.rb +1 -1
  36. data/fastlane/lib/fastlane/actions/increment_version_number.rb +1 -1
  37. data/fastlane/lib/fastlane/actions/install_xcode_plugin.rb +16 -6
  38. data/fastlane/lib/fastlane/actions/lcov.rb +11 -2
  39. data/fastlane/lib/fastlane/actions/nexus_upload.rb +16 -4
  40. data/fastlane/lib/fastlane/actions/notification.rb +3 -2
  41. data/fastlane/lib/fastlane/actions/oclint.rb +8 -8
  42. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -4
  43. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  44. data/fastlane/lib/fastlane/actions/say.rb +2 -4
  45. data/fastlane/lib/fastlane/actions/set_pod_key.rb +3 -3
  46. data/fastlane/lib/fastlane/actions/sonar.rb +16 -16
  47. data/fastlane/lib/fastlane/actions/sourcedocs.rb +8 -8
  48. data/fastlane/lib/fastlane/actions/spaceship_logs.rb +4 -2
  49. data/fastlane/lib/fastlane/actions/splunkmint.rb +8 -1
  50. data/fastlane/lib/fastlane/actions/swiftlint.rb +6 -3
  51. data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +4 -2
  52. data/fastlane/lib/fastlane/actions/upload_to_app_store.rb +5 -2
  53. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +5 -2
  54. data/fastlane/lib/fastlane/actions/verify_build.rb +1 -4
  55. data/fastlane/lib/fastlane/actions/verify_pod_keys.rb +3 -1
  56. data/fastlane/lib/fastlane/actions/xcode_server_get_assets.rb +20 -19
  57. data/fastlane/lib/fastlane/actions/xcodebuild.rb +5 -6
  58. data/fastlane/lib/fastlane/actions/zip.rb +2 -1
  59. data/fastlane/lib/fastlane/auto_complete.rb +1 -1
  60. data/fastlane/lib/fastlane/cli_tools_distributor.rb +14 -0
  61. data/fastlane/lib/fastlane/documentation/markdown_docs_generator.rb +23 -0
  62. data/fastlane/lib/fastlane/environment_printer.rb +12 -25
  63. data/fastlane/lib/fastlane/fast_file.rb +2 -1
  64. data/fastlane/lib/fastlane/fastlane_require.rb +5 -1
  65. data/fastlane/lib/fastlane/helper/git_helper.rb +4 -2
  66. data/fastlane/lib/fastlane/helper/sh_helper.rb +25 -7
  67. data/fastlane/lib/fastlane/new_action.rb +1 -1
  68. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -1
  69. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -1
  70. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +36 -4
  71. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +1 -1
  72. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +1 -1
  73. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +7 -7
  74. data/fastlane/lib/fastlane/swift_lane_manager.rb +22 -4
  75. data/fastlane/lib/fastlane/version.rb +3 -2
  76. data/fastlane/swift/Deliverfile.swift +1 -1
  77. data/fastlane/swift/DeliverfileProtocol.swift +8 -1
  78. data/fastlane/swift/Fastlane.swift +129 -11
  79. data/fastlane/swift/Gymfile.swift +1 -1
  80. data/fastlane/swift/GymfileProtocol.swift +8 -1
  81. data/fastlane/swift/MainProcess.swift +190 -20
  82. data/fastlane/swift/Matchfile.swift +1 -1
  83. data/fastlane/swift/MatchfileProtocol.swift +10 -3
  84. data/fastlane/swift/Precheckfile.swift +1 -1
  85. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  86. data/fastlane/swift/Scanfile.swift +1 -1
  87. data/fastlane/swift/ScanfileProtocol.swift +15 -1
  88. data/fastlane/swift/Screengrabfile.swift +1 -1
  89. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  90. data/fastlane/swift/Snapshotfile.swift +1 -1
  91. data/fastlane/swift/SnapshotfileProtocol.swift +8 -1
  92. data/fastlane/swift/formatting/Rakefile +1 -0
  93. data/fastlane/swift/main.swift +4 -1
  94. data/fastlane_core/README.md +1 -1
  95. data/fastlane_core/lib/fastlane_core/analytics/analytics_event_builder.rb +1 -17
  96. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +23 -8
  97. data/fastlane_core/lib/fastlane_core/device_manager.rb +2 -2
  98. data/fastlane_core/lib/fastlane_core/fastlane_pty.rb +20 -7
  99. data/fastlane_core/lib/fastlane_core/helper.rb +34 -5
  100. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +1 -1
  101. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +16 -27
  102. data/fastlane_core/lib/fastlane_core/keychain_importer.rb +31 -28
  103. data/fastlane_core/lib/fastlane_core/languages.rb +0 -1
  104. data/fastlane_core/lib/fastlane_core/print_table.rb +5 -2
  105. data/fastlane_core/lib/fastlane_core/project.rb +19 -0
  106. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +10 -19
  107. data/fastlane_core/lib/fastlane_core/secrets.rb +77 -0
  108. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +3 -3
  109. data/fastlane_core/lib/fastlane_core/ui/github_issue_inspector_reporter.rb +1 -1
  110. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +2 -1
  111. data/fastlane_core/lib/fastlane_core.rb +1 -0
  112. data/frameit/lib/frameit/device.rb +1 -1
  113. data/frameit/lib/frameit/frame_downloader.rb +2 -0
  114. data/frameit/lib/frameit/runner.rb +3 -2
  115. data/frameit/lib/frameit/screenshot.rb +0 -1
  116. data/gym/lib/gym/generators/build_command_generator.rb +4 -4
  117. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +3 -3
  118. data/gym/lib/gym/options.rb +5 -0
  119. data/gym/lib/gym/runner.rb +1 -1
  120. data/internal/README.md +1 -1
  121. data/match/lib/match/encryption/openssl.rb +6 -2
  122. data/match/lib/match/generator.rb +1 -0
  123. data/match/lib/match/nuke.rb +2 -2
  124. data/match/lib/match/options.rb +13 -5
  125. data/match/lib/match/runner.rb +30 -3
  126. data/match/lib/match/storage/git_storage.rb +44 -11
  127. data/match/lib/match/storage/gitlab/secure_file.rb +2 -1
  128. data/match/lib/match/storage/google_cloud_storage.rb +6 -1
  129. data/match/lib/match/storage/interface.rb +8 -5
  130. data/pem/lib/pem/manager.rb +5 -1
  131. data/pem/lib/pem/module.rb +0 -4
  132. data/pem/lib/pem/options.rb +6 -0
  133. data/pilot/lib/pilot/build_manager.rb +32 -0
  134. data/pilot/lib/pilot/options.rb +8 -0
  135. data/precheck/lib/precheck/rule_processor.rb +1 -0
  136. data/produce/lib/produce/developer_center.rb +49 -2
  137. data/produce/lib/produce/itunes_connect.rb +1 -1
  138. data/produce/lib/produce/module.rb +21 -0
  139. data/produce/lib/produce/options.rb +17 -0
  140. data/produce/lib/produce/service.rb +3 -5
  141. data/produce/lib/produce.rb +0 -1
  142. data/scan/lib/scan/options.rb +12 -0
  143. data/scan/lib/scan/runner.rb +1 -1
  144. data/scan/lib/scan/test_command_generator.rb +12 -9
  145. data/scan/lib/scan/test_result_parser.rb +1 -0
  146. data/scan/lib/scan/xcpretty_reporter_options_generator.rb +2 -2
  147. data/screengrab/lib/screengrab/page.html.erb +12 -7
  148. data/screengrab/lib/screengrab/reports_generator.rb +1 -1
  149. data/sigh/lib/assets/resign.sh +38 -9
  150. data/sigh/lib/sigh/local_manage.rb +1 -1
  151. data/sigh/lib/sigh/options.rb +5 -0
  152. data/sigh/lib/sigh/resign.rb +3 -3
  153. data/sigh/lib/sigh/runner.rb +6 -1
  154. data/snapshot/lib/snapshot/options.rb +5 -0
  155. data/snapshot/lib/snapshot/page.html.erb +17 -12
  156. data/snapshot/lib/snapshot/reports_generator.rb +1 -1
  157. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +1 -1
  158. data/snapshot/lib/snapshot.rb +0 -2
  159. data/spaceship/README.md +2 -3
  160. data/spaceship/lib/spaceship/base.rb +3 -1
  161. data/spaceship/lib/spaceship/client.rb +159 -19
  162. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +16 -0
  163. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +13 -2
  164. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +6 -0
  165. data/spaceship/lib/spaceship/connect_api/models/profile.rb +7 -5
  166. data/spaceship/lib/spaceship/connect_api/models/routing_app_coverage.rb +75 -0
  167. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +25 -0
  168. data/spaceship/lib/spaceship/connect_api/token.rb +6 -1
  169. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +45 -0
  170. data/spaceship/lib/spaceship/connect_api.rb +1 -0
  171. data/spaceship/lib/spaceship/du/upload_file.rb +4 -3
  172. data/spaceship/lib/spaceship/errors.rb +7 -1
  173. data/spaceship/lib/spaceship/globals.rb +2 -2
  174. data/spaceship/lib/spaceship/portal/merchant.rb +127 -2
  175. data/spaceship/lib/spaceship/portal/portal_client.rb +58 -0
  176. data/spaceship/lib/spaceship/portal/ui/select_team.rb +0 -2
  177. data/spaceship/lib/spaceship/portal/website_push.rb +8 -2
  178. data/spaceship/lib/spaceship/test_flight/client.rb +0 -22
  179. data/spaceship/lib/spaceship/test_flight.rb +0 -1
  180. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +11 -0
  181. data/supply/lib/supply/client.rb +6 -0
  182. data/supply/lib/supply/options.rb +1 -0
  183. data/supply/lib/supply/reader.rb +15 -0
  184. data/supply/lib/supply.rb +0 -1
  185. data/trainer/lib/trainer/xcresult/helper.rb +27 -13
  186. metadata +80 -64
  187. data/produce/lib/produce/available_default_languages.rb +0 -62
  188. data/snapshot/lib/snapshot/screenshot_flatten.rb +0 -20
  189. data/snapshot/lib/snapshot/screenshot_rotate.rb +0 -36
  190. data/spaceship/lib/spaceship/test_flight/app_test_info.rb +0 -40
  191. data/supply/lib/supply/apk_listing.rb +0 -14
  192. /data/fastlane/lib/assets/{custom_action_template.rb → custom_action_template.rb.template} +0 -0
@@ -43,10 +43,11 @@ module Fastlane
43
43
  description: "Bundle identifier of application to be opened when the notification is clicked",
44
44
  optional: true),
45
45
  FastlaneCore::ConfigItem.new(key: :app_icon,
46
- description: "The URL of an image to display instead of the application icon (Mavericks+ only)",
46
+ deprecated: true,
47
+ description: "The URL of an image to display instead of the application icon",
47
48
  optional: true),
48
49
  FastlaneCore::ConfigItem.new(key: :content_image,
49
- description: "The URL of an image to display attached to the notification (Mavericks+ only)",
50
+ description: "The local path of an image to display attached to the notification (Mavericks+)",
50
51
  optional: true),
51
52
  FastlaneCore::ConfigItem.new(key: :open,
52
53
  description: "URL of the resource to be opened when the notification is clicked",
@@ -37,16 +37,16 @@ module Fastlane
37
37
  exclude_regex = ensure_regex_is_not_string!(exclude_regex)
38
38
 
39
39
  files = JSON.parse(File.read(compile_commands)).map do |compile_command|
40
- file = compile_command['file']
40
+ # Paths taken from xcodebuild's output escape spaces with a backslash
41
+ file = compile_command['file'].gsub('\ ', ' ')
41
42
  File.exist?(file) ? file : File.join(compile_command['directory'], file)
42
43
  end
43
44
 
44
45
  files.uniq!
45
46
  files.select! do |file|
46
- file_ruby = file.gsub('\ ', ' ')
47
- File.exist?(file_ruby) and
48
- (!select_regex or file_ruby =~ select_regex) and
49
- (!exclude_regex or file_ruby !~ exclude_regex)
47
+ File.exist?(file) and
48
+ (!select_regex or file =~ select_regex) and
49
+ (!exclude_regex or file !~ exclude_regex)
50
50
  end
51
51
 
52
52
  command_prefix = [
@@ -58,7 +58,7 @@ module Fastlane
58
58
  report_type = params[:report_type]
59
59
  report_path = params[:report_path] ? params[:report_path] : 'oclint_report.' + report_type
60
60
 
61
- oclint_args = ["-report-type=#{report_type}", "-o=#{report_path}"]
61
+ oclint_args = ["-report-type=#{report_type}", "-o=#{report_path.shellescape}"]
62
62
 
63
63
  oclint_args << "-list-enabled-rules" if params[:list_enabled_rules]
64
64
 
@@ -85,9 +85,9 @@ module Fastlane
85
85
 
86
86
  command = [
87
87
  command_prefix,
88
- oclint_path,
88
+ oclint_path.shellescape,
89
89
  oclint_args,
90
- '"' + files.join('" "') + '"'
90
+ files.shelljoin
91
91
  ].join(' ')
92
92
 
93
93
  Actions.lane_context[SharedValues::FL_OCLINT_REPORT_PATH] = File.expand_path(report_path)
@@ -3,22 +3,27 @@ module Fastlane
3
3
  # Push local changes to the remote branch
4
4
  class PushToGitRemoteAction < Action
5
5
  def self.run(params)
6
- # Find the local git branch using HEAD or fallback to CI's ENV git branch if you're in detached HEAD state
6
+ # Find the current branch, or on a detached HEAD the branch CI names in its environment variables
7
7
  local_git_branch = Actions.git_branch_name_using_HEAD
8
- local_git_branch = Actions.git_branch unless local_git_branch && local_git_branch != "HEAD"
8
+ detached_head = local_git_branch == "HEAD"
9
+ local_git_branch = Actions.git_branch unless local_git_branch && !detached_head
9
10
 
10
11
  local_branch = params[:local_branch]
11
12
  local_branch ||= local_git_branch.gsub(%r{#{params[:remote]}\/}, '') if local_git_branch
12
13
  UI.user_error!('Failed to get the current branch.') unless local_branch
13
14
 
14
15
  remote_branch = params[:remote_branch] || local_branch
16
+ UI.user_error!("HEAD is detached and no branch name was found in the CI environment variables; pass remote_branch") if remote_branch == "HEAD"
17
+
18
+ # On a detached HEAD the branch name comes from CI, and its local branch does not have the commits made on HEAD
19
+ source = params[:local_branch] || (detached_head ? "HEAD" : local_branch)
15
20
 
16
21
  # construct our command as an array of components
17
22
  command = [
18
23
  'git',
19
24
  'push',
20
25
  params[:remote],
21
- "#{local_branch.shellescape}:#{remote_branch.shellescape}"
26
+ "#{source.shellescape}:#{remote_branch.shellescape}"
22
27
  ]
23
28
 
24
29
  # optionally add the tags component
@@ -37,7 +42,7 @@ module Fastlane
37
42
  command << '--set-upstream' if params[:set_upstream]
38
43
 
39
44
  # optionally add the --push_options components
40
- params[:push_options].each { |push_option| command << "--push-option=#{push_option}" } if params[:push_options]
45
+ params[:push_options].each { |push_option| command << "--push-option=#{push_option.shellescape}" } if params[:push_options]
41
46
 
42
47
  # execute our command
43
48
  return command.join(' ') if Helper.test?
@@ -4,7 +4,7 @@ module Fastlane
4
4
  module Actions
5
5
  class RegisterDeviceAction < Action
6
6
  def self.is_supported?(platform)
7
- platform == :ios
7
+ [:ios, :mac].include?(platform)
8
8
  end
9
9
 
10
10
  def self.run(params)
@@ -2,15 +2,13 @@ module Fastlane
2
2
  module Actions
3
3
  class SayAction < Action
4
4
  def self.run(params)
5
- text = params[:text]
6
- text = text.join(' ')
7
- text = text.tr("'", '"')
5
+ text = params[:text].join(' ')
8
6
 
9
7
  if params[:mute]
10
8
  UI.message(text)
11
9
  return text
12
10
  else
13
- Actions.sh("say '#{text}'")
11
+ Actions.sh('say', text)
14
12
  end
15
13
  end
16
14
 
@@ -8,9 +8,9 @@ module Fastlane
8
8
  cmd << ['bundle exec'] if params[:use_bundle_exec] && shell_out_should_use_bundle_exec?
9
9
  cmd << ['pod keys set']
10
10
 
11
- cmd << ["\"#{params[:key]}\""]
12
- cmd << ["\"#{params[:value]}\""]
13
- cmd << ["\"#{params[:project]}\""] if params[:project]
11
+ cmd << [params[:key].shellescape]
12
+ cmd << [params[:value].shellescape]
13
+ cmd << [params[:project].shellescape] if params[:project]
14
14
 
15
15
  Actions.sh(cmd.join(' '))
16
16
  end
@@ -11,22 +11,22 @@ module Fastlane
11
11
  ].join(' ')
12
12
 
13
13
  sonar_scanner_args = []
14
- sonar_scanner_args << "-Dproject.settings=\"#{params[:project_configuration_path]}\"" if params[:project_configuration_path]
15
- sonar_scanner_args << "-Dsonar.projectKey=\"#{params[:project_key]}\"" if params[:project_key]
16
- sonar_scanner_args << "-Dsonar.projectName=\"#{params[:project_name]}\"" if params[:project_name]
17
- sonar_scanner_args << "-Dsonar.projectVersion=\"#{params[:project_version]}\"" if params[:project_version]
18
- sonar_scanner_args << "-Dsonar.sources=\"#{params[:sources_path]}\"" if params[:sources_path]
19
- sonar_scanner_args << "-Dsonar.exclusions=\"#{params[:exclusions]}\"" if params[:exclusions]
20
- sonar_scanner_args << "-Dsonar.language=\"#{params[:project_language]}\"" if params[:project_language]
21
- sonar_scanner_args << "-Dsonar.sourceEncoding=\"#{params[:source_encoding]}\"" if params[:source_encoding]
22
- sonar_scanner_args << "-Dsonar.login=\"#{params[:sonar_login]}\"" if params[:sonar_login]
23
- sonar_scanner_args << "-Dsonar.token=\"#{params[:sonar_token]}\"" if params[:sonar_token]
24
- sonar_scanner_args << "-Dsonar.host.url=\"#{params[:sonar_url]}\"" if params[:sonar_url]
25
- sonar_scanner_args << "-Dsonar.organization=\"#{params[:sonar_organization]}\"" if params[:sonar_organization]
26
- sonar_scanner_args << "-Dsonar.branch.name=\"#{params[:branch_name]}\"" if params[:branch_name]
27
- sonar_scanner_args << "-Dsonar.pullrequest.branch=\"#{params[:pull_request_branch]}\"" if params[:pull_request_branch]
28
- sonar_scanner_args << "-Dsonar.pullrequest.base=\"#{params[:pull_request_base]}\"" if params[:pull_request_base]
29
- sonar_scanner_args << "-Dsonar.pullrequest.key=\"#{params[:pull_request_key]}\"" if params[:pull_request_key]
14
+ sonar_scanner_args << "-Dproject.settings=#{params[:project_configuration_path].shellescape}" if params[:project_configuration_path]
15
+ sonar_scanner_args << "-Dsonar.projectKey=#{params[:project_key].shellescape}" if params[:project_key]
16
+ sonar_scanner_args << "-Dsonar.projectName=#{params[:project_name].shellescape}" if params[:project_name]
17
+ sonar_scanner_args << "-Dsonar.projectVersion=#{params[:project_version].shellescape}" if params[:project_version]
18
+ sonar_scanner_args << "-Dsonar.sources=#{params[:sources_path].shellescape}" if params[:sources_path]
19
+ sonar_scanner_args << "-Dsonar.exclusions=#{params[:exclusions].shellescape}" if params[:exclusions]
20
+ sonar_scanner_args << "-Dsonar.language=#{params[:project_language].shellescape}" if params[:project_language]
21
+ sonar_scanner_args << "-Dsonar.sourceEncoding=#{params[:source_encoding].shellescape}" if params[:source_encoding]
22
+ sonar_scanner_args << "-Dsonar.login=#{params[:sonar_login].shellescape}" if params[:sonar_login]
23
+ sonar_scanner_args << "-Dsonar.token=#{params[:sonar_token].shellescape}" if params[:sonar_token]
24
+ sonar_scanner_args << "-Dsonar.host.url=#{params[:sonar_url].shellescape}" if params[:sonar_url]
25
+ sonar_scanner_args << "-Dsonar.organization=#{params[:sonar_organization].shellescape}" if params[:sonar_organization]
26
+ sonar_scanner_args << "-Dsonar.branch.name=#{params[:branch_name].shellescape}" if params[:branch_name]
27
+ sonar_scanner_args << "-Dsonar.pullrequest.branch=#{params[:pull_request_branch].shellescape}" if params[:pull_request_branch]
28
+ sonar_scanner_args << "-Dsonar.pullrequest.base=#{params[:pull_request_base].shellescape}" if params[:pull_request_base]
29
+ sonar_scanner_args << "-Dsonar.pullrequest.key=#{params[:pull_request_key].shellescape}" if params[:pull_request_key]
30
30
 
31
31
  sonar_scanner_args << params[:sonar_runner_args] if params[:sonar_runner_args]
32
32
 
@@ -6,20 +6,20 @@ module Fastlane
6
6
 
7
7
  command = "sourcedocs generate"
8
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?
9
+ command << " --spm-module #{params[:spm_module].shellescape}" unless params[:spm_module].nil?
10
+ command << " --module-name #{params[:module_name].shellescape}" unless params[:module_name].nil?
11
+ command << " --link-beginning #{params[:link_beginning].shellescape}" unless params[:link_beginning].nil?
12
+ command << " --link-ending #{params[:link_ending].shellescape}" unless params[:link_ending].nil?
13
+ command << " --output-folder #{params[:output_folder].shellescape}" unless params[:output_folder].nil?
14
+ command << " --min-acl #{params[:min_acl].shellescape}" unless params[:min_acl].nil?
15
15
  command << " --module-name-path" if params[:module_name_path]
16
16
  command << " --clean" if params[:clean]
17
17
  command << " --collapsible" if params[:collapsible]
18
18
  command << " --table-of-contents" if params[:table_of_contents]
19
19
  command << " --reproducible-docs" if params[:reproducible]
20
20
  unless params[:scheme].nil?
21
- command << " -- -scheme #{params[:scheme]}"
22
- command << " -sdk #{params[:sdk_platform]}" unless params[:sdk_platform].nil?
21
+ command << " -- -scheme #{params[:scheme].shellescape}"
22
+ command << " -sdk #{params[:sdk_platform].shellescape}" unless params[:sdk_platform].nil?
23
23
  end
24
24
  Actions.sh(command)
25
25
  end
@@ -1,3 +1,5 @@
1
+ require 'tmpdir'
2
+
1
3
  module Fastlane
2
4
  module Actions
3
5
  class SpaceshipLogsAction < Action
@@ -8,8 +10,8 @@ module Fastlane
8
10
  copy_to_path = params[:copy_to_path]
9
11
  copy_to_clipboard = params[:copy_to_clipboard]
10
12
 
11
- # Get log files
12
- files = Dir.glob("/tmp/spaceship*.log").sort_by { |f| File.mtime(f) }.reverse
13
+ # Get log files, from wherever Spaceship::Client#logger writes them.
14
+ files = Dir.glob(File.join(Dir.tmpdir, "spaceship*.log")).sort_by { |f| File.mtime(f) }.reverse
13
15
 
14
16
  if files.size == 0
15
17
  UI.message("No Spaceship log files found")
@@ -149,7 +149,14 @@ module Fastlane
149
149
  end
150
150
 
151
151
  def self.category
152
- :beta
152
+ :deprecated
153
+ end
154
+
155
+ def self.deprecated_notes
156
+ [
157
+ "Splunk MINT reached End of Life in December 2021 for all MINT products, including the SDK and its Web Service.",
158
+ "See [Splunk MINT SDK for iOS (EOL)](https://docs.splunk.com/Documentation/MintIOSSDK/latest/DevGuide/APIReference)."
159
+ ].join("\n")
153
160
  end
154
161
  end
155
162
  end
@@ -44,7 +44,10 @@ module Fastlane
44
44
  begin
45
45
  Actions.sh(command)
46
46
  rescue
47
- handle_swiftlint_error(params[:ignore_exit_status], $?.exitstatus)
47
+ # $? is the status of the last subprocess this thread ran, not
48
+ # necessarily this one: nil when the command never launched, and stale
49
+ # when something else ran in between. Only report it when it is there.
50
+ handle_swiftlint_error(params[:ignore_exit_status], $?&.exitstatus)
48
51
  raise if params[:raise_if_swiftlint_error]
49
52
  end
50
53
  end
@@ -248,10 +251,10 @@ module Fastlane
248
251
  end
249
252
 
250
253
  UI.important("")
251
- UI.important("SwiftLint finished with exit code #{exit_status}, #{failure_suffix}")
254
+ UI.important("SwiftLint finished with exit code #{exit_status || 'unknown'}, #{failure_suffix}")
252
255
  UI.important(secondary_message)
253
256
  UI.important("")
254
- UI.user_error!("SwiftLint finished with errors (exit code: #{exit_status})") unless ignore_exit_status
257
+ UI.user_error!("SwiftLint finished with errors (exit code: #{exit_status || 'unknown'})") unless ignore_exit_status
255
258
  end
256
259
  end
257
260
  end
@@ -1,5 +1,7 @@
1
1
  # coding: utf-8
2
2
 
3
+ require 'tmpdir'
4
+
3
5
  module Fastlane
4
6
  module Actions
5
7
  module SharedValues
@@ -23,7 +25,7 @@ module Fastlane
23
25
  UI.message("Downloading root certificate from (#{ROOT_CERTIFICATE_URL}) to path '#{params[:certificate]}'")
24
26
  require 'open-uri'
25
27
  File.open(params[:certificate], "w:ASCII-8BIT") do |file|
26
- file.write(URI.open(ROOT_CERTIFICATE_URL, "rb").read)
28
+ file.write(URI.parse(ROOT_CERTIFICATE_URL).open("rb").read)
27
29
  end
28
30
  end
29
31
 
@@ -146,7 +148,7 @@ module Fastlane
146
148
  FastlaneCore::ConfigItem.new(key: :certificate,
147
149
  env_name: "FL_PROJECT_PROVISIONING_CERTIFICATE_PATH",
148
150
  description: "Path to apple root certificate",
149
- default_value: "/tmp/AppleIncRootCertificate.cer"),
151
+ default_value: File.join(Dir.tmpdir, "AppleIncRootCertificate.cer")),
150
152
  FastlaneCore::ConfigItem.new(key: :code_signing_identity,
151
153
  env_name: "FL_PROJECT_PROVISIONING_CODE_SIGN_IDENTITY",
152
154
  description: "Code sign identity for build configuration",
@@ -10,8 +10,11 @@ module Fastlane
10
10
  begin
11
11
  config.load_configuration_file("Deliverfile")
12
12
  config[:screenshots_path] ||= Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] if Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
13
- config[:ipa] ||= Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
14
- config[:pkg] ||= Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
13
+ # The build from gym wins over the newest *.ipa/*.pkg in the current directory, the options' default
14
+ unless config.specified?(:ipa) || config.specified?(:pkg)
15
+ config[:ipa] = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
16
+ config[:pkg] = Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
17
+ end
15
18
 
16
19
  # Only set :api_key from SharedValues if :api_key_path isn't set (conflicting options)
17
20
  unless config[:api_key_path]
@@ -11,9 +11,12 @@ module Fastlane
11
11
  values[:changelog] ||= changelog if changelog
12
12
 
13
13
  unless distribute_only
14
- values[:ipa] ||= Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
14
+ # The build from gym wins over the newest *.ipa/*.pkg in the current directory, the options' default
15
+ unless values.specified?(:ipa) || values.specified?(:pkg)
16
+ values[:ipa] = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
17
+ values[:pkg] = Actions.lane_context[SharedValues::PKG_OUTPUT_PATH] if Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
18
+ end
15
19
  values[:ipa] = File.expand_path(values[:ipa]) if values[:ipa]
16
- values[:pkg] ||= Actions.lane_context[SharedValues::PKG_OUTPUT_PATH]
17
20
  values[:pkg] = File.expand_path(values[:pkg]) if values[:pkg]
18
21
  end
19
22
 
@@ -69,10 +69,7 @@ module Fastlane
69
69
  provision_profile_path = "#{app_path}/embedded.mobileprovision"
70
70
  UI.user_error!("Unable to find embedded profile in #{provision_profile_path}") unless File.exist?(provision_profile_path)
71
71
 
72
- profile = `cat #{provision_profile_path.shellescape} | security cms -D`
73
- UI.user_error!("Unable to extract profile") unless $? == 0
74
-
75
- plist = Plist.parse_xml(profile)
72
+ plist = FastlaneCore::ProvisioningProfile.parse(provision_profile_path)
76
73
 
77
74
  values['app_name'] = plist['AppIDName']
78
75
  values['provisioning_uuid'] = plist['UUID']
@@ -29,7 +29,9 @@ module Fastlane
29
29
  end
30
30
 
31
31
  def self.value(key, target)
32
- value = `pod keys get #{key} #{target}`
32
+ command = ["pod", "keys", "get", key]
33
+ command << target unless target.to_s.empty?
34
+ value = `#{command.shelljoin}`
33
35
  value.split("]").last.strip
34
36
  end
35
37
 
@@ -20,12 +20,8 @@ module Fastlane
20
20
  password = params[:password]
21
21
  trust_self_signed_certs = params[:trust_self_signed_certs]
22
22
 
23
- # setup (not)trusting self signed certificates.
24
23
  # it's normal to have a self signed certificate on your Xcode Server
25
- Excon.defaults[:ssl_verify_peer] = !trust_self_signed_certs # for self-signed certificates
26
-
27
- # create Xcode Server config
28
- xcs = XcodeServer.new(host, username, password)
24
+ xcs = XcodeServer.new(host, username, password, ssl_verify_peer: !trust_self_signed_certs)
29
25
  bots = xcs.fetch_all_bots
30
26
 
31
27
  UI.important("Fetched #{bots.count} Bots from Xcode Server at #{host}.")
@@ -106,10 +102,11 @@ module Fastlane
106
102
  end
107
103
 
108
104
  class XcodeServer
109
- def initialize(host, username, password)
105
+ def initialize(host, username, password, ssl_verify_peer: true)
110
106
  @host = host.start_with?('https://') ? host : "https://#{host}"
111
107
  @username = username
112
108
  @password = password
109
+ @ssl_verify_peer = ssl_verify_peer
113
110
  end
114
111
 
115
112
  def fetch_all_bots
@@ -129,18 +126,18 @@ module Fastlane
129
126
  # create a temp folder and a file, stream the download into it
130
127
  Dir.mktmpdir do |dir|
131
128
  temp_file = File.join(dir, "tmp_download.#{rand(1_000_000)}")
132
- f = open(temp_file, 'w')
133
- streamer = lambda do |chunk, remaining_bytes, total_bytes|
134
- if remaining_bytes && total_bytes
135
- UI.important("Downloading: #{100 - (100 * remaining_bytes.to_f / total_bytes.to_f).to_i}%")
136
- else
137
- UI.error(chunk.to_s)
129
+ response = File.open(temp_file, 'w') do |f|
130
+ streamer = lambda do |chunk, remaining_bytes, total_bytes|
131
+ if remaining_bytes && total_bytes
132
+ UI.important("Downloading: #{100 - (100 * remaining_bytes.to_f / total_bytes.to_f).to_i}%")
133
+ else
134
+ UI.error(chunk.to_s)
135
+ end
136
+ f.write(chunk)
138
137
  end
139
- f.write(chunk)
140
- end
141
138
 
142
- response = self.get_endpoint("/integrations/#{integration_id}/assets", streamer)
143
- f.close
139
+ self.get_endpoint("/integrations/#{integration_id}/assets", streamer)
140
+ end
144
141
 
145
142
  UI.user_error!("Integration doesn't have any assets (it probably never ran).") if response.status == 500
146
143
  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
@@ -199,9 +196,9 @@ module Fastlane
199
196
  headers = self.headers || {}
200
197
 
201
198
  if response_block
202
- response = Excon.get(url, response_block: response_block, headers: headers)
199
+ response = Excon.get(url, response_block: response_block, headers: headers, ssl_verify_peer: @ssl_verify_peer)
203
200
  else
204
- response = Excon.get(url, headers: headers)
201
+ response = Excon.get(url, headers: headers, ssl_verify_peer: @ssl_verify_peer)
205
202
  end
206
203
 
207
204
  return response
@@ -305,7 +302,11 @@ module Fastlane
305
302
  end
306
303
 
307
304
  def self.category
308
- :testing
305
+ :deprecated
306
+ end
307
+
308
+ def self.deprecated_notes
309
+ "Xcode Server is no longer supported since Xcode 14 ([Xcode 14 Release Notes](https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes))."
309
310
  end
310
311
  end
311
312
  end
@@ -260,7 +260,7 @@ module Fastlane
260
260
  xcpretty_command = "#{xcpretty_command} --utf" if xcpretty_utf
261
261
  end
262
262
 
263
- pipe_command = "| tee '#{buildlog_path}/xcodebuild.log' #{xcpretty_command}"
263
+ pipe_command = "| tee #{File.join(buildlog_path, 'xcodebuild.log').shellescape} #{xcpretty_command}"
264
264
 
265
265
  FileUtils.mkdir_p buildlog_path
266
266
  UI.message("For a more detailed xcodebuild log open #{buildlog_path}/xcodebuild.log")
@@ -293,7 +293,7 @@ module Fastlane
293
293
 
294
294
  # If raw_buildlog and some reports had to be created, create xcpretty reports from the build log
295
295
  if raw_buildlog && xcpretty_args.include?('--report')
296
- output_result = Actions.sh "set -o pipefail && cat '#{buildlog_path}/xcodebuild.log' | xcpretty #{xcpretty_args} > /dev/null"
296
+ output_result = Actions.sh "set -o pipefail && cat #{File.join(buildlog_path, 'xcodebuild.log').shellescape} | xcpretty #{xcpretty_args} > /dev/null"
297
297
  end
298
298
 
299
299
  output_result
@@ -349,11 +349,10 @@ module Fastlane
349
349
  end.compact
350
350
  end
351
351
 
352
- # Cleans values for build settings
353
- # Only escaping `$(inherit)` types of values since "sh"
354
- # interprets these as sub-commands instead of passing value into xcodebuild
352
+ # Escapes what sh interprets inside double quotes, so the value reaches xcodebuild unchanged.
353
+ # xcodebuild expands $(VAR), ${VAR} and $VAR itself, from build settings and the environment.
355
354
  def self.clean_build_setting_value(value)
356
- value.to_s.gsub('$(', '\\$(')
355
+ value.to_s.gsub(/[\\"$`]/) { |char| "\\#{char}" }
357
356
  end
358
357
 
359
358
  def self.detect_workspace
@@ -103,7 +103,8 @@ module Fastlane
103
103
  FastlaneCore::ConfigItem.new(key: :password,
104
104
  env_name: "FL_ZIP_PASSWORD",
105
105
  description: "Encrypt the contents of the zip archive using a password",
106
- optional: true),
106
+ optional: true,
107
+ sensitive: true),
107
108
  FastlaneCore::ConfigItem.new(key: :symlinks,
108
109
  env_name: "FL_ZIP_SYMLINKS",
109
110
  description: "Store symbolic links as such in the zip archive",
@@ -45,7 +45,7 @@ module Fastlane
45
45
  custom_commands = options.custom.to_s.split(',')
46
46
 
47
47
  Fastlane::SHELLS.each do |shell_name|
48
- open("#{fastlane_conf_dir}/completions/completion.#{shell_name}", 'a') do |file|
48
+ File.open("#{fastlane_conf_dir}/completions/completion.#{shell_name}", 'a') do |file|
49
49
  default_line_prefix = Helper.bundler? ? "bundle exec " : ""
50
50
 
51
51
  file.puts(self.get_auto_complete_line(shell_name, "#{default_line_prefix}fastlane"))
@@ -53,6 +53,7 @@ module Fastlane
53
53
  # We want to avoid printing output other than the version number if we are running `fastlane -v`
54
54
  unless running_version_command? || running_init_command?
55
55
  print_bundle_exec_warning(is_slow: (Time.now - before_import_time > 3))
56
+ print_running_version
56
57
  end
57
58
 
58
59
  # Try to check UTF-8 with `locale`, fallback to environment variables
@@ -179,6 +180,19 @@ module Fastlane
179
180
  }[tool_name] || tool_name
180
181
  end
181
182
 
183
+ # Which fastlane a log comes from: `fastlane env`, run later by hand, can describe another install. See #29938.
184
+ def print_running_version
185
+ source = FastlaneCore::Helper.install_method
186
+ if ARGV.include?("--verbose")
187
+ require "fastlane/environment_printer"
188
+ location = FastlaneCore::Helper.bundler? ? ENV["BUNDLE_GEMFILE"] : $PROGRAM_NAME
189
+ # Dir.home rather than ENV['HOME'], which does not match the paths Ruby gives on Windows
190
+ source += ": #{EnvironmentPrinter.anonymized_path(location.to_s, Dir.home)}"
191
+ end
192
+
193
+ UI.message("fastlane #{Fastlane::VERSION} (Ruby #{RUBY_VERSION}, #{source})")
194
+ end
195
+
182
196
  def print_bundle_exec_warning(is_slow: false)
183
197
  return if FastlaneCore::Helper.bundler? # user is already using bundler
184
198
  return if FastlaneCore::Env.truthy?('SKIP_SLOW_FASTLANE_WARNING') # user disabled the warnings
@@ -193,9 +193,32 @@ module Fastlane
193
193
  FileUtils.cp(current_asset_path, File.join(docs_dir, "img", "actions", File.basename(current_asset_path)))
194
194
  end
195
195
 
196
+ # Generate the team table (docs/generated/team-table.md) from team.json
197
+ generate_team_table(docs_dir)
198
+
196
199
  UI.success("Generated new docs on path #{target_path}")
197
200
  end
198
201
 
202
+ def generate_team_table(docs_dir)
203
+ team_json_path = File.expand_path(File.join(Fastlane::ROOT, "..", "internal", "team.json"))
204
+ unless File.exist?(team_json_path)
205
+ UI.message("Skipping team table generation, could not find #{team_json_path}")
206
+ return
207
+ end
208
+
209
+ File.write(File.join(docs_dir, "generated", "team-table.md"), self.class.render_team(team_json_path))
210
+ end
211
+
212
+ # Also used by the `generate_team_table` rake task, so it must not depend on fastlane being loaded
213
+ def self.render_team(team_json_path)
214
+ require 'erb'
215
+ require 'json'
216
+
217
+ team, alumni = JSON.parse(File.read(team_json_path)).to_a.shuffle.partition { |_, user| !user['alumni'] }
218
+ template = File.expand_path("../../assets/TeamTable.md.erb", __dir__)
219
+ ERB.new(File.read(template), trim_mode: '-').result(binding)
220
+ end
221
+
199
222
  private
200
223
 
201
224
  def readable_category_name(category_symbol)
@@ -252,34 +252,21 @@ module Fastlane
252
252
  def self.print_fastlane_files
253
253
  env_output = "### fastlane files:\n\n"
254
254
 
255
- fastlane_path = FastlaneCore::FastlaneFolder.fastfile_path
256
-
257
- if fastlane_path && File.exist?(fastlane_path)
258
- env_output << "<details>"
259
- env_output << "<summary>`#{fastlane_path}`</summary>\n"
255
+ {
256
+ "Fastfile" => FastlaneCore::FastlaneFolder.fastfile_path,
257
+ "Appfile" => CredentialsManager::AppfileConfig.default_path
258
+ }.each do |name, path|
259
+ if path && File.exist?(path)
260
+ env_output << "**#{name}** found at `#{path}`\n"
261
+ else
262
+ env_output << "**No #{name} found**\n"
263
+ end
260
264
  env_output << "\n"
261
- env_output << "```ruby\n"
262
- env_output << File.read(fastlane_path, encoding: "utf-8")
263
- env_output << "\n```\n"
264
- env_output << "</details>"
265
- else
266
- env_output << "**No Fastfile found**\n"
267
265
  end
268
- env_output << "\n\n"
269
266
 
270
- appfile_path = CredentialsManager::AppfileConfig.default_path
271
- if appfile_path && File.exist?(appfile_path)
272
- env_output << "<details>"
273
- env_output << "<summary>`#{appfile_path}`</summary>\n"
274
- env_output << "\n"
275
- env_output << "```ruby\n"
276
- env_output << File.read(appfile_path, encoding: "utf-8")
277
- env_output << "\n```\n"
278
- env_output << "</details>"
279
- else
280
- env_output << "**No Appfile found**\n"
281
- end
282
- env_output << "\n\n"
267
+ env_output << "The contents of these files are not included, as they may contain secrets. "
268
+ env_output << "If they are relevant to your issue, please add the parts that are, with any sensitive values removed.\n"
269
+ env_output << "\n"
283
270
  env_output
284
271
  end
285
272
 
@@ -314,6 +314,7 @@ module Fastlane
314
314
  # it would defeat the caching's purpose.
315
315
  command += ['--depth', '1'] unless is_eligible_for_caching
316
316
  command += ['--branch', branch] unless branch == 'HEAD'
317
+ FastlaneCore::Secrets.register(git_extra_headers, name: :git_extra_headers)
317
318
  git_extra_headers.each do |header|
318
319
  command += ['--config', "http.extraHeader=#{header}"]
319
320
  end
@@ -329,7 +330,7 @@ module Fastlane
329
330
  # Update the repo and try again before failing
330
331
  UI.message("Updating git repo...")
331
332
  Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
332
- Actions.sh("cd #{clone_folder.shellescape} && git checkout #{branch} && git reset --hard && git pull --all")
333
+ Actions.sh("cd #{clone_folder.shellescape} && git checkout #{branch.shellescape} && git reset --hard && git pull --all")
333
334
  end
334
335
 
335
336
  checkout_param = find_tag(folder: clone_folder, version: version, remote: false)