fastlane 2.143.0 → 2.144.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/deliver/lib/deliver/options.rb +26 -0
  4. data/fastlane/lib/fastlane/actions/automatic_code_signing.rb +7 -1
  5. data/fastlane/lib/fastlane/actions/clean_build_artifacts.rb +3 -0
  6. data/fastlane/lib/fastlane/actions/crashlytics.rb +14 -2
  7. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +2 -2
  8. data/fastlane/lib/fastlane/actions/pod_lib_lint.rb +7 -1
  9. data/fastlane/lib/fastlane/actions/swiftlint.rb +28 -7
  10. data/fastlane/lib/fastlane/actions/update_code_signing_settings.rb +190 -0
  11. data/fastlane/lib/fastlane/helper/s3_client_helper.rb +1 -1
  12. data/fastlane/lib/fastlane/version.rb +1 -1
  13. data/fastlane/swift/Deliverfile.swift +1 -1
  14. data/fastlane/swift/Fastlane.swift +56 -4
  15. data/fastlane/swift/Gymfile.swift +1 -1
  16. data/fastlane/swift/Matchfile.swift +1 -1
  17. data/fastlane/swift/Precheckfile.swift +1 -1
  18. data/fastlane/swift/Scanfile.swift +1 -1
  19. data/fastlane/swift/ScanfileProtocol.swift +5 -1
  20. data/fastlane/swift/Screengrabfile.swift +1 -1
  21. data/fastlane/swift/Snapshotfile.swift +1 -1
  22. data/fastlane_core/lib/fastlane_core/device_manager.rb +1 -1
  23. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +15 -2
  24. data/gym/lib/gym/generators/package_command_generator.rb +4 -0
  25. data/gym/lib/gym/generators/package_command_generator_xcode7.rb +5 -0
  26. data/gym/lib/gym/runner.rb +14 -0
  27. data/match/lib/match/importer.rb +33 -18
  28. data/scan/lib/scan/options.rb +5 -0
  29. data/scan/lib/scan/test_command_generator.rb +3 -0
  30. data/sigh/lib/sigh/.runner.rb.swp +0 -0
  31. data/spaceship/lib/spaceship/connect_api/models/.bundle_id.rb.swp +0 -0
  32. data/spaceship/lib/spaceship/connect_api/models/.bundle_id_capability.rb.swp +0 -0
  33. data/spaceship/lib/spaceship/connect_api/models/app.rb +11 -0
  34. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +23 -0
  35. data/spaceship/lib/spaceship/tunes/app_version.rb +6 -1
  36. data/supply/lib/supply/client.rb +1 -1
  37. metadata +24 -21
  38. data/spaceship/lib/spaceship/portal/.certificate.rb.swp +0 -0
@@ -18,4 +18,4 @@ class Gymfile: GymfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -18,4 +18,4 @@ class Matchfile: MatchfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -18,4 +18,4 @@ class Precheckfile: PrecheckfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -18,4 +18,4 @@ class Scanfile: ScanfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -42,6 +42,9 @@ protocol ScanfileProtocol: class {
42
42
  /// Array of strings matching Test Bundle/Test Suite/Test Cases to skip
43
43
  var skipTesting: String? { get }
44
44
 
45
+ /// The testplan associated with the scheme that should be used for testing
46
+ var testplan: String? { get }
47
+
45
48
  /// Run tests using the provided `.xctestrun` file
46
49
  var xctestrun: String? { get }
47
50
 
@@ -193,6 +196,7 @@ extension ScanfileProtocol {
193
196
  var appIdentifier: String? { return nil }
194
197
  var onlyTesting: String? { return nil }
195
198
  var skipTesting: String? { return nil }
199
+ var testplan: String? { return nil }
196
200
  var xctestrun: String? { return nil }
197
201
  var toolchain: String? { return nil }
198
202
  var clean: Bool { return false }
@@ -242,4 +246,4 @@ extension ScanfileProtocol {
242
246
 
243
247
  // Please don't remove the lines below
244
248
  // They are used to detect outdated files
245
- // FastlaneRunnerAPIVersion [0.9.26]
249
+ // FastlaneRunnerAPIVersion [0.9.27]
@@ -18,4 +18,4 @@ class Screengrabfile: ScreengrabfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -18,4 +18,4 @@ class Snapshotfile: SnapshotfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.143.0
21
+ // Generated with fastlane 2.144.0
@@ -223,7 +223,7 @@ module FastlaneCore
223
223
  plist_buddy_cmd = "-c \"Add :KeyboardContinuousPathEnabled bool false\""
224
224
  plist_path = File.expand_path("~/Library/Developer/CoreSimulator/Devices/#{self.udid}/data/Library/Preferences/com.apple.keyboard.ContinuousPath.plist")
225
225
 
226
- Helper.backticks("#{plist_buddy} #{plist_buddy_cmd} #{plist_path}")
226
+ Helper.backticks("#{plist_buddy} #{plist_buddy_cmd} #{plist_path} >/dev/null 2>&1")
227
227
  end
228
228
  end
229
229
  end
@@ -44,16 +44,29 @@ module FastlaneCore
44
44
  parse(path, keychain_path).fetch("Name")
45
45
  end
46
46
 
47
+ def bundle_id(path, keychain_path = nil)
48
+ profile = parse(path, keychain_path)
49
+ app_id_prefix = profile["ApplicationIdentifierPrefix"].first
50
+ bundle_id = profile["Entitlements"]["application-identifier"].gsub("#{app_id_prefix}.", "")
51
+ bundle_id
52
+ rescue
53
+ UI.error("Unable to extract the Bundle Id from the provided provisioning profile '#{path}'.")
54
+ end
55
+
47
56
  def mac?(path, keychain_path = nil)
48
57
  parse(path, keychain_path).fetch("Platform", []).include?('OSX')
49
58
  end
50
59
 
51
60
  def profile_filename(path, keychain_path = nil)
52
61
  basename = uuid(path, keychain_path)
62
+ basename + profile_extension(path, keychain_path)
63
+ end
64
+
65
+ def profile_extension(path, keychain_path = nil)
53
66
  if mac?(path, keychain_path)
54
- basename + ".provisionprofile"
67
+ ".provisionprofile"
55
68
  else
56
- basename + ".mobileprovision"
69
+ ".mobileprovision"
57
70
  end
58
71
  end
59
72
 
@@ -49,6 +49,10 @@ module Gym
49
49
  generator.apps_path
50
50
  end
51
51
 
52
+ def asset_packs_path
53
+ generator.asset_packs_path
54
+ end
55
+
52
56
  # The generator we need to use for the currently used Xcode version
53
57
  # Since we dropped Xcode 6 support, it's just this class, but maybe we'll have
54
58
  # new classes in the future
@@ -136,6 +136,11 @@ module Gym
136
136
  Gym.cache[:apps_path] ||= File.join(temporary_output_path, "Apps")
137
137
  end
138
138
 
139
+ # The path to the Apps folder
140
+ def asset_packs_path
141
+ Gym.cache[:asset_packs_path] ||= File.join(temporary_output_path, "OnDemandResources")
142
+ end
143
+
139
144
  private
140
145
 
141
146
  def normalize_export_options(hash)
@@ -39,6 +39,7 @@ module Gym
39
39
  move_app_thinning
40
40
  move_app_thinning_size_report
41
41
  move_apps_folder
42
+ move_asset_packs
42
43
  elsif is_mac
43
44
  path = File.expand_path(Gym.config[:output_directory])
44
45
  compress_and_move_dsym
@@ -325,6 +326,19 @@ module Gym
325
326
  end
326
327
  end
327
328
 
329
+ # Move Asset Packs folder to the output directory
330
+ # @return (String) The path to the resulting Asset Packs (aka OnDemandResources) folder
331
+ def move_asset_packs
332
+ if Dir.exist?(PackageCommandGenerator.asset_packs_path)
333
+ FileUtils.mv(PackageCommandGenerator.asset_packs_path, File.expand_path(Gym.config[:output_directory]), force: true)
334
+ asset_packs_path = File.join(File.expand_path(Gym.config[:output_directory]), File.basename(PackageCommandGenerator.asset_packs_path))
335
+
336
+ UI.success("Successfully exported Asset Pack folder:")
337
+ UI.message(asset_packs_path)
338
+ asset_packs_path
339
+ end
340
+ end
341
+
328
342
  def find_archive_path
329
343
  Dir.glob(File.join(BuildCommandGenerator.build_path, "*.ipa")).last
330
344
  end
@@ -2,23 +2,16 @@ require_relative 'spaceship_ensure'
2
2
  require_relative 'encryption'
3
3
  require_relative 'storage'
4
4
  require_relative 'module'
5
+ require 'fastlane_core/provisioning_profile'
5
6
  require 'fileutils'
6
7
 
7
8
  module Match
8
9
  class Importer
9
- def import_cert(params, cert_path: nil, p12_path: nil)
10
- # Get and verify cert and p12 path
11
- cert_path ||= UI.input("Certificate (.cer) path:")
12
- p12_path ||= UI.input("Private key (.p12) path:")
13
-
14
- cert_path = File.absolute_path(cert_path)
15
- p12_path = File.absolute_path(p12_path)
16
-
17
- UI.user_error!("Certificate does not exist at path: #{cert_path}") unless File.exist?(cert_path)
18
- UI.user_error!("Private key does not exist at path: #{p12_path}") unless File.exist?(p12_path)
19
-
20
- # Base64 encode contents to find match from API to find a cert ID
21
- cert_contents_base_64 = Base64.strict_encode64(File.open(cert_path).read)
10
+ def import_cert(params, cert_path: nil, p12_path: nil, profile_path: nil)
11
+ # Get and verify cert, p12 and profiles path
12
+ cert_path = ensure_valid_file_path(cert_path, "Certificate", ".cer")
13
+ p12_path = ensure_valid_file_path(p12_path, "Private key", ".p12")
14
+ profile_path = ensure_valid_file_path(profile_path, "Provisioning profile", ".mobileprovision or .provisionprofile", optional: true)
22
15
 
23
16
  # Storage
24
17
  storage = Storage.for_mode(params[:storage_mode], {
@@ -61,13 +54,16 @@ module Match
61
54
  UI.user_error!("Cert type '#{cert_type}' is not supported")
62
55
  end
63
56
 
64
- output_dir = File.join(storage.prefixed_working_directory, "certs", cert_type.to_s)
57
+ output_dir_certs = File.join(storage.prefixed_working_directory, "certs", cert_type.to_s)
58
+ output_dir_profiles = File.join(storage.prefixed_working_directory, "profiles", cert_type.to_s)
65
59
 
66
60
  # Need to get the cert id by comparing base64 encoded cert content with certificate content from the API responses
67
61
  Spaceship::Portal.login(params[:username])
68
62
  Spaceship::Portal.select_team(team_id: params[:team_id], team_name: params[:team_name])
69
63
  certs = Spaceship::ConnectAPI::Certificate.all(filter: { certificateType: certificate_type })
70
64
 
65
+ # Base64 encode contents to find match from API to find a cert ID
66
+ cert_contents_base_64 = Base64.strict_encode64(File.binread(cert_path))
71
67
  matching_cert = certs.find do |cert|
72
68
  cert.certificate_content == cert_contents_base_64
73
69
  end
@@ -75,18 +71,37 @@ module Match
75
71
  UI.user_error!("This certificate cannot be imported - the certificate contents did not match with any available on the Developer Portal") if matching_cert.nil?
76
72
 
77
73
  # Make dir if doesn't exist
78
- FileUtils.mkdir_p(output_dir)
79
- dest_cert_path = File.join(output_dir, "#{matching_cert.id}.cer")
80
- dest_p12_path = File.join(output_dir, "#{matching_cert.id}.p12")
74
+ FileUtils.mkdir_p(output_dir_certs)
75
+ dest_cert_path = File.join(output_dir_certs, "#{matching_cert.id}.cer")
76
+ dest_p12_path = File.join(output_dir_certs, "#{matching_cert.id}.p12")
77
+
78
+ files_to_commit = [dest_cert_path, dest_p12_path]
81
79
 
82
80
  # Copy files
83
81
  IO.copy_stream(cert_path, dest_cert_path)
84
82
  IO.copy_stream(p12_path, dest_p12_path)
85
- files_to_commit = [dest_cert_path, dest_p12_path]
83
+ unless profile_path.nil?
84
+ FileUtils.mkdir_p(output_dir_profiles)
85
+ bundle_id = FastlaneCore::ProvisioningProfile.bundle_id(profile_path)
86
+ profile_extension = FastlaneCore::ProvisioningProfile.profile_extension(profile_path)
87
+ dest_profile_path = File.join(output_dir_profiles, "#{cert_type.to_s.capitalize}_#{bundle_id}#{profile_extension}")
88
+ files_to_commit.push(dest_profile_path)
89
+ IO.copy_stream(profile_path, dest_profile_path)
90
+ end
86
91
 
87
92
  # Encrypt and commit
88
93
  encryption.encrypt_files if encryption
89
94
  storage.save_changes!(files_to_commit: files_to_commit)
90
95
  end
96
+
97
+ def ensure_valid_file_path(file_path, file_description, file_extension, optional: false)
98
+ optional_file_message = optional ? " or leave empty to skip this file" : ""
99
+ file_path ||= UI.input("#{file_description} (#{file_extension}) path#{optional_file_message}:")
100
+
101
+ file_path = File.absolute_path(file_path) unless file_path == ""
102
+ file_path = File.exist?(file_path) ? file_path : nil
103
+ UI.user_error!("#{file_description} does not exist at path: #{file_path}") unless !file_path.nil? || optional
104
+ file_path
105
+ end
91
106
  end
92
107
  end
@@ -124,6 +124,11 @@ module Scan
124
124
  end),
125
125
 
126
126
  # other test options
127
+ FastlaneCore::ConfigItem.new(key: :testplan,
128
+ env_name: "SCAN_TESTPLAN",
129
+ description: "The testplan associated with the scheme that should be used for testing",
130
+ is_string: true,
131
+ optional: true),
127
132
  FastlaneCore::ConfigItem.new(key: :xctestrun,
128
133
  short_option: "-X",
129
134
  env_name: "SCAN_XCTESTRUN",
@@ -45,6 +45,9 @@ module Scan
45
45
  options << "-enableCodeCoverage #{config[:code_coverage] ? 'YES' : 'NO'}" unless config[:code_coverage].nil?
46
46
  options << "-enableAddressSanitizer #{config[:address_sanitizer] ? 'YES' : 'NO'}" unless config[:address_sanitizer].nil?
47
47
  options << "-enableThreadSanitizer #{config[:thread_sanitizer] ? 'YES' : 'NO'}" unless config[:thread_sanitizer].nil?
48
+ if FastlaneCore::Helper.xcode_at_least?(11)
49
+ options << "-testPlan #{config[:testplan]}" if config[:testplan]
50
+ end
48
51
  options << "-xctestrun '#{config[:xctestrun]}'" if config[:xctestrun]
49
52
  options << config[:xcargs] if config[:xcargs]
50
53
 
Binary file
@@ -103,6 +103,17 @@ module Spaceship
103
103
  resps = Spaceship::ConnectAPI.get_beta_groups(filter: filter, includes: includes, limit: limit, sort: sort).all_pages
104
104
  return resps.flat_map(&:to_models)
105
105
  end
106
+
107
+ def create_beta_group(group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
108
+ resps = Spaceship::ConnectAPI.create_beta_group(
109
+ app_id: id,
110
+ group_name: group_name,
111
+ public_link_enabled: public_link_enabled,
112
+ public_link_limit: public_link_limit,
113
+ public_link_limit_enabled: public_link_limit_enabled
114
+ ).all_pages
115
+ return resps.flat_map(&:to_models).first
116
+ end
106
117
  end
107
118
  end
108
119
  end
@@ -181,6 +181,29 @@ module Spaceship
181
181
  Client.instance.post("builds/#{build_id}/relationships/betaGroups", body)
182
182
  end
183
183
 
184
+ def create_beta_group(app_id: nil, group_name: nil, public_link_enabled: false, public_link_limit: 10_000, public_link_limit_enabled: false)
185
+ body = {
186
+ data: {
187
+ attributes: {
188
+ name: group_name,
189
+ publicLinkEnabled: public_link_enabled,
190
+ publicLinkLimit: public_link_limit,
191
+ publicLinkLimitEnabled: public_link_limit_enabled
192
+ },
193
+ relationships: {
194
+ app: {
195
+ data: {
196
+ id: app_id,
197
+ type: "apps"
198
+ }
199
+ }
200
+ },
201
+ type: "betaGroups"
202
+ }
203
+ }
204
+ Client.instance.post("betaGroups", body)
205
+ end
206
+
184
207
  #
185
208
  # betaTesters
186
209
  #
@@ -767,14 +767,19 @@ module Spaceship
767
767
  end
768
768
 
769
769
  def setup_screenshots
770
- # Enable Scaling for all screen sizes that don't have at least one screenshot
770
+ # Enable Scaling for all screen sizes that don't have at least one screenshot or at least one trailer (app_preview)
771
771
  # We automatically disable scaling once we upload at least one screenshot
772
772
  language_details = raw_data_details.each do |current_language|
773
773
  language_details = (current_language["displayFamilies"] || {})["value"]
774
774
  (language_details || []).each do |device_language_details|
775
+ # Do not enable scaling if a screenshot already exists
775
776
  next if device_language_details["screenshots"].nil?
776
777
  next if device_language_details["screenshots"]["value"].count > 0
777
778
 
779
+ # Do not enable scaling if a trailer already exists
780
+ next if device_language_details["trailers"].nil?
781
+ next if device_language_details["trailers"]["value"].count > 0
782
+
778
783
  # The current row includes screenshots for all device types
779
784
  # so we need to enable scaling for both iOS and watchOS apps
780
785
  device_language_details["scaled"]["value"] = true if device_language_details["scaled"]
@@ -405,7 +405,7 @@ module Supply
405
405
  )
406
406
  return result.releases.flat_map(&:version_codes) || []
407
407
  rescue Google::Apis::ClientError => e
408
- return [] if e.status_code == 404 && e.to_s.include?("trackEmpty")
408
+ return [] if e.status_code == 404 && (e.to_s.include?("trackEmpty") || e.to_s.include?("Track not found"))
409
409
  raise
410
410
  end
411
411
  end
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.143.0
4
+ version: 2.144.0
5
5
  platform: ruby
6
6
  authors:
7
- - Joshua Liebowitz
8
- - Stefan Natchev
9
- - Andrew McBurney
10
- - Aaron Brager
11
- - Fumiya Nakamura
7
+ - Danielle Tomlinson
8
+ - Max Ott
12
9
  - Daniel Jankowski
10
+ - Helmut Januschka
11
+ - Josh Holtz
13
12
  - Kohki Miki
14
- - Jorge Revuelta H
15
- - Matthew Ellis
16
- - Luka Mirosevic
17
13
  - Iulian Onofrei
18
- - Danielle Tomlinson
19
- - Josh Holtz
20
- - Manu Wallner
21
- - Jimmy Dee
22
- - Helmut Januschka
23
14
  - Felix Krause
24
- - Jérôme Lacoste
15
+ - Matthew Ellis
16
+ - Stefan Natchev
25
17
  - Olivier Halligon
26
- - Max Ott
18
+ - Luka Mirosevic
27
19
  - Jan Piotrowski
20
+ - Joshua Liebowitz
28
21
  - Maksym Grebenets
22
+ - Fumiya Nakamura
23
+ - Jimmy Dee
24
+ - Jorge Revuelta H
25
+ - Jérôme Lacoste
26
+ - Andrew McBurney
27
+ - Aaron Brager
28
+ - Manu Wallner
29
29
  autorequire:
30
30
  bindir: bin
31
31
  cert_chain: []
32
- date: 2020-03-04 00:00:00.000000000 Z
32
+ date: 2020-03-24 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: slack-notifier
@@ -668,19 +668,19 @@ dependencies:
668
668
  - !ruby/object:Gem::Version
669
669
  version: '2.0'
670
670
  - !ruby/object:Gem::Dependency
671
- name: aws-sdk
671
+ name: aws-sdk-s3
672
672
  requirement: !ruby/object:Gem::Requirement
673
673
  requirements:
674
674
  - - "~>"
675
675
  - !ruby/object:Gem::Version
676
- version: '2.3'
676
+ version: '1.0'
677
677
  type: :runtime
678
678
  prerelease: false
679
679
  version_requirements: !ruby/object:Gem::Requirement
680
680
  requirements:
681
681
  - - "~>"
682
682
  - !ruby/object:Gem::Version
683
- version: '2.3'
683
+ version: '1.0'
684
684
  - !ruby/object:Gem::Dependency
685
685
  name: rake
686
686
  requirement: !ruby/object:Gem::Requirement
@@ -1227,6 +1227,7 @@ files:
1227
1227
  - fastlane/lib/fastlane/actions/unlock_keychain.rb
1228
1228
  - fastlane/lib/fastlane/actions/update_app_group_identifiers.rb
1229
1229
  - fastlane/lib/fastlane/actions/update_app_identifier.rb
1230
+ - fastlane/lib/fastlane/actions/update_code_signing_settings.rb
1230
1231
  - fastlane/lib/fastlane/actions/update_fastlane.rb
1231
1232
  - fastlane/lib/fastlane/actions/update_icloud_container_identifiers.rb
1232
1233
  - fastlane/lib/fastlane/actions/update_info_plist.rb
@@ -1589,6 +1590,7 @@ files:
1589
1590
  - sigh/README.md
1590
1591
  - sigh/lib/assets/resign.sh
1591
1592
  - sigh/lib/sigh.rb
1593
+ - sigh/lib/sigh/.runner.rb.swp
1592
1594
  - sigh/lib/sigh/commands_generator.rb
1593
1595
  - sigh/lib/sigh/download_all.rb
1594
1596
  - sigh/lib/sigh/local_manage.rb
@@ -1644,6 +1646,8 @@ files:
1644
1646
  - spaceship/lib/spaceship/connect_api/.DS_Store
1645
1647
  - spaceship/lib/spaceship/connect_api/client.rb
1646
1648
  - spaceship/lib/spaceship/connect_api/model.rb
1649
+ - spaceship/lib/spaceship/connect_api/models/.bundle_id.rb.swp
1650
+ - spaceship/lib/spaceship/connect_api/models/.bundle_id_capability.rb.swp
1647
1651
  - spaceship/lib/spaceship/connect_api/models/app.rb
1648
1652
  - spaceship/lib/spaceship/connect_api/models/beta_app_localization.rb
1649
1653
  - spaceship/lib/spaceship/connect_api/models/beta_app_review_detail.rb
@@ -1684,7 +1688,6 @@ files:
1684
1688
  - spaceship/lib/spaceship/launcher.rb
1685
1689
  - spaceship/lib/spaceship/module.rb
1686
1690
  - spaceship/lib/spaceship/playground.rb
1687
- - spaceship/lib/spaceship/portal/.certificate.rb.swp
1688
1691
  - spaceship/lib/spaceship/portal/app.rb
1689
1692
  - spaceship/lib/spaceship/portal/app_group.rb
1690
1693
  - spaceship/lib/spaceship/portal/app_service.rb