fastlane 2.169.0 → 2.174.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 (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +76 -76
  3. data/deliver/lib/deliver/app_screenshot.rb +5 -7
  4. data/deliver/lib/deliver/app_screenshot_validator.rb +108 -0
  5. data/deliver/lib/deliver/commands_generator.rb +1 -1
  6. data/deliver/lib/deliver/loader.rb +13 -29
  7. data/deliver/lib/deliver/setup.rb +8 -3
  8. data/deliver/lib/deliver/upload_metadata.rb +5 -3
  9. data/fastlane/lib/fastlane/actions/add_git_tag.rb +12 -3
  10. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +1 -0
  11. data/fastlane/lib/fastlane/actions/appetize.rb +13 -1
  12. data/fastlane/lib/fastlane/actions/artifactory.rb +36 -3
  13. data/fastlane/lib/fastlane/actions/build_and_upload_to_appetize.rb +10 -2
  14. data/fastlane/lib/fastlane/actions/build_app.rb +3 -1
  15. data/fastlane/lib/fastlane/actions/carthage.rb +22 -0
  16. data/fastlane/lib/fastlane/actions/cocoapods.rb +15 -1
  17. data/fastlane/lib/fastlane/actions/create_pull_request.rb +16 -1
  18. data/fastlane/lib/fastlane/actions/create_xcframework.rb +118 -0
  19. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +1 -1
  20. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  21. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +5 -1
  22. data/fastlane/lib/fastlane/actions/download_app_privacy_details_from_app_store.rb +142 -0
  23. data/fastlane/lib/fastlane/actions/download_dsyms.rb +0 -1
  24. data/fastlane/lib/fastlane/actions/git_commit.rb +6 -2
  25. data/fastlane/lib/fastlane/actions/github_api.rb +14 -3
  26. data/fastlane/lib/fastlane/actions/nexus_upload.rb +1 -0
  27. data/fastlane/lib/fastlane/actions/onesignal.rb +13 -3
  28. data/fastlane/lib/fastlane/actions/pod_push.rb +9 -0
  29. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +9 -1
  30. data/fastlane/lib/fastlane/actions/register_device.rb +1 -1
  31. data/fastlane/lib/fastlane/actions/register_devices.rb +2 -1
  32. data/fastlane/lib/fastlane/actions/set_github_release.rb +21 -8
  33. data/fastlane/lib/fastlane/actions/slack.rb +4 -5
  34. data/fastlane/lib/fastlane/actions/spm.rb +2 -2
  35. data/fastlane/lib/fastlane/actions/swiftlint.rb +4 -4
  36. data/fastlane/lib/fastlane/actions/upload_app_privacy_details_to_app_store.rb +291 -0
  37. data/fastlane/lib/fastlane/cli_tools_distributor.rb +3 -0
  38. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -1
  39. data/fastlane/lib/fastlane/swift_fastlane_api_generator.rb +3 -0
  40. data/fastlane/lib/fastlane/version.rb +1 -1
  41. data/fastlane/swift/Actions.swift +1 -1
  42. data/fastlane/swift/Appfile.swift +1 -1
  43. data/fastlane/swift/ArgumentProcessor.swift +1 -1
  44. data/fastlane/swift/ControlCommand.swift +1 -1
  45. data/fastlane/swift/Deliverfile.swift +2 -2
  46. data/fastlane/swift/DeliverfileProtocol.swift +2 -2
  47. data/fastlane/swift/Fastlane.swift +253 -37
  48. data/fastlane/swift/Gymfile.swift +2 -2
  49. data/fastlane/swift/GymfileProtocol.swift +11 -3
  50. data/fastlane/swift/LaneFileProtocol.swift +1 -1
  51. data/fastlane/swift/MainProcess.swift +1 -1
  52. data/fastlane/swift/Matchfile.swift +2 -2
  53. data/fastlane/swift/MatchfileProtocol.swift +2 -2
  54. data/fastlane/swift/Plugins.swift +1 -1
  55. data/fastlane/swift/Precheckfile.swift +2 -2
  56. data/fastlane/swift/PrecheckfileProtocol.swift +6 -2
  57. data/fastlane/swift/RubyCommand.swift +1 -1
  58. data/fastlane/swift/RubyCommandable.swift +1 -1
  59. data/fastlane/swift/Runner.swift +2 -2
  60. data/fastlane/swift/RunnerArgument.swift +1 -1
  61. data/fastlane/swift/Scanfile.swift +2 -2
  62. data/fastlane/swift/ScanfileProtocol.swift +14 -2
  63. data/fastlane/swift/Screengrabfile.swift +2 -2
  64. data/fastlane/swift/ScreengrabfileProtocol.swift +2 -2
  65. data/fastlane/swift/Snapshotfile.swift +2 -2
  66. data/fastlane/swift/SnapshotfileProtocol.swift +15 -3
  67. data/fastlane/swift/SocketClient.swift +1 -1
  68. data/fastlane/swift/SocketClientDelegateProtocol.swift +1 -1
  69. data/fastlane/swift/SocketResponse.swift +1 -1
  70. data/fastlane/swift/formatting/Brewfile.lock.json +18 -14
  71. data/fastlane/swift/main.swift +1 -1
  72. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +7 -1
  73. data/fastlane_core/lib/fastlane_core/helper.rb +2 -2
  74. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +41 -16
  75. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +3 -4
  76. data/fastlane_core/lib/fastlane_core/project.rb +41 -14
  77. data/frameit/lib/frameit/device_types.rb +7 -1
  78. data/gym/lib/gym/error_handler.rb +8 -0
  79. data/gym/lib/gym/generators/build_command_generator.rb +3 -1
  80. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +2 -2
  81. data/gym/lib/gym/options.rb +12 -2
  82. data/match/lib/match/encryption/openssl.rb +4 -2
  83. data/match/lib/match/runner.rb +1 -1
  84. data/match/lib/match/storage/git_storage.rb +14 -10
  85. data/precheck/lib/precheck/options.rb +6 -1
  86. data/precheck/lib/precheck/rule_processor.rb +1 -1
  87. data/precheck/lib/precheck/runner.rb +1 -1
  88. data/scan/lib/scan/options.rb +15 -0
  89. data/scan/lib/scan/runner.rb +6 -1
  90. data/scan/lib/scan/slack_poster.rb +4 -1
  91. data/scan/lib/scan/test_command_generator.rb +3 -1
  92. data/screengrab/lib/screengrab/runner.rb +2 -0
  93. data/sigh/lib/sigh/runner.rb +1 -1
  94. data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
  95. data/snapshot/lib/snapshot/options.rb +17 -2
  96. data/snapshot/lib/snapshot/update.rb +1 -1
  97. data/spaceship/lib/spaceship/client.rb +14 -1
  98. data/spaceship/lib/spaceship/connect_api.rb +6 -0
  99. data/spaceship/lib/spaceship/connect_api/api_client.rb +17 -2
  100. data/spaceship/lib/spaceship/connect_api/models/app.rb +6 -0
  101. data/spaceship/lib/spaceship/connect_api/models/app_data_usage.rb +59 -0
  102. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_category.rb +65 -0
  103. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_data_protection.rb +27 -0
  104. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_grouping.rb +18 -0
  105. data/spaceship/lib/spaceship/connect_api/models/app_data_usage_purposes.rb +37 -0
  106. data/spaceship/lib/spaceship/connect_api/models/app_data_usages_publish_state.rb +36 -0
  107. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +7 -1
  108. data/spaceship/lib/spaceship/connect_api/models/beta_group.rb +9 -0
  109. data/spaceship/lib/spaceship/connect_api/models/bundle_id.rb +24 -0
  110. data/spaceship/lib/spaceship/connect_api/models/bundle_id_capability.rb +26 -4
  111. data/spaceship/lib/spaceship/connect_api/models/device.rb +30 -0
  112. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +53 -0
  113. data/spaceship/lib/spaceship/connect_api/response.rb +3 -1
  114. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +12 -0
  115. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +103 -0
  116. data/spaceship/lib/spaceship/two_step_or_factor_client.rb +1 -0
  117. data/spaceship/lib/spaceship/upgrade_2fa_later_client.rb +91 -0
  118. metadata +45 -25
  119. data/cert/lib/cert/.options.rb.swp +0 -0
  120. data/cert/lib/cert/.runner.rb.swp +0 -0
  121. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  122. data/match/lib/match/.options.rb.swp +0 -0
  123. data/sigh/lib/sigh/.options.rb.swp +0 -0
@@ -14,7 +14,7 @@ module FastlaneCore
14
14
 
15
15
  def self.fastlane_enabled?
16
16
  # This is called from the root context on the first start
17
- @enabled ||= !FastlaneCore::FastlaneFolder.path.nil?
17
+ !FastlaneCore::FastlaneFolder.path.nil?
18
18
  end
19
19
 
20
20
  # Checks if fastlane is enabled for this project and returns the folder where the configuration lives
@@ -74,7 +74,7 @@ module FastlaneCore
74
74
  return true if self.is_circle_ci?
75
75
 
76
76
  # Check for Jenkins, Travis CI, ... environment variables
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'].each do |current|
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
78
  return true if ENV.key?(current)
79
79
  end
80
80
  return false
@@ -1,3 +1,4 @@
1
+ require 'open3'
1
2
  require 'zip'
2
3
 
3
4
  require_relative 'core_ext/cfpropertylist'
@@ -37,27 +38,51 @@ module FastlaneCore
37
38
 
38
39
  def self.fetch_info_plist_file(path)
39
40
  UI.user_error!("Could not find file at path '#{path}'") unless File.exist?(path)
40
- Zip::File.open(path, "rb") do |zipfile|
41
- file = zipfile.glob('**/Payload/*.app/Info.plist').first
42
- return nil unless file
41
+ plist_data = self.fetch_info_plist_with_rubyzip(path)
42
+ if plist_data.nil?
43
+ # Xcode produces invalid zip files for IPAs larger than 4GB. RubyZip
44
+ # can't read them, but the unzip command is able to work around this.
45
+ plist_data = self.fetch_info_plist_with_unzip(path)
46
+ end
47
+ return nil if plist_data.nil?
43
48
 
44
- # Creates a temporary directory with a unique name tagged with 'fastlane'
45
- # The directory is deleted automatically at the end of the block
46
- Dir.mktmpdir("fastlane") do |tmp|
47
- # The XML file has to be properly unpacked first
48
- tmp_path = File.join(tmp, "Info.plist")
49
- File.open(tmp_path, 'wb') do |output|
50
- output.write(zipfile.read(file))
51
- end
52
- result = CFPropertyList.native_types(CFPropertyList::List.new(file: tmp_path).value)
53
-
54
- if result['CFBundleIdentifier'] || result['CFBundleVersion']
55
- return result
56
- end
49
+ # Creates a temporary directory with a unique name tagged with 'fastlane'
50
+ # The directory is deleted automatically at the end of the block
51
+ Dir.mktmpdir("fastlane") do |tmp|
52
+ # The XML file has to be properly unpacked first
53
+ tmp_path = File.join(tmp, "Info.plist")
54
+ File.open(tmp_path, 'wb') do |output|
55
+ output.write(plist_data)
56
+ end
57
+ result = CFPropertyList.native_types(CFPropertyList::List.new(file: tmp_path).value)
58
+
59
+ if result['CFBundleIdentifier'] || result['CFBundleVersion']
60
+ return result
57
61
  end
58
62
  end
59
63
 
60
64
  return nil
61
65
  end
66
+
67
+ def self.fetch_info_plist_with_rubyzip(path)
68
+ Zip::File.open(path, "rb") do |zipfile|
69
+ file = zipfile.glob('**/Payload/*.app/Info.plist').first
70
+ return nil unless file
71
+ zipfile.read(file)
72
+ end
73
+ end
74
+
75
+ def self.fetch_info_plist_with_unzip(path)
76
+ list, error, = Open3.capture3("unzip", "-Z", "-1", path)
77
+ UI.command_output(error) unless error.empty?
78
+ return nil if list.empty?
79
+ entry = list.chomp.split("\n").find do |e|
80
+ File.fnmatch("**/Payload/*.app/Info.plist", e, File::FNM_PATHNAME)
81
+ end
82
+ data, error, = Open3.capture3("unzip", "-p", path, entry)
83
+ UI.command_output(error) unless error.empty?
84
+ return nil if data.empty?
85
+ data
86
+ end
62
87
  end
63
88
  end
@@ -160,11 +160,10 @@ module FastlaneCore
160
160
  end
161
161
 
162
162
  deliver_additional_params = env_deliver_additional_params.to_s.strip
163
- if !deliver_additional_params.include?("-t ")
164
- UI.user_error!("Invalid transport parameter")
165
- else
166
- return deliver_additional_params
163
+ if deliver_additional_params.include?("-t ")
164
+ UI.important("Apple recommends you don’t specify the -t transport and instead allow Transporter to use automatic transport discovery to determine the best transport mode for your packages. For more information, please read Apple's Transporter User Guide 2.1: https://help.apple.com/itc/transporteruserguide/#/apdATD1E1288-D1E1A1303-D1E1288A1126")
167
165
  end
166
+ return deliver_additional_params
168
167
  end
169
168
  end
170
169
 
@@ -1,5 +1,6 @@
1
1
  require_relative 'helper'
2
2
  require 'xcodeproj'
3
+ require_relative './configuration/configuration'
3
4
  require 'fastlane_core/command_executor'
4
5
 
5
6
  module FastlaneCore
@@ -67,9 +68,6 @@ module FastlaneCore
67
68
  # Is this project a workspace?
68
69
  attr_accessor :is_workspace
69
70
 
70
- # The config object containing the scheme, configuration, etc.
71
- attr_accessor :options
72
-
73
71
  # Should the output of xcodebuild commands be silenced?
74
72
  attr_accessor :xcodebuild_list_silent
75
73
 
@@ -77,18 +75,34 @@ module FastlaneCore
77
75
  # Gets rid of annoying plugin info warnings.
78
76
  attr_accessor :xcodebuild_suppress_stderr
79
77
 
78
+ # @param options [FastlaneCore::Configuration|Hash] a set of configuration to run xcodebuild to work out build settings
79
+ # @param xcodebuild_list_silent [Boolean] a flag to silent xcodebuild command's output
80
+ # @param xcodebuild_suppress_stderr [Boolean] a flag to supress output to stderr from xcodebuild
80
81
  def initialize(options, xcodebuild_list_silent: false, xcodebuild_suppress_stderr: false)
81
- self.options = options
82
- self.path = File.expand_path(options[:workspace] || options[:project])
83
- self.is_workspace = (options[:workspace].to_s.length > 0)
84
- self.xcodebuild_list_silent = xcodebuild_list_silent
85
- self.xcodebuild_suppress_stderr = xcodebuild_suppress_stderr
82
+ @options = options
83
+ @path = File.expand_path(self.options[:workspace] || self.options[:project])
84
+ @is_workspace = (self.options[:workspace].to_s.length > 0)
85
+ @xcodebuild_list_silent = xcodebuild_list_silent
86
+ @xcodebuild_suppress_stderr = xcodebuild_suppress_stderr
86
87
 
87
88
  if !path || !File.directory?(path)
88
89
  UI.user_error!("Could not find project at path '#{path}'")
89
90
  end
90
91
  end
91
92
 
93
+ # @return [Hash] a hash object containing project, workspace, scheme, any configuration related to xcodebuild, or etc...
94
+ def options
95
+ # To keep compatibility with actions using this class from outside of `fastlane` gem; i.e. `xcov`,
96
+ # converts `options` to a plain Hash. Otherwise, it might crash when a new option's key is added
97
+ # due to `FastlaneCore::Configuration` to validate valid keys defined.
98
+ @options.kind_of?(FastlaneCore::Configuration) ? @options.values : @options
99
+ end
100
+
101
+ def options=(new_value)
102
+ UI.deprecated('Update `options` is not worth doing since it can change behavior of this object entirely. Consider re-creating FastlaneCore::Project.')
103
+ @options = new_value
104
+ end
105
+
92
106
  def workspace?
93
107
  self.is_workspace
94
108
  end
@@ -275,7 +289,7 @@ module FastlaneCore
275
289
  end
276
290
 
277
291
  def supports_mac_catalyst?
278
- build_settings(key: "SUPPORTS_MACCATALYST") == "YES"
292
+ build_settings(key: "SUPPORTS_MACCATALYST") == "YES" || build_settings(key: "SUPPORTS_UIKITFORMAC") == "YES"
279
293
  end
280
294
 
281
295
  def command_line_tool?
@@ -322,11 +336,17 @@ module FastlaneCore
322
336
  proj << "-configuration #{options[:configuration].shellescape}" if options[:configuration]
323
337
  proj << "-derivedDataPath #{options[:derived_data_path].shellescape}" if options[:derived_data_path]
324
338
  proj << "-xcconfig #{options[:xcconfig].shellescape}" if options[:xcconfig]
339
+ proj << "-scmProvider system" if options[:use_system_scm]
325
340
 
326
- if FastlaneCore::Helper.xcode_at_least?('11.0') && options[:cloned_source_packages_path]
341
+ xcode_at_least_11 = FastlaneCore::Helper.xcode_at_least?('11.0')
342
+ if xcode_at_least_11 && options[:cloned_source_packages_path]
327
343
  proj << "-clonedSourcePackagesDirPath #{options[:cloned_source_packages_path].shellescape}"
328
344
  end
329
345
 
346
+ if xcode_at_least_11 && options[:disable_package_automatic_updates]
347
+ proj << "-disableAutomaticPackageResolution"
348
+ end
349
+
330
350
  return proj
331
351
  end
332
352
 
@@ -350,6 +370,7 @@ module FastlaneCore
350
370
  end
351
371
 
352
372
  def build_xcodebuild_resolvepackagedependencies_command
373
+ return nil if options[:skip_package_dependencies_resolution]
353
374
  command = "xcodebuild -resolvePackageDependencies #{xcodebuild_parameters.join(' ')}"
354
375
  command += " 2> /dev/null" if xcodebuild_suppress_stderr
355
376
  command
@@ -369,10 +390,16 @@ module FastlaneCore
369
390
 
370
391
  # SwiftPM support
371
392
  if FastlaneCore::Helper.xcode_at_least?('11.0')
372
- UI.important("Resolving Swift Package Manager dependencies...")
373
- FastlaneCore::CommandExecutor.execute(command: build_xcodebuild_resolvepackagedependencies_command,
374
- print_all: true,
375
- print_command: !self.xcodebuild_list_silent)
393
+ if (command = build_xcodebuild_resolvepackagedependencies_command)
394
+ UI.important("Resolving Swift Package Manager dependencies...")
395
+ FastlaneCore::CommandExecutor.execute(
396
+ command: command,
397
+ print_all: true,
398
+ print_command: !self.xcodebuild_list_silent
399
+ )
400
+ else
401
+ UI.important("Skipped Swift Package Manager dependencies resolution.")
402
+ end
376
403
  end
377
404
 
378
405
  command = build_xcodebuild_showbuildsettings_command
@@ -45,6 +45,8 @@ module Frameit
45
45
  GREEN ||= "Green"
46
46
  PINK ||= "Pink"
47
47
  PURPLE ||= "Purple"
48
+ GRAPHITE ||= "Graphite"
49
+ PACIFIC_BLUE ||= "Pacific Blue"
48
50
 
49
51
  def self.all_colors
50
52
  Color.constants.map { |c| Color.const_get(c).upcase.gsub(' ', '_') }
@@ -110,7 +112,7 @@ module Frameit
110
112
  IPHONE_7 ||= Frameit::Device.new("iphone-7", "Apple iPhone 7", 5, [[750, 1334], [1334, 750]], 326, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_47, :use_legacy_iphone7)
111
113
  IPHONE_7_PLUS ||= Frameit::Device.new("iphone-7-plus", "Apple iPhone 7 Plus", 5, [[1242, 2208], [2208, 1242]], 401, Color::MATTE_BLACK, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_55, :use_legacy_iphone7)
112
114
  IPHONE_8 ||= Frameit::Device.new("iphone-8", "Apple iPhone 8", 6, [[750, 1334], [1334, 750]], 326, Color::SPACE_GRAY)
113
- IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1080, 1920], [1920, 1080]], 401, Color::SPACE_GRAY)
115
+ IPHONE_8_PLUS ||= Frameit::Device.new("iphone-8-plus", "Apple iPhone 8 Plus", 6, [[1242, 2208], [2208, 1242]], 401, Color::SPACE_GRAY)
114
116
  IPHONE_X ||= Frameit::Device.new("iphone-X", "Apple iPhone X", 7, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonex)
115
117
  IPHONE_XS ||= Frameit::Device.new("iphone-XS", "Apple iPhone XS", 8, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_58, :use_legacy_iphonexs)
116
118
  IPHONE_XR ||= Frameit::Device.new("iphone-XR", "Apple iPhone XR", 8, [[828, 1792], [1792, 828]], 326, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_61, :use_legacy_iphonexr)
@@ -118,6 +120,10 @@ module Frameit
118
120
  IPHONE_11 ||= Frameit::Device.new("iphone-11", "Apple iPhone 11", 9, [[828, 1792], [1792, 828]], 326, Color::BLACK, Platform::IOS)
119
121
  IPHONE_11_PRO ||= Frameit::Device.new("iphone-11-pro", "Apple iPhone 11 Pro", 9, [[1125, 2436], [2436, 1125]], 458, Color::SPACE_GRAY, Platform::IOS)
120
122
  IPHONE_11_PRO_MAX ||= Frameit::Device.new("iphone11-pro-max", "Apple iPhone 11 Pro Max", 9, [[1242, 2688], [2688, 1242]], 458, Color::SPACE_GRAY, Platform::IOS)
123
+ IPHONE_12 ||= Frameit::Device.new("iphone-12", "Apple iPhone 12", 10, [[1170, 2532], [2532, 1170]], 460, Color::BLACK, Platform::IOS)
124
+ IPHONE_12_PRO ||= Frameit::Device.new("iphone-12-pro", "Apple iPhone 12 Pro", 10, [[1170, 2532], [2532, 1170]], 460, Color::SPACE_GRAY, Platform::IOS)
125
+ IPHONE_12_PRO_MAX ||= Frameit::Device.new("iphone12-pro-max", "Apple iPhone 12 Pro Max", 10, [[1284, 2778], [2778, 1284]], 458, Color::GRAPHITE, Platform::IOS)
126
+ IPHONE_12_MINI ||= Frameit::Device.new("iphone-12-mini", "Apple iPhone 12 Mini", 10, [[1125, 2436], [2436, 1125]], 476, Color::BLACK, Platform::IOS)
121
127
  IPAD_10_2 ||= Frameit::Device.new("ipad-10-2", "Apple iPad 10.2", 1, [[1620, 2160], [2160, 1620]], 264, Color::SPACE_GRAY, Platform::IOS)
122
128
  IPAD_AIR_2 ||= Frameit::Device.new("ipad-air-2", "Apple iPad Air 2", 1, [[1536, 2048], [2048, 1536]], 264, Color::SPACE_GRAY, Platform::IOS, Deliver::AppScreenshot::ScreenSize::IOS_IPAD)
123
129
  IPAD_AIR_2019 ||= Frameit::Device.new("ipad-air-2019", "Apple iPad Air (2019)", 2, [[1668, 2224], [2224, 1668]], 265, Color::SPACE_GRAY, Platform::IOS)
@@ -127,6 +127,14 @@ module Gym
127
127
  UI.build_failure!("Archive invalid")
128
128
  end
129
129
 
130
+ def handle_empty_ipa
131
+ UI.build_failure!("IPA invalid")
132
+ end
133
+
134
+ def handle_empty_pkg
135
+ UI.build_failure!("PKG invalid")
136
+ end
137
+
130
138
  private
131
139
 
132
140
  # Just to make things easier
@@ -39,7 +39,9 @@ module Gym
39
39
  options << "-destination '#{config[:destination]}'" if config[:destination]
40
40
  options << "-archivePath #{archive_path.shellescape}" unless config[:skip_archive]
41
41
  options << "-resultBundlePath '#{result_bundle_path}'" if config[:result_bundle]
42
- options << "-scmProvider system" if config[:use_system_scm]
42
+ if config[:use_system_scm] && !options.include?("-scmProvider system")
43
+ options << "-scmProvider system"
44
+ end
43
45
  options << config[:xcargs] if config[:xcargs]
44
46
  options << "OTHER_SWIFT_FLAGS=\"-Xfrontend -debug-time-function-bodies\"" if config[:analyze_build_time]
45
47
 
@@ -75,7 +75,7 @@ module Gym
75
75
  Gym.cache[:ipa_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.ipa")
76
76
  FileUtils.cp(path, Gym.cache[:ipa_path]) unless File.expand_path(path).casecmp?(File.expand_path(Gym.cache[:ipa_path]).downcase)
77
77
  else
78
- ErrorHandler.handle_empty_archive unless path
78
+ ErrorHandler.handle_empty_ipa unless path
79
79
  end
80
80
 
81
81
  Gym.cache[:ipa_path]
@@ -99,7 +99,7 @@ module Gym
99
99
  Gym.cache[:pkg_path] = File.join(temporary_output_path, "#{Gym.config[:output_name]}.pkg")
100
100
  FileUtils.cp(path, Gym.cache[:pkg_path]) unless File.expand_path(path).casecmp(File.expand_path(Gym.cache[:pkg_path]).downcase).zero?
101
101
  else
102
- ErrorHandler.handle_empty_archive unless path
102
+ ErrorHandler.handle_empty_pkg unless path
103
103
  end
104
104
 
105
105
  Gym.cache[:pkg_path]
@@ -105,11 +105,11 @@ module Gym
105
105
  FastlaneCore::ConfigItem.new(key: :export_method,
106
106
  short_option: "-j",
107
107
  env_name: "GYM_EXPORT_METHOD",
108
- description: "Method used to export the archive. Valid values are: app-store, ad-hoc, package, enterprise, development, developer-id",
108
+ description: "Method used to export the archive. Valid values are: app-store, validation, ad-hoc, package, enterprise, development, developer-id and mac-application",
109
109
  type: String,
110
110
  optional: true,
111
111
  verify_block: proc do |value|
112
- av = %w(app-store ad-hoc package enterprise development developer-id)
112
+ av = %w(app-store validation ad-hoc package enterprise development developer-id mac-application)
113
113
  UI.user_error!("Unsupported export_method '#{value}', must be: #{av}") unless av.include?(value)
114
114
  end),
115
115
  FastlaneCore::ConfigItem.new(key: :export_options,
@@ -280,6 +280,16 @@ module Gym
280
280
  description: "Sets a custom path for Swift Package Manager dependencies",
281
281
  type: String,
282
282
  optional: true),
283
+ FastlaneCore::ConfigItem.new(key: :skip_package_dependencies_resolution,
284
+ env_name: "GYM_SKIP_PACKAGE_DEPENDENCIES_RESOLUTION",
285
+ description: "Skips resolution of Swift Package Manager dependencies",
286
+ type: Boolean,
287
+ default_value: false),
288
+ FastlaneCore::ConfigItem.new(key: :disable_package_automatic_updates,
289
+ env_name: "GYM_DISABLE_PACKAGE_AUTOMATIC_UPDATES",
290
+ description: "Prevents packages from automatically being resolved to versions other than those recorded in the `Package.resolved` file",
291
+ type: Boolean,
292
+ default_value: false),
283
293
  FastlaneCore::ConfigItem.new(key: :use_system_scm,
284
294
  env_name: "GYM_USE_SYSTEM_SCM",
285
295
  description: "Lets xcodebuild use system's scm configuration",
@@ -30,6 +30,7 @@ module Match
30
30
 
31
31
  def encrypt_files
32
32
  files = []
33
+ password = fetch_password!
33
34
  iterate(self.working_directory) do |current|
34
35
  files << current
35
36
  encrypt_specific_file(path: current, password: password)
@@ -41,6 +42,7 @@ module Match
41
42
 
42
43
  def decrypt_files
43
44
  files = []
45
+ password = fetch_password!
44
46
  iterate(self.working_directory) do |current|
45
47
  files << current
46
48
  begin
@@ -50,7 +52,7 @@ module Match
50
52
  UI.error("Couldn't decrypt the repo, please make sure you enter the right password!")
51
53
  UI.user_error!("Invalid password passed via 'MATCH_PASSWORD'") if ENV["MATCH_PASSWORD"]
52
54
  clear_password
53
- self.decrypt_files # call itself
55
+ self.decrypt_files # Call itself
54
56
  return
55
57
  end
56
58
  UI.success("🔓 Decrypted '#{File.basename(current)}'") if FastlaneCore::Globals.verbose?
@@ -83,7 +85,7 @@ module Match
83
85
  end
84
86
 
85
87
  # Access the MATCH_PASSWORD, either from ENV variable, Keychain or user input
86
- def password
88
+ def fetch_password!
87
89
  password = ENV["MATCH_PASSWORD"]
88
90
  unless password
89
91
  item = Security::InternetPassword.find(server: server_name(self.keychain_name))
@@ -355,7 +355,7 @@ module Match
355
355
  devices = Spaceship::ConnectAPI::Device.all
356
356
  unless device_classes.empty?
357
357
  devices = devices.select do |device|
358
- device_classes.include?(device.device_class)
358
+ device_classes.include?(device.device_class) && device.enabled?
359
359
  end
360
360
  end
361
361
 
@@ -89,15 +89,7 @@ module Match
89
89
  command += " -b #{self.branch.shellescape} --single-branch"
90
90
  end
91
91
 
92
- unless self.git_private_key.nil?
93
- if File.file?(self.git_private_key)
94
- ssh_add = File.expand_path(self.git_private_key).shellescape.to_s
95
- else
96
- UI.message("Private key file does not exist, will continue by using it as a raw key.")
97
- ssh_add = "- <<< \"#{self.git_private_key}\""
98
- end
99
- command = "ssh-agent bash -c 'ssh-add #{ssh_add}; #{command}'"
100
- end
92
+ command = command_from_private_key(command) unless self.git_private_key.nil?
101
93
 
102
94
  UI.message("Cloning remote git repo...")
103
95
  if self.branch && !self.clone_branch_directly
@@ -170,6 +162,16 @@ module Match
170
162
  Dir[File.join(working_directory, "**", file_name, "*.#{file_ext}")]
171
163
  end
172
164
 
165
+ def command_from_private_key(command)
166
+ if File.file?(self.git_private_key)
167
+ ssh_add = File.expand_path(self.git_private_key).shellescape.to_s
168
+ else
169
+ UI.message("Private key file does not exist, will continue by using it as a raw key.")
170
+ ssh_add = "- <<< \"#{self.git_private_key}\""
171
+ end
172
+ return "ssh-agent bash -c 'ssh-add #{ssh_add}; #{command}'"
173
+ end
174
+
173
175
  private
174
176
 
175
177
  # Create and checkout an specific branch in the git repo
@@ -231,7 +233,9 @@ module Match
231
233
  def git_push(commands: [], commit_message: nil)
232
234
  commit_message ||= generate_commit_message
233
235
  commands << "git commit -m #{commit_message.shellescape}"
234
- commands << "git push origin #{self.branch.shellescape}"
236
+ git_push_command = "git push origin #{self.branch.shellescape}"
237
+ git_push_command = command_from_private_key(git_push_command) unless self.git_private_key.nil?
238
+ commands << git_push_command
235
239
 
236
240
  UI.message("Pushing changes to remote git repo...")
237
241
  Helper.with_env_values('GIT_TERMINAL_PROMPT' => '0') do
@@ -97,7 +97,12 @@ module Precheck
97
97
  description: "Should check in-app purchases?",
98
98
  is_string: false,
99
99
  optional: true,
100
- default_value: true)
100
+ default_value: true),
101
+ FastlaneCore::ConfigItem.new(key: :use_live,
102
+ env_name: "PRECHECK_USE_LIVE",
103
+ description: "Should force check live app?",
104
+ is_string: false,
105
+ default_value: false)
101
106
  ] + rules
102
107
  end
103
108
  end
@@ -130,7 +130,7 @@ module Precheck
130
130
  items = []
131
131
 
132
132
  # App info localizations
133
- app_info = app.fetch_edit_app_info
133
+ app_info = Precheck.config[:use_live] ? app.fetch_live_app_info : app.fetch_latest_app_info
134
134
  app_info_localizations = app_info.get_app_info_localizations
135
135
  app_info_localizations.each do |localization|
136
136
  items << collect_text_items_from_language_item(locale: localization.locale,
@@ -185,7 +185,7 @@ module Precheck
185
185
 
186
186
  def latest_app_version
187
187
  platform = Spaceship::ConnectAPI::Platform.map(Precheck.config[:platform])
188
- @latest_version ||= app.get_edit_app_store_version(platform: platform)
188
+ @latest_version ||= Precheck.config[:use_live] ? app.get_live_app_store_version(platform: platform) : app.get_latest_app_store_version(platform: platform)
189
189
  end
190
190
 
191
191
  # Makes sure the current App ID exists. If not, it will show an appropriate error message