fastlane 2.147.0 → 2.148.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) 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/commands_generator.rb +1 -0
  6. data/deliver/lib/deliver/html_generator.rb +2 -2
  7. data/deliver/lib/deliver/submit_for_review.rb +5 -1
  8. data/fastlane/lib/fastlane/actions/crashlytics.rb +0 -4
  9. data/fastlane/lib/fastlane/actions/docs/build_app.md +1 -1
  10. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +2 -2
  11. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +12 -0
  12. data/fastlane/lib/fastlane/actions/get_managed_play_store_publishing_rights.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/push_to_git_remote.rb +1 -1
  14. data/fastlane/lib/fastlane/actions/swiftlint.rb +14 -0
  15. data/fastlane/lib/fastlane/actions/sync_code_signing.rb +1 -1
  16. data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +1 -1
  17. data/fastlane/lib/fastlane/actions/xcodebuild.rb +4 -4
  18. data/fastlane/lib/fastlane/cli_tools_distributor.rb +28 -6
  19. data/fastlane/lib/fastlane/commands_generator.rb +1 -1
  20. data/fastlane/lib/fastlane/lane_manager.rb +0 -10
  21. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +2 -2
  22. data/fastlane/lib/fastlane/swift_lane_manager.rb +0 -8
  23. data/fastlane/lib/fastlane/version.rb +1 -1
  24. data/fastlane/swift/Deliverfile.swift +1 -1
  25. data/fastlane/swift/Fastlane.swift +68 -15
  26. data/fastlane/swift/Gymfile.swift +1 -1
  27. data/fastlane/swift/LaneFileProtocol.swift +5 -2
  28. data/fastlane/swift/Matchfile.swift +1 -1
  29. data/fastlane/swift/MatchfileProtocol.swift +5 -1
  30. data/fastlane/swift/Precheckfile.swift +1 -1
  31. data/fastlane/swift/Scanfile.swift +1 -1
  32. data/fastlane/swift/ScanfileProtocol.swift +9 -1
  33. data/fastlane/swift/Screengrabfile.swift +1 -1
  34. data/fastlane/swift/Snapshotfile.swift +1 -1
  35. data/fastlane/swift/SnapshotfileProtocol.swift +9 -1
  36. data/frameit/lib/frameit/commands_generator.rb +1 -0
  37. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  38. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +4 -0
  39. data/gym/lib/gym/runner.rb +14 -0
  40. data/match/lib/match/commands_generator.rb +1 -0
  41. data/match/lib/match/generator.rb +2 -1
  42. data/match/lib/match/options.rb +18 -1
  43. data/pem/lib/pem/commands_generator.rb +1 -0
  44. data/pilot/lib/pilot/build_manager.rb +23 -7
  45. data/pilot/lib/pilot/options.rb +5 -0
  46. data/produce/lib/produce/commands_generator.rb +1 -0
  47. data/scan/lib/scan/detect_values.rb +3 -0
  48. data/scan/lib/scan/options.rb +19 -1
  49. data/scan/lib/scan/test_command_generator.rb +6 -1
  50. data/screengrab/lib/screengrab/runner.rb +10 -9
  51. data/sigh/lib/sigh/commands_generator.rb +1 -0
  52. data/sigh/lib/sigh/options.rb +7 -1
  53. data/sigh/lib/sigh/runner.rb +2 -1
  54. data/snapshot/lib/assets/SnapshotHelper.swift +12 -33
  55. data/snapshot/lib/snapshot/.options.rb.swp +0 -0
  56. data/snapshot/lib/snapshot/.test_command_generator_base.rb.swp +0 -0
  57. data/snapshot/lib/snapshot/detect_values.rb +15 -0
  58. data/snapshot/lib/snapshot/options.rb +22 -1
  59. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +3 -1
  60. data/snapshot/lib/snapshot/test_command_generator_base.rb +7 -1
  61. data/spaceship/lib/spaceship/commands_generator.rb +1 -0
  62. data/spaceship/lib/spaceship/connect_api/models/build.rb +4 -0
  63. data/supply/lib/supply/commands_generator.rb +1 -0
  64. data/supply/lib/supply/options.rb +9 -0
  65. data/supply/lib/supply/uploader.rb +4 -0
  66. metadata +25 -24
  67. data/supply/lib/supply/.client.rb.swp +0 -0
@@ -26,6 +26,7 @@ module Sigh
26
26
  program :help_formatter, :compact
27
27
 
28
28
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
29
+ global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
29
30
 
30
31
  command :renew do |c|
31
32
  c.syntax = 'fastlane sigh renew'
@@ -153,7 +153,13 @@ module Sigh
153
153
  env_name: "SIGH_PROVISIONING_PROFILE_TEMPLATE_NAME",
154
154
  description: "The name of provisioning profile template. If the developer account has provisioning profile templates (aka: custom entitlements), the template name can be found by inspecting the Entitlements drop-down while creating/editing a provisioning profile (e.g. \"Apple Pay Pass Suppression Development\")",
155
155
  optional: true,
156
- default_value: nil)
156
+ default_value: nil),
157
+ FastlaneCore::ConfigItem.new(key: :fail_on_name_taken,
158
+ env_name: "SIGH_FAIL_ON_NAME_TAKEN",
159
+ description: "Should the command fail if it was about to create a duplicate of an existing provisioning profile. It can happen due to issues on Apple Developer Portal, when profile to be recreated was not properly deleted first",
160
+ optional: true,
161
+ is_string: false,
162
+ default_value: false)
157
163
  ]
158
164
  end
159
165
  end
@@ -125,7 +125,8 @@ module Sigh
125
125
  name = Sigh.config[:provisioning_name] || [bundle_id, profile_type.pretty_type].join(' ')
126
126
 
127
127
  unless Sigh.config[:skip_fetch_profiles]
128
- if Spaceship.provisioning_profile.all.find { |p| p.name == name }
128
+ if Spaceship.provisioning_profile.all(mac: Sigh.config[:platform].to_s == 'macos').find { |p| p.name == name }
129
+ UI.user_error!("The name '#{name}' is already taken, and fail_on_name_taken is true") if Sigh.config[:fail_on_name_taken]
129
130
  UI.error("The name '#{name}' is already taken, using another one.")
130
131
  name += " #{Time.now.to_i}"
131
132
  end
@@ -38,22 +38,13 @@ func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
38
38
  }
39
39
 
40
40
  enum SnapshotError: Error, CustomDebugStringConvertible {
41
- case cannotDetectUser
42
- case cannotFindHomeDirectory
43
41
  case cannotFindSimulatorHomeDirectory
44
- case cannotAccessSimulatorHomeDirectory(String)
45
42
  case cannotRunOnPhysicalDevice
46
43
 
47
44
  var debugDescription: String {
48
45
  switch self {
49
- case .cannotDetectUser:
50
- return "Couldn't find Snapshot configuration files - can't detect current user "
51
- case .cannotFindHomeDirectory:
52
- return "Couldn't find Snapshot configuration files - can't detect `Users` dir"
53
46
  case .cannotFindSimulatorHomeDirectory:
54
47
  return "Couldn't find simulator home location. Please, check SIMULATOR_HOST_HOME env variable."
55
- case .cannotAccessSimulatorHomeDirectory(let simulatorHostHome):
56
- return "Can't prepare environment. Simulator home location is inaccessible. Does \(simulatorHostHome) exist?"
57
48
  case .cannotRunOnPhysicalDevice:
58
49
  return "Can't use Snapshot on a physical device."
59
50
  }
@@ -75,7 +66,7 @@ open class Snapshot: NSObject {
75
66
  Snapshot.waitForAnimations = waitForAnimations
76
67
 
77
68
  do {
78
- let cacheDir = try pathPrefix()
69
+ let cacheDir = try getCacheDirectory()
79
70
  Snapshot.cacheDirectory = cacheDir
80
71
  setLanguage(app)
81
72
  setLocale(app)
@@ -206,34 +197,22 @@ open class Snapshot: NSObject {
206
197
  _ = XCTWaiter.wait(for: [networkLoadingIndicatorDisappeared], timeout: timeout)
207
198
  }
208
199
 
209
- class func pathPrefix() throws -> URL? {
210
- let homeDir: URL
200
+ class func getCacheDirectory() throws -> URL {
201
+ let cachePath = "Library/Caches/tools.fastlane"
211
202
  // on OSX config is stored in /Users/<username>/Library
212
203
  // and on iOS/tvOS/WatchOS it's in simulator's home dir
213
204
  #if os(OSX)
214
- guard let user = ProcessInfo().environment["USER"] else {
215
- throw SnapshotError.cannotDetectUser
205
+ let homeDir = URL(fileURLWithPath: NSHomeDirectory())
206
+ return homeDir.appendingPathComponent(cachePath)
207
+ #elseif arch(i386) || arch(x86_64)
208
+ guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
209
+ throw SnapshotError.cannotFindSimulatorHomeDirectory
216
210
  }
217
-
218
- guard let usersDir = FileManager.default.urls(for: .userDirectory, in: .localDomainMask).first else {
219
- throw SnapshotError.cannotFindHomeDirectory
220
- }
221
-
222
- homeDir = usersDir.appendingPathComponent(user)
211
+ let homeDir = URL(fileURLWithPath: simulatorHostHome)
212
+ return homeDir.appendingPathComponent(cachePath)
223
213
  #else
224
- #if arch(i386) || arch(x86_64)
225
- guard let simulatorHostHome = ProcessInfo().environment["SIMULATOR_HOST_HOME"] else {
226
- throw SnapshotError.cannotFindSimulatorHomeDirectory
227
- }
228
- guard let homeDirUrl = URL(string: simulatorHostHome) else {
229
- throw SnapshotError.cannotAccessSimulatorHomeDirectory(simulatorHostHome)
230
- }
231
- homeDir = URL(fileURLWithPath: homeDirUrl.path)
232
- #else
233
- throw SnapshotError.cannotRunOnPhysicalDevice
234
- #endif
214
+ throw SnapshotError.cannotRunOnPhysicalDevice
235
215
  #endif
236
- return homeDir.appendingPathComponent("Library/Caches/tools.fastlane")
237
216
  }
238
217
  }
239
218
 
@@ -300,4 +279,4 @@ private extension CGFloat {
300
279
 
301
280
  // Please don't remove the lines below
302
281
  // They are used to detect outdated configuration files
303
- // SnapshotHelperVersion [1.21]
282
+ // SnapshotHelperVersion [1.22]
@@ -30,6 +30,9 @@ module Snapshot
30
30
 
31
31
  Snapshot.project.select_scheme(preferred_to_include: "UITests")
32
32
 
33
+ coerce_to_array_of_strings(:only_testing)
34
+ coerce_to_array_of_strings(:skip_testing)
35
+
33
36
  # Devices
34
37
  if config[:devices].nil? && !Snapshot.project.mac?
35
38
  config[:devices] = []
@@ -67,5 +70,17 @@ module Snapshot
67
70
  config[:devices] = ["Mac"]
68
71
  end
69
72
  end
73
+
74
+ def self.coerce_to_array_of_strings(config_key)
75
+ config_value = Snapshot.config[config_key]
76
+
77
+ return if config_value.nil?
78
+
79
+ # splitting on comma allows us to support comma-separated lists of values
80
+ # from the command line, even though the ConfigItem is not defined as an
81
+ # Array type
82
+ config_value = config_value.split(',') unless config_value.kind_of?(Array)
83
+ Snapshot.config[config_key] = config_value.map(&:to_s)
84
+ end
70
85
  end
71
86
  end
@@ -5,6 +5,11 @@ require_relative 'module'
5
5
 
6
6
  module Snapshot
7
7
  class Options
8
+ def self.verify_type(item_name, acceptable_types, value)
9
+ type_ok = [Array, String].any? { |type| value.kind_of?(type) }
10
+ UI.user_error!("'#{item_name}' should be of type #{acceptable_types.join(' or ')} but found: #{value.class.name}") unless type_ok
11
+ end
12
+
8
13
  def self.available_options
9
14
  output_directory = (File.directory?("fastlane") ? "fastlane/screenshots" : "screenshots")
10
15
 
@@ -242,7 +247,23 @@ module Snapshot
242
247
  env_name: "SNAPSHOT_TESTPLAN",
243
248
  description: "The testplan associated with the scheme that should be used for testing",
244
249
  is_string: true,
245
- optional: true)
250
+ optional: true),
251
+ FastlaneCore::ConfigItem.new(key: :only_testing,
252
+ env_name: "SNAPSHOT_ONLY_TESTING",
253
+ description: "Array of strings matching Test Bundle/Test Suite/Test Cases to run",
254
+ optional: true,
255
+ is_string: false,
256
+ verify_block: proc do |value|
257
+ verify_type('only_testing', [Array, String], value)
258
+ end),
259
+ FastlaneCore::ConfigItem.new(key: :skip_testing,
260
+ env_name: "SNAPSHOT_SKIP_TESTING",
261
+ description: "Array of strings matching Test Bundle/Test Suite/Test Cases to skip",
262
+ optional: true,
263
+ is_string: false,
264
+ verify_block: proc do |value|
265
+ verify_type('skip_testing', [Array, String], value)
266
+ end)
246
267
  ]
247
268
  end
248
269
  end
@@ -59,7 +59,9 @@ module Snapshot
59
59
 
60
60
  device_types.each do |type|
61
61
  if launcher_config.erase_simulator || launcher_config.localize_simulator || !launcher_config.dark_mode.nil?
62
- erase_simulator(type)
62
+ if launcher_config.erase_simulator
63
+ erase_simulator(type)
64
+ end
63
65
  if launcher_config.localize_simulator
64
66
  localize_simulator(type, language, locale)
65
67
  end
@@ -30,6 +30,11 @@ module Snapshot
30
30
  options << "-testPlan '#{config[:testplan]}'" if config[:testplan]
31
31
  end
32
32
  options << config[:xcargs] if config[:xcargs]
33
+
34
+ # detect_values will ensure that these values are present as Arrays if
35
+ # they are present at all
36
+ options += config[:only_testing].map { |test_id| "-only-testing:#{test_id.shellescape}" } if config[:only_testing]
37
+ options += config[:skip_testing].map { |test_id| "-skip-testing:#{test_id.shellescape}" } if config[:skip_testing]
33
38
  return options
34
39
  end
35
40
 
@@ -91,7 +96,8 @@ module Snapshot
91
96
  language_key = locale || language
92
97
 
93
98
  unless Snapshot.cache[:result_bundle_path][language_key]
94
- path = File.join(Snapshot.config[:output_directory], "test_output", language_key, Snapshot.config[:scheme]) + ".test_result"
99
+ ext = FastlaneCore::Helper.xcode_at_least?(11) ? '.xcresult' : '.test_result'
100
+ path = File.join(Snapshot.config[:output_directory], "test_output", language_key, Snapshot.config[:scheme]) + ext
95
101
  if File.directory?(path)
96
102
  FileUtils.remove_dir(path)
97
103
  end
@@ -25,6 +25,7 @@ module Spaceship
25
25
 
26
26
  global_option('-u', '--user USERNAME', 'Specify the Apple ID you want to log in with')
27
27
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
28
+ global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
28
29
 
29
30
  command :playground do |c|
30
31
  c.syntax = 'fastlane spaceship playground'
@@ -158,6 +158,10 @@ module Spaceship
158
158
  def post_beta_app_review_submission
159
159
  return Spaceship::ConnectAPI.post_beta_app_review_submissions(build_id: id)
160
160
  end
161
+
162
+ def expire!
163
+ return Spaceship::ConnectAPI.patch_builds(build_id: id, attributes: { expired: true })
164
+ end
161
165
  end
162
166
  end
163
167
  end
@@ -24,6 +24,7 @@ module Supply
24
24
  always_trace!
25
25
 
26
26
  global_option('--verbose') { FastlaneCore::Globals.verbose = true }
27
+ global_option('--env STRING[,STRING2]', String, 'Add environment(s) to use with `dotenv`')
27
28
 
28
29
  command :run do |c|
29
30
  c.syntax = 'fastlane supply'
@@ -281,6 +281,15 @@ module Supply
281
281
  UI.user_error!("Version code '#{version_code}' is not an integer") if version_code == 0
282
282
  end
283
283
  end),
284
+ FastlaneCore::ConfigItem.new(key: :in_app_update_priority,
285
+ env_name: "SUPPLY_IN_APP_UPDATE_PRIORITY",
286
+ optional: true,
287
+ type: Integer,
288
+ description: "In-app update priority for all the newly added apks in the release. Can take values between [0,5]",
289
+ verify_block: proc do |in_app_update_priority|
290
+ in_app_update_priority = in_app_update_priority.to_i
291
+ UI.user_error!("Invalid in_app_update_priority value '#{in_app_update_priority}'. Values must be between [0,5]") unless (0..5).member?(in_app_update_priority)
292
+ end),
284
293
  FastlaneCore::ConfigItem.new(key: :obb_main_references_version,
285
294
  env_name: "SUPPLY_OBB_MAIN_REFERENCES_VERSION",
286
295
  description: "References version of 'main' expansion file",
@@ -391,6 +391,10 @@ module Supply
391
391
  end
392
392
  end
393
393
 
394
+ if Supply.config[:in_app_update_priority]
395
+ track_release.in_app_update_priority = Supply.config[:in_app_update_priority].to_i
396
+ end
397
+
394
398
  tracks = client.tracks(Supply.config[:track])
395
399
  track = tracks.first
396
400
  if track
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.147.0
4
+ version: 2.148.0
5
5
  platform: ruby
6
6
  authors:
7
- - Josh Holtz
8
- - Joshua Liebowitz
9
- - Felix Krause
10
- - Iulian Onofrei
11
- - Stefan Natchev
12
- - Fumiya Nakamura
13
- - Jorge Revuelta H
14
- - Helmut Januschka
15
- - Manu Wallner
7
+ - Matthew Ellis
16
8
  - Olivier Halligon
9
+ - Kohki Miki
17
10
  - Danielle Tomlinson
18
- - Jérôme Lacoste
19
- - Matthew Ellis
20
- - Max Ott
21
- - Aaron Brager
22
- - Luka Mirosevic
23
- - Andrew McBurney
24
11
  - Maksym Grebenets
12
+ - Helmut Januschka
25
13
  - Daniel Jankowski
26
- - Jan Piotrowski
27
- - Kohki Miki
14
+ - Max Ott
15
+ - Stefan Natchev
28
16
  - Jimmy Dee
17
+ - Luka Mirosevic
18
+ - Jan Piotrowski
19
+ - Andrew McBurney
20
+ - Aaron Brager
21
+ - Josh Holtz
22
+ - Jérôme Lacoste
23
+ - Fumiya Nakamura
24
+ - Manu Wallner
25
+ - Joshua Liebowitz
26
+ - Iulian Onofrei
27
+ - Jorge Revuelta H
28
+ - Felix Krause
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-05-12 00:00:00.000000000 Z
32
+ date: 2020-05-14 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier
@@ -625,20 +625,20 @@ dependencies:
625
625
  requirements:
626
626
  - - ">="
627
627
  - !ruby/object:Gem::Version
628
- version: 0.29.2
628
+ version: 0.37.0
629
629
  - - "<"
630
630
  - !ruby/object:Gem::Version
631
- version: 0.37.0
631
+ version: 0.39.0
632
632
  type: :runtime
633
633
  prerelease: false
634
634
  version_requirements: !ruby/object:Gem::Requirement
635
635
  requirements:
636
636
  - - ">="
637
637
  - !ruby/object:Gem::Version
638
- version: 0.29.2
638
+ version: 0.37.0
639
639
  - - "<"
640
640
  - !ruby/object:Gem::Version
641
- version: 0.37.0
641
+ version: 0.39.0
642
642
  - !ruby/object:Gem::Dependency
643
643
  name: google-cloud-storage
644
644
  requirement: !ruby/object:Gem::Requirement
@@ -1613,6 +1613,8 @@ files:
1613
1613
  - snapshot/lib/assets/SnapshotHelper.swift
1614
1614
  - snapshot/lib/assets/SnapshotHelperXcode8.swift
1615
1615
  - snapshot/lib/snapshot.rb
1616
+ - snapshot/lib/snapshot/.options.rb.swp
1617
+ - snapshot/lib/snapshot/.test_command_generator_base.rb.swp
1616
1618
  - snapshot/lib/snapshot/collector.rb
1617
1619
  - snapshot/lib/snapshot/commands_generator.rb
1618
1620
  - snapshot/lib/snapshot/dependency_checker.rb
@@ -1784,7 +1786,6 @@ files:
1784
1786
  - spaceship/lib/spaceship/ui.rb
1785
1787
  - supply/README.md
1786
1788
  - supply/lib/supply.rb
1787
- - supply/lib/supply/.client.rb.swp
1788
1789
  - supply/lib/supply/apk_listing.rb
1789
1790
  - supply/lib/supply/client.rb
1790
1791
  - supply/lib/supply/commands_generator.rb