fastlane 2.147.0 → 2.150.0.rc1

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 +82 -82
  3. data/cert/lib/cert/commands_generator.rb +1 -0
  4. data/credentials_manager/lib/credentials_manager/cli.rb +2 -0
  5. data/deliver/lib/deliver.rb +0 -1
  6. data/deliver/lib/deliver/app_screenshot.rb +28 -27
  7. data/deliver/lib/deliver/commands_generator.rb +1 -0
  8. data/deliver/lib/deliver/html_generator.rb +2 -2
  9. data/deliver/lib/deliver/options.rb +6 -11
  10. data/deliver/lib/deliver/runner.rb +7 -4
  11. data/deliver/lib/deliver/setup.rb +5 -30
  12. data/deliver/lib/deliver/submit_for_review.rb +124 -83
  13. data/deliver/lib/deliver/upload_metadata.rb +284 -143
  14. data/deliver/lib/deliver/upload_price_tier.rb +15 -8
  15. data/deliver/lib/deliver/upload_screenshots.rb +86 -37
  16. data/fastlane/lib/assets/s3_html_template.erb +1 -1
  17. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -4
  18. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
  19. data/fastlane/lib/fastlane/actions/docs/capture_android_screenshots.md +42 -2
  20. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  21. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +2 -2
  22. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +3 -11
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +15 -2
  24. data/fastlane/lib/fastlane/actions/download_dsyms.rb +7 -1
  25. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +1 -1
  26. data/fastlane/lib/fastlane/actions/google_play_track_release_names.rb +74 -0
  27. data/fastlane/lib/fastlane/actions/hipchat.rb +1 -1
  28. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +1 -1
  29. data/fastlane/lib/fastlane/actions/slack.rb +2 -2
  30. data/fastlane/lib/fastlane/actions/slather.rb +8 -1
  31. data/fastlane/lib/fastlane/actions/spm.rb +7 -0
  32. data/fastlane/lib/fastlane/actions/swiftlint.rb +14 -0
  33. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -1
  34. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +3 -34
  35. data/fastlane/lib/fastlane/actions/xcodebuild.rb +4 -4
  36. data/fastlane/lib/fastlane/cli_tools_distributor.rb +28 -6
  37. data/fastlane/lib/fastlane/commands_generator.rb +1 -1
  38. data/fastlane/lib/fastlane/documentation/actions_list.rb +1 -1
  39. data/fastlane/lib/fastlane/lane.rb +3 -3
  40. data/fastlane/lib/fastlane/lane_manager.rb +0 -10
  41. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +3 -3
  42. data/fastlane/lib/fastlane/plugins/template/.github/workflows/test.yml +29 -0
  43. data/fastlane/lib/fastlane/swift_fastlane_function.rb +22 -5
  44. data/fastlane/lib/fastlane/swift_lane_manager.rb +0 -8
  45. data/fastlane/lib/fastlane/version.rb +1 -1
  46. data/fastlane/swift/ControlCommand.swift +1 -0
  47. data/fastlane/swift/Deliverfile.swift +1 -1
  48. data/fastlane/swift/Fastlane.swift +140 -30
  49. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/xcshareddata/xcschemes/FastlaneRunner.xcscheme +3 -9
  50. data/fastlane/swift/Gymfile.swift +1 -1
  51. data/fastlane/swift/GymfileProtocol.swift +1 -1
  52. data/fastlane/swift/Matchfile.swift +1 -1
  53. data/fastlane/swift/MatchfileProtocol.swift +5 -1
  54. data/fastlane/swift/Precheckfile.swift +1 -1
  55. data/fastlane/swift/RubyCommand.swift +29 -6
  56. data/fastlane/swift/RubyCommandable.swift +1 -0
  57. data/fastlane/swift/Runner.swift +85 -13
  58. data/fastlane/swift/Scanfile.swift +1 -1
  59. data/fastlane/swift/ScanfileProtocol.swift +10 -2
  60. data/fastlane/swift/Screengrabfile.swift +1 -1
  61. data/fastlane/swift/Snapshotfile.swift +1 -1
  62. data/fastlane/swift/SnapshotfileProtocol.swift +17 -1
  63. data/fastlane/swift/SocketClient.swift +76 -45
  64. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  65. data/fastlane/swift/SocketResponse.swift +1 -0
  66. data/fastlane_core/lib/fastlane_core/configuration/config_item.rb +1 -3
  67. data/fastlane_core/lib/fastlane_core/pkg_file_analyser.rb +7 -0
  68. data/frameit/lib/frameit/commands_generator.rb +1 -0
  69. data/frameit/lib/frameit/device_types.rb +100 -100
  70. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  71. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +4 -0
  72. data/gym/lib/gym/options.rb +1 -1
  73. data/gym/lib/gym/runner.rb +14 -0
  74. data/match/lib/match/commands_generator.rb +1 -0
  75. data/match/lib/match/generator.rb +2 -1
  76. data/match/lib/match/nuke.rb +21 -16
  77. data/match/lib/match/options.rb +18 -1
  78. data/match/lib/match/storage/git_storage.rb +4 -0
  79. data/match/lib/match/storage/google_cloud_storage.rb +4 -0
  80. data/match/lib/match/storage/interface.rb +4 -0
  81. data/match/lib/match/storage/s3_storage.rb +4 -0
  82. data/pem/lib/pem/commands_generator.rb +1 -0
  83. data/pilot/lib/pilot/build_manager.rb +23 -7
  84. data/pilot/lib/pilot/options.rb +5 -0
  85. data/produce/lib/produce/commands_generator.rb +1 -0
  86. data/produce/lib/produce/itunes_connect.rb +20 -20
  87. data/produce/lib/produce/options.rb +3 -3
  88. data/scan/lib/scan/detect_values.rb +3 -0
  89. data/scan/lib/scan/options.rb +20 -2
  90. data/scan/lib/scan/test_command_generator.rb +6 -1
  91. data/scan/lib/scan/test_result_parser.rb +9 -2
  92. data/screengrab/lib/screengrab/runner.rb +10 -9
  93. data/sigh/lib/assets/resign.sh +7 -7
  94. data/sigh/lib/sigh/commands_generator.rb +1 -0
  95. data/sigh/lib/sigh/options.rb +7 -1
  96. data/sigh/lib/sigh/runner.rb +2 -1
  97. data/snapshot/lib/assets/SnapshotHelper.swift +16 -37
  98. data/snapshot/lib/assets/SnapshotHelperXcode8.swift +3 -3
  99. data/snapshot/lib/snapshot/detect_values.rb +15 -0
  100. data/snapshot/lib/snapshot/options.rb +31 -0
  101. data/snapshot/lib/snapshot/reports_generator.rb +8 -1
  102. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +3 -1
  103. data/snapshot/lib/snapshot/test_command_generator.rb +8 -3
  104. data/snapshot/lib/snapshot/test_command_generator_base.rb +7 -1
  105. data/spaceship/lib/spaceship/.DS_Store +0 -0
  106. data/spaceship/lib/spaceship/client.rb +9 -1
  107. data/spaceship/lib/spaceship/commands_generator.rb +1 -0
  108. data/spaceship/lib/spaceship/connect_api.rb +21 -2
  109. data/spaceship/lib/spaceship/connect_api/client.rb +47 -11
  110. data/spaceship/lib/spaceship/connect_api/model.rb +1 -1
  111. data/spaceship/lib/spaceship/connect_api/models/age_rating_declaration.rb +109 -0
  112. data/spaceship/lib/spaceship/connect_api/models/app.rb +113 -3
  113. data/spaceship/lib/spaceship/connect_api/models/app_category.rb +94 -0
  114. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +74 -0
  115. data/spaceship/lib/spaceship/connect_api/models/app_info_localization.rb +38 -0
  116. data/spaceship/lib/spaceship/connect_api/models/app_price.rb +22 -0
  117. data/spaceship/lib/spaceship/connect_api/models/app_price_tier.rb +12 -0
  118. data/spaceship/lib/spaceship/connect_api/models/app_review_attachment.rb +81 -0
  119. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +117 -0
  120. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +101 -0
  121. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +51 -0
  122. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +182 -0
  123. data/spaceship/lib/spaceship/connect_api/models/app_store_version_localization.rb +70 -0
  124. data/spaceship/lib/spaceship/connect_api/models/app_store_version_phased_release.rb +36 -0
  125. data/spaceship/lib/spaceship/connect_api/models/app_store_version_submission.rb +26 -0
  126. data/spaceship/lib/spaceship/connect_api/models/build.rb +8 -0
  127. data/spaceship/lib/spaceship/connect_api/models/idfa_declaration.rb +40 -0
  128. data/spaceship/lib/spaceship/connect_api/models/reset_ratings_request.rb +26 -0
  129. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +10 -3
  130. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +33 -0
  131. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +703 -0
  132. data/spaceship/lib/spaceship/errors.rb +3 -0
  133. data/spaceship/lib/spaceship/spaceauth_runner.rb +2 -2
  134. data/supply/lib/supply/client.rb +19 -0
  135. data/supply/lib/supply/commands_generator.rb +1 -0
  136. data/supply/lib/supply/options.rb +9 -0
  137. data/supply/lib/supply/reader.rb +16 -0
  138. data/supply/lib/supply/uploader.rb +4 -0
  139. metadata +52 -47
  140. data/deliver/lib/deliver/upload_assets.rb +0 -27
  141. data/supply/lib/supply/.client.rb.swp +0 -0
@@ -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
@@ -5,7 +5,7 @@ module Fastlane
5
5
  def self.run(params)
6
6
  local_branch = params[:local_branch]
7
7
  local_branch ||= Actions.git_branch.gsub(%r{#{params[:remote]}\/}, '') if Actions.git_branch
8
- local_branch ||= 'master'
8
+ UI.user_error!('Failed to get the current branch.') unless local_branch
9
9
 
10
10
  remote_branch = params[:remote_branch] || local_branch
11
11
 
@@ -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'",
@@ -88,11 +88,13 @@ module Fastlane
88
88
  def self.available_options
89
89
  [
90
90
  FastlaneCore::ConfigItem.new(key: :mode,
91
+ env_name: "FL_SWIFTLINT_MODE",
91
92
  description: "SwiftLint mode: :lint, :autocorrect or :analyze",
92
93
  is_string: false,
93
94
  default_value: :lint,
94
95
  optional: true),
95
96
  FastlaneCore::ConfigItem.new(key: :path,
97
+ env_name: "FL_SWIFTLINT_PATH",
96
98
  description: "Specify path to lint",
97
99
  is_string: true,
98
100
  optional: true,
@@ -100,22 +102,27 @@ module Fastlane
100
102
  UI.user_error!("Couldn't find path '#{File.expand_path(value)}'") unless File.exist?(value)
101
103
  end),
102
104
  FastlaneCore::ConfigItem.new(key: :output_file,
105
+ env_name: "FL_SWIFTLINT_OUTPUT_FILE",
103
106
  description: 'Path to output SwiftLint result',
104
107
  optional: true),
105
108
  FastlaneCore::ConfigItem.new(key: :config_file,
109
+ env_name: "FL_SWIFTLINT_CONFIG_FILE",
106
110
  description: 'Custom configuration file of SwiftLint',
107
111
  optional: true),
108
112
  FastlaneCore::ConfigItem.new(key: :strict,
113
+ env_name: "FL_SWIFTLINT_STRICT",
109
114
  description: 'Fail on warnings? (true/false)',
110
115
  default_value: false,
111
116
  is_string: false,
112
117
  type: Boolean,
113
118
  optional: true),
114
119
  FastlaneCore::ConfigItem.new(key: :files,
120
+ env_name: "FL_SWIFTLINT_FILES",
115
121
  description: 'List of files to process',
116
122
  is_string: false,
117
123
  optional: true),
118
124
  FastlaneCore::ConfigItem.new(key: :ignore_exit_status,
125
+ env_name: "FL_SWIFTLINT_IGNORE_EXIT_STATUS",
119
126
  description: "Ignore the exit status of the SwiftLint command, so that serious violations \
120
127
  don't fail the build (true/false)",
121
128
  default_value: false,
@@ -123,6 +130,7 @@ module Fastlane
123
130
  type: Boolean,
124
131
  optional: true),
125
132
  FastlaneCore::ConfigItem.new(key: :raise_if_swiftlint_error,
133
+ env_name: "FL_SWIFTLINT_RAISE_IF_SWIFTLINT_ERROR",
126
134
  description: "Raises an error if swiftlint fails, so you can fail CI/CD jobs if necessary \
127
135
  (true/false)",
128
136
  default_value: false,
@@ -130,6 +138,7 @@ module Fastlane
130
138
  type: Boolean,
131
139
  optional: true),
132
140
  FastlaneCore::ConfigItem.new(key: :reporter,
141
+ env_name: "FL_SWIFTLINT_REPORTER",
133
142
  description: "Choose output reporter. Available: xcode, json, csv, checkstyle, junit, html, \
134
143
  emoji, sonarqube, markdown, github-actions-logging",
135
144
  is_string: true,
@@ -139,28 +148,33 @@ module Fastlane
139
148
  UI.user_error!("Available values are '#{available.join("', '")}'") unless available.include?(value)
140
149
  end),
141
150
  FastlaneCore::ConfigItem.new(key: :quiet,
151
+ env_name: "FL_SWIFTLINT_QUIET",
142
152
  description: "Don't print status logs like 'Linting <file>' & 'Done linting'",
143
153
  default_value: false,
144
154
  is_string: false,
145
155
  type: Boolean,
146
156
  optional: true),
147
157
  FastlaneCore::ConfigItem.new(key: :executable,
158
+ env_name: "FL_SWIFTLINT_EXECUTABLE",
148
159
  description: "Path to the `swiftlint` executable on your machine",
149
160
  is_string: true,
150
161
  optional: true),
151
162
  FastlaneCore::ConfigItem.new(key: :format,
163
+ env_name: "FL_SWIFTLINT_FORMAT",
152
164
  description: "Format code when mode is :autocorrect",
153
165
  default_value: false,
154
166
  is_string: false,
155
167
  type: Boolean,
156
168
  optional: true),
157
169
  FastlaneCore::ConfigItem.new(key: :no_cache,
170
+ env_name: "FL_SWIFTLINT_NO_CACHE",
158
171
  description: "Ignore the cache when mode is :autocorrect or :lint",
159
172
  default_value: false,
160
173
  is_string: false,
161
174
  type: Boolean,
162
175
  optional: true),
163
176
  FastlaneCore::ConfigItem.new(key: :compiler_log_path,
177
+ env_name: "FL_SWIFTLINT_COMPILER_LOG_PATH",
164
178
  description: "Compiler log path when mode is :analyze",
165
179
  is_string: true,
166
180
  optional: true,
@@ -83,7 +83,7 @@ module Fastlane
83
83
  end
84
84
 
85
85
  def self.is_supported?(platform)
86
- platform == :ios
86
+ [:ios, :mac].include?(platform)
87
87
  end
88
88
 
89
89
  def self.example_code
@@ -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])
@@ -130,7 +99,7 @@ module Fastlane
130
99
  end
131
100
 
132
101
  def self.find_binary_path(params)
133
- params[:binary_path] ||= (Dir["/Applications/Fabric.app/**/upload-symbols"] + Dir["./Pods/Fabric/upload-symbols"] + Dir["./Pods/FirebaseCrashlytics/upload-symbols"]).last
102
+ params[:binary_path] ||= (Dir["/Applications/Fabric.app/**/upload-symbols"] + Dir["./Pods/Fabric/upload-symbols"] + Dir["./scripts/upload-symbols"] + Dir["./Pods/FirebaseCrashlytics/upload-symbols"]).last
134
103
  UI.user_error!("Failed to find Fabric's upload_symbols binary at /Applications/Fabric.app/**/upload-symbols or ./Pods/**/upload-symbols. Please specify the location of the binary explicitly by using the binary_path option") unless params[:binary_path]
135
104
 
136
105
  params[:binary_path] = File.expand_path(params[:binary_path])
@@ -307,10 +307,10 @@ module Fastlane
307
307
  export_options[:teamID] = CredentialsManager::AppfileConfig.try_fetch_value(:team_id) if !export_options[:teamID] && CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
308
308
  export_options[:onDemandResourcesAssetPacksBaseURL] = URI.escape(export_options[:onDemandResourcesAssetPacksBaseURL]) if export_options[:onDemandResourcesAssetPacksBaseURL]
309
309
  if export_options[:manifest]
310
- export_options[:manifest][:appURL] = URI.escape(export_options[:manifest][:appURL]) if export_options[:manifest][:appURL]
311
- export_options[:manifest][:displayImageURL] = URI.escape(export_options[:manifest][:displayImageURL]) if export_options[:manifest][:displayImageURL]
312
- export_options[:manifest][:fullSizeImageURL] = URI.escape(export_options[:manifest][:fullSizeImageURL]) if export_options[:manifest][:fullSizeImageURL]
313
- export_options[:manifest][:assetPackManifestURL] = URI.escape(export_options[:manifest][:assetPackManifestURL]) if export_options[:manifest][:assetPackManifestURL]
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]
314
314
  end
315
315
 
316
316
  # Saves options to plist
@@ -44,6 +44,12 @@ module Fastlane
44
44
  else
45
45
  require "fastlane"
46
46
  end
47
+
48
+ # Loading any .env files before any lanes are called since
49
+ # variables like FASTLANE_HIDE_CHANGELOG, SKIP_SLOW_FASTLANE_WARNING
50
+ # and FASTLANE_DISABLE_COLORS need to be set early on in execution
51
+ load_dot_env
52
+
47
53
  # We want to avoid printing output other than the version number if we are running `fastlane -v`
48
54
  unless running_version_command? || running_init_command?
49
55
  print_bundle_exec_warning(is_slow: (Time.now - before_import_time > 3))
@@ -59,12 +65,6 @@ module Fastlane
59
65
  end
60
66
  end
61
67
 
62
- # Loading any .env files before any lanes are called since
63
- # variables like FASTLANE_HIDE_CHANGELOG and FASTLANE_DISABLE_COLORS
64
- # need to be set early on in execution
65
- require 'fastlane/helper/dotenv_helper'
66
- Fastlane::Helper::DotenvHelper.load_dot_env(nil)
67
-
68
68
  # Needs to go after load_dot_env for variable FASTLANE_SKIP_UPDATE_CHECK
69
69
  FastlaneCore::UpdateChecker.start_looking_for_update('fastlane')
70
70
 
@@ -122,6 +122,28 @@ module Fastlane
122
122
  FastlaneCore::UpdateChecker.show_update_status('fastlane', Fastlane::VERSION)
123
123
  end
124
124
 
125
+ # Since loading dotenv should respect additional environments passed using
126
+ # --env, we must extrat the arguments out of ARGV and process them before
127
+ # calling into commander. This is required since the ENV must be configured
128
+ # before running any other commands in order to correclty respect variables
129
+ # like FASTLANE_HIDE_CHANGELOG and FASTLANE_DISABLE_COLORS
130
+ def load_dot_env
131
+ env_cl_param = lambda do
132
+ index = ARGV.index("--env")
133
+ return nil if index.nil?
134
+ ARGV.delete_at(index)
135
+
136
+ return nil if ARGV[index].nil?
137
+ value = ARGV[index]
138
+ ARGV.delete_at(index)
139
+
140
+ value
141
+ end
142
+
143
+ require 'fastlane/helper/dotenv_helper'
144
+ Fastlane::Helper::DotenvHelper.load_dot_env(env_cl_param.call)
145
+ end
146
+
125
147
  # Since fastlane also supports the rocket and biceps emoji as executable
126
148
  # we need to map those to the appropriate tools
127
149
  def process_emojis(tool_name)
@@ -93,13 +93,13 @@ module Fastlane
93
93
  FastlaneCore::Globals.verbose = true
94
94
  end
95
95
  global_option('--troubleshoot', 'Enables extended verbose mode. Use with caution, as this even includes ALL sensitive data. Cannot be used on CI.')
96
+ global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
96
97
 
97
98
  always_trace!
98
99
 
99
100
  command :trigger do |c|
100
101
  c.syntax = 'fastlane [lane]'
101
102
  c.description = 'Run a specific lane. Pass the lane name and optionally the platform first.'
102
- c.option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
103
103
  c.option('--disable_runner_upgrades', 'Prevents fastlane from attempting to update FastlaneRunner swift project')
104
104
  c.option('--swift_server_port INT', 'Set specific port to communicate between fastlane and FastlaneRunner')
105
105
 
@@ -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
@@ -7,7 +7,6 @@ module Fastlane
7
7
  # @param parameters [Hash] The parameters passed from the command line to the lane
8
8
  # @param env Dot Env Information
9
9
  # @param A custom Fastfile path, this is used by fastlane.ci
10
- # rubocop:disable Metrics/PerceivedComplexity
11
10
  def self.cruise_lane(platform, lane, parameters = nil, env = nil, fastfile_path = nil)
12
11
  UI.user_error!("lane must be a string") unless lane.kind_of?(String) || lane.nil?
13
12
  UI.user_error!("platform must be a string") unless platform.kind_of?(String) || platform.nil?
@@ -42,14 +41,6 @@ module Fastlane
42
41
 
43
42
  platform, lane = choose_lane(ff, platform) unless lane
44
43
 
45
- # xcodeproj has a bug in certain versions that causes it to change directories
46
- # and not return to the original working directory
47
- # https://github.com/CocoaPods/Xcodeproj/issues/426
48
- # Setting this environment variable causes xcodeproj to work around the problem
49
- ENV["FORK_XCODE_WRITING"] = "true" unless platform == 'android'
50
-
51
- Fastlane::Helper::DotenvHelper.load_dot_env(env)
52
-
53
44
  started = Time.now
54
45
  e = nil
55
46
  begin
@@ -77,7 +68,6 @@ module Fastlane
77
68
 
78
69
  return ff
79
70
  end
80
- # rubocop:enable Metrics/PerceivedComplexity
81
71
 
82
72
  def self.skip_docs?
83
73
  Helper.test? || FastlaneCore::Env.truthy?("FASTLANE_SKIP_DOCS")
@@ -159,7 +159,7 @@ module Fastlane
159
159
  require 'json'
160
160
  url = "https://rubygems.org/api/v1/gems/#{gem_name}.json"
161
161
  begin
162
- JSON.parse(open(url).read)
162
+ JSON.parse(URI.open(url).read)
163
163
  rescue
164
164
  nil
165
165
  end
@@ -215,7 +215,7 @@ module Fastlane
215
215
  # Bundler.with_clean_env solves this problem by resetting Bundler state before the
216
216
  # exec'd call gets merged into this process.
217
217
 
218
- Bundler.with_clean_env do
218
+ Bundler.with_original_env do
219
219
  yield if block_given?
220
220
  end
221
221
  end
@@ -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