fastlane 2.178.0 → 2.182.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 (148) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +97 -84
  4. data/cert/lib/cert/commands_generator.rb +2 -1
  5. data/cert/lib/cert/options.rb +1 -0
  6. data/cert/lib/cert/runner.rb +4 -0
  7. data/deliver/lib/deliver/commands_generator.rb +2 -1
  8. data/deliver/lib/deliver/download_screenshots.rb +1 -2
  9. data/deliver/lib/deliver/languages.rb +1 -1
  10. data/deliver/lib/deliver/options.rb +3 -2
  11. data/deliver/lib/deliver/runner.rb +4 -0
  12. data/deliver/lib/deliver/setup.rb +0 -1
  13. data/deliver/lib/deliver/upload_metadata.rb +2 -1
  14. data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
  15. data/fastlane/lib/fastlane/actions/app_store_build_number.rb +5 -0
  16. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +3 -3
  17. data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -1
  18. data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
  19. data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
  20. data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
  21. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  22. data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +18 -1
  23. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
  24. data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
  25. data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
  26. data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
  27. data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
  28. data/fastlane/lib/fastlane/actions/git_commit.rb +3 -1
  29. data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
  30. data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
  31. data/fastlane/lib/fastlane/actions/import_from_git.rb +5 -5
  32. data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
  33. data/fastlane/lib/fastlane/actions/jira.rb +61 -14
  34. data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
  35. data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
  36. data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
  37. data/fastlane/lib/fastlane/actions/slack.rb +155 -133
  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/actions/upload_symbols_to_crashlytics.rb +4 -2
  42. data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
  43. data/fastlane/lib/fastlane/commands_generator.rb +2 -1
  44. data/fastlane/lib/fastlane/fast_file.rb +10 -2
  45. data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
  46. data/fastlane/lib/fastlane/helper/git_helper.rb +19 -7
  47. data/fastlane/lib/fastlane/lane_manager.rb +3 -2
  48. data/fastlane/lib/fastlane/notification/slack.rb +56 -0
  49. data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
  50. data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
  51. data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
  52. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
  53. data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
  54. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
  55. data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
  56. data/fastlane/lib/fastlane/setup/setup.rb +23 -10
  57. data/fastlane/lib/fastlane/swift_fastlane_function.rb +39 -14
  58. data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
  59. data/fastlane/lib/fastlane/version.rb +2 -2
  60. data/fastlane/swift/Deliverfile.swift +1 -1
  61. data/fastlane/swift/DeliverfileProtocol.swift +3 -3
  62. data/fastlane/swift/Fastlane.swift +6852 -3824
  63. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
  64. data/fastlane/swift/Gymfile.swift +1 -1
  65. data/fastlane/swift/GymfileProtocol.swift +1 -1
  66. data/fastlane/swift/LaneFileProtocol.swift +9 -3
  67. data/fastlane/swift/Matchfile.swift +1 -1
  68. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  69. data/fastlane/swift/OptionalConfigValue.swift +131 -0
  70. data/fastlane/swift/Precheckfile.swift +1 -1
  71. data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
  72. data/fastlane/swift/RubyCommand.swift +1 -1
  73. data/fastlane/swift/Scanfile.swift +1 -1
  74. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  75. data/fastlane/swift/Screengrabfile.swift +1 -1
  76. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  77. data/fastlane/swift/Snapshotfile.swift +1 -1
  78. data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
  79. data/fastlane/swift/SocketClient.swift +2 -1
  80. data/fastlane/swift/SocketResponse.swift +4 -2
  81. data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
  82. data/fastlane/swift/upgrade_manifest.json +1 -1
  83. data/fastlane_core/lib/fastlane_core.rb +22 -21
  84. data/fastlane_core/lib/fastlane_core/build_watcher.rb +50 -9
  85. data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
  86. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
  87. data/fastlane_core/lib/fastlane_core/helper.rb +28 -5
  88. data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
  89. data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
  90. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  91. data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
  92. data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
  93. data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
  94. data/frameit/lib/frameit/commands_generator.rb +2 -1
  95. data/gym/lib/gym/commands_generator.rb +2 -1
  96. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  97. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
  98. data/gym/lib/gym/runner.rb +15 -4
  99. data/match/lib/match/change_password.rb +3 -3
  100. data/match/lib/match/commands_generator.rb +2 -1
  101. data/match/lib/match/encryption/interface.rb +1 -1
  102. data/match/lib/match/encryption/openssl.rb +2 -2
  103. data/match/lib/match/module.rb +1 -0
  104. data/pem/lib/pem/commands_generator.rb +2 -1
  105. data/pilot/lib/pilot/commands_generator.rb +2 -1
  106. data/pilot/lib/pilot/manager.rb +4 -0
  107. data/pilot/lib/pilot/options.rb +3 -2
  108. data/pilot/lib/pilot/tester_exporter.rb +0 -1
  109. data/pilot/lib/pilot/tester_manager.rb +0 -1
  110. data/precheck/lib/precheck/commands_generator.rb +2 -1
  111. data/precheck/lib/precheck/options.rb +1 -0
  112. data/precheck/lib/precheck/runner.rb +4 -0
  113. data/produce/lib/produce/commands_generator.rb +2 -1
  114. data/scan/lib/scan/commands_generator.rb +2 -1
  115. data/scan/lib/scan/options.rb +10 -5
  116. data/scan/lib/scan/runner.rb +54 -1
  117. data/scan/lib/scan/test_command_generator.rb +10 -8
  118. data/screengrab/lib/screengrab/android_environment.rb +6 -4
  119. data/screengrab/lib/screengrab/commands_generator.rb +2 -1
  120. data/screengrab/lib/screengrab/runner.rb +1 -1
  121. data/sigh/lib/sigh/commands_generator.rb +2 -1
  122. data/sigh/lib/sigh/options.rb +1 -0
  123. data/sigh/lib/sigh/runner.rb +4 -0
  124. data/snapshot/lib/assets/SnapfileTemplate +1 -1
  125. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  126. data/snapshot/lib/snapshot/commands_generator.rb +3 -1
  127. data/snapshot/lib/snapshot/options.rb +5 -0
  128. data/snapshot/lib/snapshot/reports_generator.rb +4 -0
  129. data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
  130. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
  131. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +8 -4
  132. data/spaceship/README.md +2 -12
  133. data/spaceship/lib/spaceship/base.rb +2 -2
  134. data/spaceship/lib/spaceship/commands_generator.rb +4 -2
  135. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
  136. data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
  137. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +6 -2
  138. data/spaceship/lib/spaceship/connect_api/token.rb +7 -1
  139. data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
  140. data/spaceship/lib/spaceship/tunes/members.rb +1 -1
  141. data/spaceship/lib/spaceship/ui.rb +2 -2
  142. data/supply/lib/supply/client.rb +3 -1
  143. data/supply/lib/supply/commands_generator.rb +2 -1
  144. data/supply/lib/supply/options.rb +2 -2
  145. data/supply/lib/supply/uploader.rb +1 -0
  146. metadata +53 -64
  147. data/gym/lib/gym/.runner.rb.swp +0 -0
  148. data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -3,39 +3,40 @@ require_relative 'fastlane_core/globals'
3
3
  require_relative 'fastlane_core/core_ext/string'
4
4
  require_relative 'fastlane_core/core_ext/shellwords'
5
5
 
6
+ require_relative 'fastlane_core/analytics/action_completion_context'
7
+ require_relative 'fastlane_core/analytics/action_launch_context'
8
+ require_relative 'fastlane_core/analytics/analytics_event_builder'
9
+ require_relative 'fastlane_core/analytics/analytics_ingester_client'
10
+ require_relative 'fastlane_core/analytics/analytics_session'
11
+ require_relative 'fastlane_core/build_watcher'
12
+ require_relative 'fastlane_core/cert_checker'
13
+ require_relative 'fastlane_core/clipboard'
14
+ require_relative 'fastlane_core/command_executor'
15
+ require_relative 'fastlane_core/configuration/configuration'
16
+ require_relative 'fastlane_core/device_manager'
6
17
  require_relative 'fastlane_core/env'
18
+ require_relative 'fastlane_core/fastlane_folder'
19
+ require_relative 'fastlane_core/fastlane_pty'
7
20
  require_relative 'fastlane_core/feature/feature'
8
21
  require_relative 'fastlane_core/features'
9
22
  require_relative 'fastlane_core/helper'
10
- require_relative 'fastlane_core/configuration/configuration'
11
- require_relative 'fastlane_core/update_checker/update_checker'
12
- require_relative 'fastlane_core/languages'
13
- require_relative 'fastlane_core/cert_checker'
14
23
  require_relative 'fastlane_core/ipa_file_analyser'
24
+ require_relative 'fastlane_core/ipa_upload_package_builder'
15
25
  require_relative 'fastlane_core/itunes_transporter'
16
- require_relative 'fastlane_core/provisioning_profile'
26
+ require_relative 'fastlane_core/keychain_importer'
27
+ require_relative 'fastlane_core/languages'
17
28
  require_relative 'fastlane_core/pkg_file_analyser'
18
29
  require_relative 'fastlane_core/pkg_upload_package_builder'
19
- require_relative 'fastlane_core/command_executor'
20
- require_relative 'fastlane_core/ipa_upload_package_builder'
21
30
  require_relative 'fastlane_core/print_table'
22
31
  require_relative 'fastlane_core/project'
23
- require_relative 'fastlane_core/device_manager'
24
- require_relative 'fastlane_core/ui/ui'
25
- require_relative 'fastlane_core/fastlane_folder'
26
- require_relative 'fastlane_core/keychain_importer'
32
+ require_relative 'fastlane_core/provisioning_profile'
33
+ require_relative 'fastlane_core/queue_worker'
27
34
  require_relative 'fastlane_core/swag'
28
- require_relative 'fastlane_core/build_watcher'
29
- require_relative 'fastlane_core/ui/errors'
30
- require_relative 'fastlane_core/test_parser'
31
- require_relative 'fastlane_core/analytics/action_completion_context'
32
- require_relative 'fastlane_core/analytics/action_launch_context'
33
- require_relative 'fastlane_core/analytics/analytics_event_builder'
34
- require_relative 'fastlane_core/analytics/analytics_ingester_client'
35
- require_relative 'fastlane_core/analytics/analytics_session'
36
35
  require_relative 'fastlane_core/tag_version'
37
- require_relative 'fastlane_core/fastlane_pty'
38
- require_relative 'fastlane_core/queue_worker'
36
+ require_relative 'fastlane_core/test_parser'
37
+ require_relative 'fastlane_core/ui/errors'
38
+ require_relative 'fastlane_core/ui/ui'
39
+ require_relative 'fastlane_core/update_checker/update_checker'
39
40
 
40
41
  # Third Party code
41
42
  require 'colored'
@@ -4,6 +4,8 @@ require_relative 'ui/ui'
4
4
 
5
5
  module FastlaneCore
6
6
  class BuildWatcher
7
+ VersionMatches = Struct.new(:version, :builds)
8
+
7
9
  class << self
8
10
  # @return The build we waited for. This method will always return a build
9
11
  def wait_for_build_processing_to_be_complete(app_id: nil, platform: nil, train_version: nil, app_version: nil, build_version: nil, poll_interval: 10, strict_build_watch: false, return_when_build_appears: false, return_spaceship_testflight_build: true, select_latest: false)
@@ -23,7 +25,7 @@ module FastlaneCore
23
25
 
24
26
  showed_info = false
25
27
  loop do
26
- matched_build = matching_build(watched_app_version: app_version, watched_build_version: build_version, app_id: app_id, platform: platform, select_latest: select_latest)
28
+ matched_build, app_version_queried = matching_build(watched_app_version: app_version, watched_build_version: build_version, app_id: app_id, platform: platform, select_latest: select_latest)
27
29
 
28
30
  if matched_build.nil? && !showed_info
29
31
  UI.important("Read more information on why this build isn't showing up yet - https://github.com/fastlane/fastlane/issues/14997")
@@ -37,6 +39,13 @@ module FastlaneCore
37
39
  # having a build resource appear in AppStoreConnect (matched_build) may be enough (i.e. setting a changelog)
38
40
  # so here we may choose to skip the full processing of the build if return_when_build_appears is true
39
41
  if matched_build && (return_when_build_appears || matched_build.processed?)
42
+
43
+ if !app_version.nil? && app_version != app_version_queried
44
+ UI.important("App version is #{app_version} but build was found while querying #{app_version_queried}")
45
+ UI.important("This shouldn't be an issue as Apple sees #{app_version} and #{app_version_queried} as equal")
46
+ UI.important("See docs for more info - https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364")
47
+ end
48
+
40
49
  if return_spaceship_testflight_build
41
50
  return matched_build.to_testflight_build
42
51
  else
@@ -60,15 +69,31 @@ module FastlaneCore
60
69
  watched_app_version = remove_version_leading_zeros(version: watched_app_version)
61
70
  watched_build_version = remove_version_leading_zeros(version: watched_build_version)
62
71
 
63
- matched_builds = Spaceship::ConnectAPI::Build.all(
64
- app_id: app_id,
65
- version: watched_app_version,
66
- build_number: watched_build_version,
67
- platform: platform
68
- )
72
+ # App Store Connect will allow users to upload X.Y is the same as X.Y.0 and treat them as the same version
73
+ # However, only the first uploaded version format will be the one that is queryable
74
+ # This could lead to BuildWatcher never finding X.Y.0 if X.Y was upoaded first as X.Y will only yield results
75
+ #
76
+ # This will add an additional request to search for both X.Y and X.Y.0 but
77
+ # will give preference to the version format specified passed in
78
+ watched_app_version_alternate = alternate_version(watched_app_version)
79
+ versions = [watched_app_version, watched_app_version_alternate].compact
80
+
81
+ version_matches = versions.map do |version|
82
+ match = VersionMatches.new
83
+ match.version = version
84
+ match.builds = Spaceship::ConnectAPI::Build.all(
85
+ app_id: app_id,
86
+ version: version,
87
+ build_number: watched_build_version,
88
+ platform: platform
89
+ )
90
+
91
+ match
92
+ end.flatten
69
93
 
70
94
  # Raise error if more than 1 build is returned
71
95
  # This should never happen but need to inform the user if it does
96
+ matched_builds = version_matches.map(&:builds).flatten
72
97
  if matched_builds.size > 1 && !select_latest
73
98
  error_builds = matched_builds.map do |build|
74
99
  "#{build.app_version}(#{build.version}) for #{build.platform} - #{build.processing_state}"
@@ -77,9 +102,25 @@ module FastlaneCore
77
102
  UI.crash!(error_message)
78
103
  end
79
104
 
80
- matched_build = matched_builds.first
105
+ version_match = version_matches.reject do |match|
106
+ match.builds.empty?
107
+ end.first
108
+ matched_build = version_match&.builds&.first
109
+
110
+ return matched_build, version_match&.version
111
+ end
112
+
113
+ def alternate_version(version)
114
+ return nil if version.nil?
115
+
116
+ version_info = Gem::Version.new(version)
117
+ if version_info.segments.size == 3 && version_info.segments[2] == 0
118
+ return version_info.segments[0..1].join(".")
119
+ elsif version_info.segments.size == 2
120
+ return "#{version}.0"
121
+ end
81
122
 
82
- return matched_build
123
+ return nil
83
124
  end
84
125
 
85
126
  def report_status(build: nil)
@@ -0,0 +1,20 @@
1
+ require 'fastlane_core'
2
+ require 'open3'
3
+
4
+ module FastlaneCore
5
+ class Clipboard
6
+ def self.copy(content: nil)
7
+ return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
8
+ Open3.popen3('pbcopy') { |input, _, _| input << content }
9
+ end
10
+
11
+ def self.paste
12
+ return UI.crash!("'pbcopy' or 'pbpaste' command not found.") unless is_supported?
13
+ return `pbpaste`
14
+ end
15
+
16
+ def self.is_supported?
17
+ return `which pbcopy`.length > 0 && `which pbpaste`.length > 0
18
+ end
19
+ end
20
+ end
@@ -208,8 +208,10 @@ module FastlaneCore
208
208
  #####################################################
209
209
 
210
210
  # Returns the value for a certain key. fastlane_core tries to fetch the value from different sources
211
- # if 'ask' is true and the value is not present, the user will be prompted to provide a value
212
- def fetch(key, ask: true)
211
+ # if 'ask' is true and the value is not present, the user will be prompted to provide a value if optional
212
+ # if 'force_ask' is true, the option is not required to be optional to ask
213
+ # rubocop:disable Metrics/PerceivedComplexity
214
+ def fetch(key, ask: true, force_ask: false)
213
215
  UI.crash!("Key '#{key}' must be a symbol. Example :app_id.") unless key.kind_of?(Symbol)
214
216
 
215
217
  option = verify_options_key!(key)
@@ -227,7 +229,7 @@ module FastlaneCore
227
229
 
228
230
  value = option.auto_convert_value(value)
229
231
  value = nil if value.nil? && !option.string? # by default boolean flags are false
230
- return value unless value.nil? && !option.optional && ask
232
+ return value unless value.nil? && (!option.optional || force_ask) && ask
231
233
 
232
234
  # fallback to asking
233
235
  if Helper.test? || !UI.interactive?
@@ -75,7 +75,7 @@ module FastlaneCore
75
75
 
76
76
  # Check for Jenkins, Travis CI, ... environment variables
77
77
  ['JENKINS_HOME', 'JENKINS_URL', 'TRAVIS', 'CI', 'APPCENTER_BUILD_ID', 'TEAMCITY_VERSION', 'GO_PIPELINE_NAME', 'bamboo_buildKey', 'GITLAB_CI', 'XCS', 'TF_BUILD', 'GITHUB_ACTION', 'GITHUB_ACTIONS', 'BITRISE_IO', 'BUDDY'].each do |current|
78
- return true if ENV.key?(current)
78
+ return true if FastlaneCore::Env.truthy?(current)
79
79
  end
80
80
  return false
81
81
  end
@@ -167,11 +167,11 @@ module FastlaneCore
167
167
  @xcode_version
168
168
  end
169
169
 
170
- # @return true if Xcode version is higher than 8.3
170
+ # @return true if installed Xcode version is 'greater than or equal to' the input parameter version
171
171
  def self.xcode_at_least?(version)
172
- FastlaneCore::UI.user_error!("Unable to locate Xcode. Please make sure to have Xcode installed on your machine") if xcode_version.nil?
173
- v = xcode_version
174
- Gem::Version.new(v) >= Gem::Version.new(version)
172
+ installed_xcode_version = xcode_version
173
+ UI.user_error!("Unable to locate Xcode. Please make sure to have Xcode installed on your machine") if installed_xcode_version.nil?
174
+ Gem::Version.new(installed_xcode_version) >= Gem::Version.new(version)
175
175
  end
176
176
 
177
177
  # iTMSTransporter
@@ -377,6 +377,8 @@ module FastlaneCore
377
377
 
378
378
  # returns the path of the executable with the correct extension on Windows
379
379
  def self.get_executable_path(cmd_path)
380
+ cmd_path = localize_file_path(cmd_path)
381
+
380
382
  if self.windows?
381
383
  # PATHEXT contains the list of file extensions that Windows considers executable, semicolon separated.
382
384
  # e.g. ".COM;.EXE;.BAT;.CMD"
@@ -393,6 +395,12 @@ module FastlaneCore
393
395
  return cmd_path
394
396
  end
395
397
 
398
+ # returns the path with the platform-specific path separator (`/` on UNIX, `\` on Windows)
399
+ def self.localize_file_path(path)
400
+ # change `/` to `\` on Windows
401
+ return self.windows? ? path.gsub('/', '\\') : path
402
+ end
403
+
396
404
  # checks if given file is a valid json file
397
405
  # base taken from: http://stackoverflow.com/a/26235831/1945875
398
406
  def self.json_file?(filename)
@@ -462,5 +470,20 @@ module FastlaneCore
462
470
  UI.error("Your entries do not match. Please try again")
463
471
  end
464
472
  end
473
+
474
+ # URI.open added by `require 'open-uri'` is not available in Ruby 2.4. This helper lets you open a URI
475
+ # by choosing appropriate interface to do so depending on Ruby version. This helper is subject to be removed
476
+ # when fastlane drops Ruby 2.4 support.
477
+ def self.open_uri(*rest, &block)
478
+ require 'open-uri'
479
+
480
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.5')
481
+ dup = rest.dup
482
+ uri = dup.shift
483
+ URI.parse(uri).open(*dup, &block)
484
+ else
485
+ URI.open(*rest, &block)
486
+ end
487
+ end
465
488
  end
466
489
  end
@@ -3,7 +3,7 @@ module FastlaneCore
3
3
  # These are all the languages which are available to use to upload app metadata and screenshots
4
4
 
5
5
  # The old format which was used until August 2015 (good old times)
6
- ALL_LANGUAGES_LEGACY = ["da-DK", "de-DE", "el-GR", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi-FI", "fr-CA", "fr-FR", "id-ID", "it-IT", "ja-JP", "ko-KR", "ms-MY", "nl-NL", "no-NO", "pt-BR", "pt-PT", "ru-RU", "sv-SE", "th-TH", "tr-TR", "vi-VI", "cmn-Hans", "cmn-Hant"]
6
+ ALL_LANGUAGES_LEGACY = %w[da-DK de-DE el-GR en-AU en-CA en-GB en-US es-ES es-MX fi-FI fr-CA fr-FR id-ID it-IT ja-JP ko-KR ms-MY nl-NL no-NO pt-BR pt-PT ru-RU sv-SE th-TH tr-TR vi-VI cmn-Hans cmn-Hant]
7
7
 
8
8
  # The new format used from September 2015 on
9
9
  # This was generated from `Spaceship::Tunes.client.available_languages.sort`
@@ -11,6 +11,6 @@ module FastlaneCore
11
11
  # - produce/lib/produce/available_default_languages.rb
12
12
  # - spaceship/lib/assets/languageMapping.json
13
13
  # See pull request for example: https://github.com/fastlane/fastlane/pull/14110
14
- ALL_LANGUAGES = ["ar-SA", "ca", "cs", "da", "de-DE", "el", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi", "fr-CA", "fr-FR", "he", "hi", "hr", "hu", "id", "it", "ja", "ko", "ms", "nl-NL", "no", "pl", "pt-BR", "pt-PT", "ro", "ru", "sk", "sv", "th", "tr", "uk", "vi", "zh-Hans", "zh-Hant"]
14
+ ALL_LANGUAGES = %w[ar-SA ca cs da de-DE el en-AU en-CA en-GB en-US es-ES es-MX fi fr-CA fr-FR he hi hr hu id it ja ko ms nl-NL no pl pt-BR pt-PT ro ru sk sv th tr uk vi zh-Hans zh-Hant]
15
15
  end
16
16
  end
@@ -16,12 +16,12 @@ module FastlaneCore
16
16
  @queue = Queue.new
17
17
  end
18
18
 
19
- # @param job (Object) - An arbitary object that keeps parameters
19
+ # @param job (Object) - An arbitrary object that keeps parameters
20
20
  def enqueue(job)
21
21
  @queue.push(job)
22
22
  end
23
23
 
24
- # @param jobs (Array<Object>) - An array of arbitary object that keeps parameters
24
+ # @param jobs (Array<Object>) - An array of arbitrary object that keeps parameters
25
25
  def batch_enqueue(jobs)
26
26
  raise(ArgumentError, "Enqueue Array instead of #{jobs.class}") unless jobs.kind_of?(Array)
27
27
  jobs.each { |job| enqueue(job) }
@@ -4,7 +4,7 @@ require_relative 'helper'
4
4
 
5
5
  module FastlaneCore
6
6
  class Swag
7
- # rubocop:disable LineLength
7
+ # rubocop:disable Layout/LineLength
8
8
  require 'zlib'
9
9
  FRAMES = ["x\x9C\xED[\xD9u\xDB0\x10\xFCO\v\xFEq\t<C\xE0\xB9\x14\xD7\xE0\x1ERE\nt%\x91D\x12<0\xB3\aH\xC9\x8A\x9F\xF3\xF2\x13\x02\xC4\xB13;{Pyyo\xE3[\x17?^O\xFF\xF3\xF2\xDE\xDDV\xFE\xF5\xF2\xB3\xC5\xCF\x16_\xB2\xC5\xFC\xC28?\xBC\xF5oM\xFD\xFB\x03>\xAE\xE0\xE3\xEA\xBA\x87}z\xBE\xB8\xCF\f\xBE\v\xEA\a\x98\x9E\xCD\x97i>>\xFF\xFE\xD9\x0FWQ\x1En6\xC3\xE2\x8C\xA0\xCE\xA0k\xC8\x87\xE0W\xE0\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EA\xAAm\x01\xBC=c\xCCp\xE0Q\x04'\x03`K$\xA9RK\x00\x1Fl\xA0t\r\xC9\x87 \xC4P\x9E\x03\xBDc\xAD\x13(\xBC\xA6\x99M`\xF2P\x9BK\x95P1\xA1\x98\xE3\xCD-\f5s\x93\xA4p\xCC\x18\x1E\x8A\x19\x9D\x94\x9AtE\xB1\xF8EN\xA2\e0uk\xECi\xB8\xC7\xD3\x9BYk\x12\xA2\xA3\xBB\x9D\xF7\xA7\xA5\xCD\r`\x18\vtG'K\x15v\xFE&G\xA3\xA8\xB1\xDF\xBB\xD2\xAF\xC0\b\xE0]f.\x01\x0E\xAE\xD3\xB4\x81\xBC\xE8D\x93t\xCF\xB3$\xE8b_;\xDDid%\xA4\x9F\x89\x8B\n`\xD4F \x1D\e=\xFE\xB7\xB8[%\x01\xC3I\x0F\xFE\xEF\xCF\xFD\x9C\xC3y\xCEj\xDF\xD48\xC7\xE9\x9E&\xBF\x99\xF8\xAE\x98\xAC\xAA\xC7Y\x9B\xD9\x9Eol\xDF\xE7\xB5\xC4\x7F\xB9\xC4_\x06\x16#\x10",
@@ -0,0 +1,35 @@
1
+ <%= program :name %>
2
+
3
+ <%= program :description %>
4
+
5
+ <%= "Commands:#{@default_command ? ' (* default)' : '' }" %>
6
+ <% for name, command in @commands.sort -%>
7
+ <% unless alias? name -%>
8
+ <%= "%-#{max_command_length}s #{@default_command.nil? ? '' : (command.name == @default_command.to_s ? '* ' : ' ') }%s" % [command.name, command.summary || command.description] %>
9
+ <% end -%>
10
+ <% end -%>
11
+ <% unless @aliases.empty? %>
12
+ Aliases:
13
+ <% for alias_name, args in @aliases.sort -%>
14
+ <%= "%-#{max_aliases_length}s %s %s" % [alias_name, command(alias_name).name, args.join(' ')] %>
15
+ <% end -%>
16
+ <% end %>
17
+ <% unless @options.empty? -%>
18
+ Global Options:
19
+ <% for option in @options -%>
20
+ <%= "%-20s %s" % [option[:switches].join(', '), option[:description]] %>
21
+ <% end -%>
22
+ <% end -%>
23
+ <% default_command_options = @commands.values.find {|c| c.name == @default_command.to_s }&.options || [] %>
24
+ <% unless default_command_options.empty? %>
25
+ <%= "Options for #{@default_command}:" %>
26
+ <% for option in default_command_options -%>
27
+ <%= "%-20s %s" % [option[:switches].join(', '), option[:description]] %>
28
+ <% end -%>
29
+ <% end -%>
30
+ <% if program :help -%>
31
+ <% for title, body in program(:help) %>
32
+ <%= title %>:
33
+ <%= body %>
34
+ <% end %>
35
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ require 'commander'
2
+
3
+ module FastlaneCore
4
+ class HelpFormatter < ::Commander::HelpFormatter::TerminalCompact
5
+ def template(name)
6
+ # fastlane only customizes the global command help
7
+ return super unless name == :help
8
+
9
+ if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.6')
10
+ ERB.new(File.read(File.join(File.dirname(__FILE__), "help.erb")), nil, '-')
11
+ else
12
+ ERB.new(File.read(File.join(File.dirname(__FILE__), "help.erb")), trim_mode: '-')
13
+ end
14
+ end
15
+ end
16
+ end
@@ -69,7 +69,7 @@ module FastlaneCore
69
69
  end
70
70
 
71
71
  def command_output(message)
72
- actual = (message.split("\r").last || "") # as clearing the line will remove the `>` and the time stamp
72
+ actual = (encode_as_utf_8_if_possible(message).split("\r").last || "") # as clearing the line will remove the `>` and the time stamp
73
73
  actual.split("\n").each do |msg|
74
74
  if FastlaneCore::Env.truthy?("FASTLANE_DISABLE_OUTPUT_FORMAT")
75
75
  log.info(msg)
@@ -150,6 +150,17 @@ module FastlaneCore
150
150
 
151
151
  private
152
152
 
153
+ def encode_as_utf_8_if_possible(message)
154
+ return message if message.valid_encoding?
155
+
156
+ # genstrings outputs UTF-16, so we should try to use this encoding if it turns out to be valid
157
+ test_message = message.dup
158
+ return message.encode(Encoding::UTF_8, Encoding::UTF_16) if test_message.force_encoding(Encoding::UTF_16).valid_encoding?
159
+
160
+ # replace any invalid with empty string
161
+ message.encode(Encoding::UTF_8, invalid: :replace)
162
+ end
163
+
153
164
  def verify_interactive!(message)
154
165
  return if interactive?
155
166
  important(message)
@@ -1,5 +1,6 @@
1
1
  require 'commander'
2
2
  require 'fastlane/version'
3
+ require 'fastlane_core/ui/help_formatter'
3
4
  require 'fastlane_core/globals'
4
5
  require 'fastlane_core/configuration/configuration'
5
6
 
@@ -27,7 +28,7 @@ module Frameit
27
28
  program :help, 'Author', 'Felix Krause <frameit@krausefx.com>'
28
29
  program :help, 'Website', 'https://fastlane.tools'
29
30
  program :help, 'Documentation', 'https://docs.fastlane.tools/actions/frameit/'
30
- program :help_formatter, :compact
31
+ program :help_formatter, FastlaneCore::HelpFormatter
31
32
 
32
33
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
33
34
  global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
@@ -1,6 +1,7 @@
1
1
  require 'commander'
2
2
 
3
3
  require 'fastlane_core/configuration/configuration'
4
+ require 'fastlane_core/ui/help_formatter'
4
5
  require_relative 'module'
5
6
  require_relative 'manager'
6
7
  require_relative 'options'
@@ -28,7 +29,7 @@ module Gym
28
29
  program :help, "Author", "Felix Krause <gym@krausefx.com>"
29
30
  program :help, "Website", "https://fastlane.tools"
30
31
  program :help, "Documentation", "https://docs.fastlane.tools/actions/gym/"
31
- program :help_formatter, :compact
32
+ program :help_formatter, FastlaneCore::HelpFormatter
32
33
 
33
34
  global_option("--verbose") { FastlaneCore::Globals.verbose = true }
34
35
 
@@ -29,6 +29,10 @@ module Gym
29
29
  generator.pkg_path
30
30
  end
31
31
 
32
+ def binary_path
33
+ generator.binary_path
34
+ end
35
+
32
36
  def dsym_path
33
37
  generator.dsym_path
34
38
  end
@@ -81,28 +81,33 @@ module Gym
81
81
  Gym.cache[:ipa_path]
82
82
  end
83
83
 
84
- def pkg_path
85
- path = Gym.cache[:pkg_path]
84
+ def binary_path
85
+ path = Gym.cache[:binary_path]
86
86
  return path if path
87
87
 
88
88
  path = Dir[File.join(temporary_output_path, "*.pkg")].last
89
- # We need to process generic PKG
89
+ app_path = Dir[File.join(temporary_output_path, "*.app")].last
90
+ # We need to process generic PKG or APP
90
91
  if path
91
92
  # Try to find PKG file in the output directory, used when app thinning was not set
92
- Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
93
- FileUtils.mv(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
93
+ Gym.cache[:binary_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
94
+ FileUtils.mv(path, Gym.cache[:binary_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:binary_path]).downcase).zero?
94
95
  elsif Dir.exist?(apps_path)
95
96
  # Try to find "generic" PKG file inside "Apps" folder, used when app thinning was set
96
97
  files = Dir[File.join(apps_path, "*.pkg")]
97
98
  # Generic PKG file doesn't have suffix so its name is the shortest
98
99
  path = files.min_by(&:length)
99
- Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
100
- FileUtils.cp(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
100
+ Gym.cache[:binary_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
101
+ FileUtils.cp(path, Gym.cache[:binary_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:binary_path]).downcase).zero?
102
+ elsif app_path
103
+ # Try to find .app file in the output directory. This is used when macOS is set and .app is being generated.
104
+ Gym.cache[:binary_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.app")
105
+ FileUtils.mv(app_path, Gym.cache[:binary_path]) unless File.expand_path(app_path).casecmp(File.expand_path(Gym.cache[:binary_path]).downcase).zero?
101
106
  else
102
107
  ErrorHandler.handle_empty_pkg unless path
103
108
  end
104
109
 
105
- Gym.cache[:pkg_path]
110
+ Gym.cache[:binary_path]
106
111
  end
107
112
 
108
113
  # The path the the dsym file for this app. Might be nil