fastlane 2.150.0.rc5 → 2.150.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +84 -84
  3. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → deliver/lib/deliver/.commands_generator.rb.swp} +0 -0
  4. data/{pilot/lib/pilot/.manager.rb.swp → deliver/lib/deliver/.download_screenshots.rb.swp} +0 -0
  5. data/deliver/lib/deliver/.submit_for_review.rb.swp +0 -0
  6. data/deliver/lib/deliver/.upload_metadata.rb.swp +0 -0
  7. data/deliver/lib/deliver/.upload_screenshots.rb.swp +0 -0
  8. data/deliver/lib/deliver/download_screenshots.rb +11 -9
  9. data/deliver/lib/deliver/runner.rb +11 -4
  10. data/deliver/lib/deliver/upload_metadata.rb +37 -14
  11. data/deliver/lib/deliver/upload_screenshots.rb +19 -6
  12. data/fastlane/lib/fastlane/actions/slather.rb +7 -0
  13. data/fastlane/lib/fastlane/version.rb +1 -1
  14. data/fastlane/swift/Deliverfile.swift +1 -1
  15. data/fastlane/swift/DeliverfileProtocol.swift +6 -6
  16. data/fastlane/swift/Fastlane.swift +21 -15
  17. data/fastlane/swift/Gymfile.swift +1 -1
  18. data/fastlane/swift/Matchfile.swift +1 -1
  19. data/fastlane/swift/Precheckfile.swift +1 -1
  20. data/fastlane/swift/Scanfile.swift +1 -1
  21. data/fastlane/swift/Screengrabfile.swift +1 -1
  22. data/fastlane/swift/Snapshotfile.swift +1 -1
  23. data/fastlane/swift/SocketClient.swift +2 -1
  24. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +0 -1
  25. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +1 -1
  26. data/{fastlane/lib/fastlane/actions/.hockey.rb.swp → frameit/lib/frameit/.editor.rb.swp} +0 -0
  27. data/spaceship/lib/spaceship/{connect_api/.DS_Store → .DS_Store} +0 -0
  28. data/spaceship/lib/spaceship/connect_api.rb +2 -1
  29. data/{fastlane/lib/fastlane/actions/.slack.rb.swp → spaceship/lib/spaceship/connect_api/.file_uploader.rb.swp} +0 -0
  30. data/spaceship/lib/spaceship/connect_api/models/.app_screenshot.rb.swp +0 -0
  31. data/spaceship/lib/spaceship/connect_api/models/app.rb +22 -2
  32. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +29 -2
  33. data/spaceship/lib/spaceship/connect_api/models/app_preview.rb +3 -2
  34. data/spaceship/lib/spaceship/connect_api/models/app_preview_set.rb +31 -2
  35. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +30 -2
  36. data/spaceship/lib/spaceship/connect_api/models/{app_review_attachment.rb → app_store_review_attachment.rb} +6 -6
  37. data/spaceship/lib/spaceship/connect_api/models/app_store_review_detail.rb +7 -8
  38. data/spaceship/lib/spaceship/connect_api/models/app_store_version.rb +21 -3
  39. data/spaceship/lib/spaceship/connect_api/models/sandbox_tester.rb +64 -0
  40. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +74 -14
  41. metadata +41 -37
  42. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
@@ -16,6 +16,7 @@ module Fastlane
16
16
  cobertura_xml: '--cobertura-xml',
17
17
  sonarqube_xml: '--sonarqube-xml',
18
18
  llvm_cov: '--llvm-cov',
19
+ json: '--json',
19
20
  html: '--html',
20
21
  show: '--show',
21
22
 
@@ -225,6 +226,12 @@ module Fastlane
225
226
  description: "Tell slather that it should output results as llvm-cov show format",
226
227
  is_string: false,
227
228
  optional: true),
229
+ FastlaneCore::ConfigItem.new(key: :json,
230
+ env_name: "FL_SLATHER_JSON_ENABLED",
231
+ description: "Tell slather that it should output results as static JSON report",
232
+ is_string: false,
233
+ type: Boolean,
234
+ optional: true),
228
235
  FastlaneCore::ConfigItem.new(key: :html,
229
236
  env_name: "FL_SLATHER_HTML_ENABLED",
230
237
  description: "Tell slather that it should output results as static HTML pages",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
- VERSION = '2.150.0.rc5'.freeze
2
+ VERSION = '2.150.2'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  MINIMUM_XCODE_RELEASE = "7.0".freeze
5
5
  RUBOCOP_REQUIREMENT = '0.49.1'.freeze
@@ -18,4 +18,4 @@ class Deliverfile: DeliverfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -76,7 +76,7 @@ protocol DeliverfileProtocol: class {
76
76
  var appRatingConfigPath: String? { get }
77
77
 
78
78
  /// Extra information for the submission (e.g. compliance specifications, IDFA settings)
79
- var submissionInformation: String? { get }
79
+ var submissionInformation: [String : Any]? { get }
80
80
 
81
81
  /// The ID of your App Store Connect team if you're in multiple teams
82
82
  var teamId: String? { get }
@@ -99,13 +99,13 @@ protocol DeliverfileProtocol: class {
99
99
  /// The default precheck rule level unless otherwise configured
100
100
  var precheckDefaultRuleLevel: String { get }
101
101
 
102
- /// An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
102
+ /// **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
103
103
  var individualMetadataItems: [String] { get }
104
104
 
105
- /// Metadata: The path to the app icon
105
+ /// **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the app icon
106
106
  var appIcon: String? { get }
107
107
 
108
- /// Metadata: The path to the Apple Watch app icon
108
+ /// **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the Apple Watch app icon
109
109
  var appleWatchAppIcon: String? { get }
110
110
 
111
111
  /// Metadata: The copyright notice
@@ -207,7 +207,7 @@ extension DeliverfileProtocol {
207
207
  var resetRatings: Bool { return false }
208
208
  var priceTier: String? { return nil }
209
209
  var appRatingConfigPath: String? { return nil }
210
- var submissionInformation: String? { return nil }
210
+ var submissionInformation: [String : Any]? { return nil }
211
211
  var teamId: String? { return nil }
212
212
  var teamName: String? { return nil }
213
213
  var devPortalTeamId: String? { return nil }
@@ -246,4 +246,4 @@ extension DeliverfileProtocol {
246
246
 
247
247
  // Please don't remove the lines below
248
248
  // They are used to detect outdated files
249
- // FastlaneRunnerAPIVersion [0.9.19]
249
+ // FastlaneRunnerAPIVersion [0.9.20]
@@ -455,9 +455,9 @@ func appledoc(input: Any,
455
455
  - itcProvider: The provider short name to be used with the iTMSTransporter to identify your team. This value will override the automatically detected provider short name. To get provider short name run `pathToXcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter -m provider -u 'USERNAME' -p 'PASSWORD' -account_type itunes_connect -v off`. The short names of providers should be listed in the second column
456
456
  - runPrecheckBeforeSubmit: Run precheck before submitting to app review
457
457
  - precheckDefaultRuleLevel: The default precheck rule level unless otherwise configured
458
- - individualMetadataItems: An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
459
- - appIcon: Metadata: The path to the app icon
460
- - appleWatchAppIcon: Metadata: The path to the Apple Watch app icon
458
+ - individualMetadataItems: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
459
+ - appIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the app icon
460
+ - appleWatchAppIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the Apple Watch app icon
461
461
  - copyright: Metadata: The copyright notice
462
462
  - primaryCategory: Metadata: The english name of the primary category (e.g. `Business`, `Books`)
463
463
  - secondaryCategory: Metadata: The english name of the secondary category (e.g. `Business`, `Books`)
@@ -515,7 +515,7 @@ func appstore(username: String,
515
515
  resetRatings: Bool = false,
516
516
  priceTier: Any? = nil,
517
517
  appRatingConfigPath: String? = nil,
518
- submissionInformation: Any? = nil,
518
+ submissionInformation: [String : Any]? = nil,
519
519
  teamId: Any? = nil,
520
520
  teamName: String? = nil,
521
521
  devPortalTeamId: String? = nil,
@@ -2248,7 +2248,7 @@ func createAppOnManagedPlayStore(jsonKey: String? = nil,
2248
2248
  - sku: SKU Number (e.g. '1234')
2249
2249
  - platform: The platform to use (optional)
2250
2250
  - platforms: The platforms to use (optional)
2251
- - language: Primary Language (e.g. 'English', 'German')
2251
+ - language: Primary Language (e.g. 'en-US', 'fr-FR')
2252
2252
  - companyName: The name of your company. Only required if it's the first app you create
2253
2253
  - skipItc: Skip the creation of the app on App Store Connect
2254
2254
  - itcUsers: Array of App Store Connect users. If provided, you can limit access to this newly created app for users with the App Manager, Developer, Marketer or Sales roles
@@ -2505,9 +2505,9 @@ func deleteKeychain(name: String? = nil,
2505
2505
  - itcProvider: The provider short name to be used with the iTMSTransporter to identify your team. This value will override the automatically detected provider short name. To get provider short name run `pathToXcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter -m provider -u 'USERNAME' -p 'PASSWORD' -account_type itunes_connect -v off`. The short names of providers should be listed in the second column
2506
2506
  - runPrecheckBeforeSubmit: Run precheck before submitting to app review
2507
2507
  - precheckDefaultRuleLevel: The default precheck rule level unless otherwise configured
2508
- - individualMetadataItems: An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
2509
- - appIcon: Metadata: The path to the app icon
2510
- - appleWatchAppIcon: Metadata: The path to the Apple Watch app icon
2508
+ - individualMetadataItems: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
2509
+ - appIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the app icon
2510
+ - appleWatchAppIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the Apple Watch app icon
2511
2511
  - copyright: Metadata: The copyright notice
2512
2512
  - primaryCategory: Metadata: The english name of the primary category (e.g. `Business`, `Books`)
2513
2513
  - secondaryCategory: Metadata: The english name of the secondary category (e.g. `Business`, `Books`)
@@ -2565,7 +2565,7 @@ func deliver(username: Any = deliverfile.username,
2565
2565
  resetRatings: Bool = deliverfile.resetRatings,
2566
2566
  priceTier: Any? = deliverfile.priceTier,
2567
2567
  appRatingConfigPath: Any? = deliverfile.appRatingConfigPath,
2568
- submissionInformation: Any? = deliverfile.submissionInformation,
2568
+ submissionInformation: [String : Any]? = deliverfile.submissionInformation,
2569
2569
  teamId: Any? = deliverfile.teamId,
2570
2570
  teamName: Any? = deliverfile.teamName,
2571
2571
  devPortalTeamId: Any? = deliverfile.devPortalTeamId,
@@ -5343,7 +5343,7 @@ func println(message: String? = nil) {
5343
5343
  - sku: SKU Number (e.g. '1234')
5344
5344
  - platform: The platform to use (optional)
5345
5345
  - platforms: The platforms to use (optional)
5346
- - language: Primary Language (e.g. 'English', 'German')
5346
+ - language: Primary Language (e.g. 'en-US', 'fr-FR')
5347
5347
  - companyName: The name of your company. Only required if it's the first app you create
5348
5348
  - skipItc: Skip the creation of the app on App Store Connect
5349
5349
  - itcUsers: Array of App Store Connect users. If provided, you can limit access to this newly created app for users with the App Manager, Developer, Marketer or Sales roles
@@ -6757,6 +6757,7 @@ func slackTrainStart(distance: Int = 5,
6757
6757
  - coberturaXml: Tell slather that it should output results as Cobertura XML format
6758
6758
  - sonarqubeXml: Tell slather that it should output results as SonarQube Generic XML format
6759
6759
  - llvmCov: Tell slather that it should output results as llvm-cov show format
6760
+ - json: Tell slather that it should output results as static JSON report
6760
6761
  - html: Tell slather that it should output results as static HTML pages
6761
6762
  - show: Tell slather that it should open static html pages automatically
6762
6763
  - sourceDirectory: Tell slather the location of your source files
@@ -6791,6 +6792,7 @@ func slather(buildDirectory: String? = nil,
6791
6792
  coberturaXml: Bool? = nil,
6792
6793
  sonarqubeXml: Bool? = nil,
6793
6794
  llvmCov: Any? = nil,
6795
+ json: Bool? = nil,
6794
6796
  html: Bool? = nil,
6795
6797
  show: Bool = false,
6796
6798
  sourceDirectory: String? = nil,
@@ -6821,6 +6823,7 @@ func slather(buildDirectory: String? = nil,
6821
6823
  RubyCommand.Argument(name: "cobertura_xml", value: coberturaXml),
6822
6824
  RubyCommand.Argument(name: "sonarqube_xml", value: sonarqubeXml),
6823
6825
  RubyCommand.Argument(name: "llvm_cov", value: llvmCov),
6826
+ RubyCommand.Argument(name: "json", value: json),
6824
6827
  RubyCommand.Argument(name: "html", value: html),
6825
6828
  RubyCommand.Argument(name: "show", value: show),
6826
6829
  RubyCommand.Argument(name: "source_directory", value: sourceDirectory),
@@ -7097,6 +7100,7 @@ func splunkmint(dsym: String? = nil,
7097
7100
  - packagePath: Change working directory before any other operation
7098
7101
  - xcconfig: Use xcconfig file to override swift package generate-xcodeproj defaults
7099
7102
  - configuration: Build with configuration (debug|release) [default: debug]
7103
+ - disableSandbox: Disable using the sandbox when executing subprocesses
7100
7104
  - xcprettyOutput: Specifies the output type for xcpretty. eg. 'test', or 'simple'
7101
7105
  - xcprettyArgs: Pass in xcpretty additional command line arguments (e.g. '--test --no-color' or '--tap --no-utf'), requires xcpretty_output to be specified also
7102
7106
  - verbose: Increase verbosity of informational output
@@ -7106,6 +7110,7 @@ func spm(command: String = "build",
7106
7110
  packagePath: String? = nil,
7107
7111
  xcconfig: String? = nil,
7108
7112
  configuration: String? = nil,
7113
+ disableSandbox: Bool = false,
7109
7114
  xcprettyOutput: String? = nil,
7110
7115
  xcprettyArgs: String? = nil,
7111
7116
  verbose: Bool = false) {
@@ -7114,6 +7119,7 @@ func spm(command: String = "build",
7114
7119
  RubyCommand.Argument(name: "package_path", value: packagePath),
7115
7120
  RubyCommand.Argument(name: "xcconfig", value: xcconfig),
7116
7121
  RubyCommand.Argument(name: "configuration", value: configuration),
7122
+ RubyCommand.Argument(name: "disable_sandbox", value: disableSandbox),
7117
7123
  RubyCommand.Argument(name: "xcpretty_output", value: xcprettyOutput),
7118
7124
  RubyCommand.Argument(name: "xcpretty_args", value: xcprettyArgs),
7119
7125
  RubyCommand.Argument(name: "verbose", value: verbose)])
@@ -8099,9 +8105,9 @@ func uploadSymbolsToSentry(apiHost: String = "https://app.getsentry.com/api/0",
8099
8105
  - itcProvider: The provider short name to be used with the iTMSTransporter to identify your team. This value will override the automatically detected provider short name. To get provider short name run `pathToXcode.app/Contents/Applications/Application\ Loader.app/Contents/itms/bin/iTMSTransporter -m provider -u 'USERNAME' -p 'PASSWORD' -account_type itunes_connect -v off`. The short names of providers should be listed in the second column
8100
8106
  - runPrecheckBeforeSubmit: Run precheck before submitting to app review
8101
8107
  - precheckDefaultRuleLevel: The default precheck rule level unless otherwise configured
8102
- - individualMetadataItems: An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
8103
- - appIcon: Metadata: The path to the app icon
8104
- - appleWatchAppIcon: Metadata: The path to the Apple Watch app icon
8108
+ - individualMetadataItems: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - An array of localized metadata items to upload individually by language so that errors can be identified. E.g. ['name', 'keywords', 'description']. Note: slow
8109
+ - appIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the app icon
8110
+ - appleWatchAppIcon: **DEPRECATED!** Removed after the migration to the new App Store Connect API in June 2020 - Metadata: The path to the Apple Watch app icon
8105
8111
  - copyright: Metadata: The copyright notice
8106
8112
  - primaryCategory: Metadata: The english name of the primary category (e.g. `Business`, `Books`)
8107
8113
  - secondaryCategory: Metadata: The english name of the secondary category (e.g. `Business`, `Books`)
@@ -8159,7 +8165,7 @@ func uploadToAppStore(username: String,
8159
8165
  resetRatings: Bool = false,
8160
8166
  priceTier: Any? = nil,
8161
8167
  appRatingConfigPath: String? = nil,
8162
- submissionInformation: Any? = nil,
8168
+ submissionInformation: [String : Any]? = nil,
8163
8169
  teamId: Any? = nil,
8164
8170
  teamName: String? = nil,
8165
8171
  devPortalTeamId: String? = nil,
@@ -8960,4 +8966,4 @@ let snapshotfile: Snapshotfile = Snapshotfile()
8960
8966
 
8961
8967
  // Please don't remove the lines below
8962
8968
  // They are used to detect outdated files
8963
- // FastlaneRunnerAPIVersion [0.9.71]
8969
+ // FastlaneRunnerAPIVersion [0.9.73]
@@ -18,4 +18,4 @@ class Gymfile: GymfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -18,4 +18,4 @@ class Matchfile: MatchfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -18,4 +18,4 @@ class Precheckfile: PrecheckfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -18,4 +18,4 @@ class Scanfile: ScanfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -18,4 +18,4 @@ class Screengrabfile: ScreengrabfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -18,4 +18,4 @@ class Snapshotfile: SnapshotfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.149.1
21
+ // Generated with fastlane 2.150.2
@@ -34,7 +34,7 @@ class SocketClient: NSObject {
34
34
  }
35
35
 
36
36
  static let connectTimeoutSeconds = 2
37
- static let defaultCommandTimeoutSeconds = 3_600 // Hopefully 1 hr is enough ¯\_(ツ)_/¯
37
+ static let defaultCommandTimeoutSeconds = 10_800 // 3 hours
38
38
  static let doneToken = "done" // TODO: remove these
39
39
  static let cancelToken = "cancelFastlaneRun"
40
40
 
@@ -118,6 +118,7 @@ class SocketClient: NSObject {
118
118
  public func send(rubyCommand: RubyCommandable) {
119
119
  verbose(message: "sending: \(rubyCommand.json)")
120
120
  send(string: rubyCommand.json)
121
+ writeSemaphore.signal()
121
122
  }
122
123
 
123
124
  public func sendComplete() {
@@ -37,7 +37,6 @@ module FastlaneCore
37
37
 
38
38
  def self.fetch_info_plist_file(path)
39
39
  UI.user_error!("Could not find file at path '#{path}'") unless File.exist?(path)
40
- Zip.validate_entry_sizes = true # https://github.com/rubyzip/rubyzip/releases/tag/v2.0.0
41
40
  Zip::File.open(path, "rb") do |zipfile|
42
41
  file = zipfile.glob('**/Payload/*.app/Info.plist').first
43
42
  return nil unless file
@@ -113,7 +113,7 @@ module FastlaneCore
113
113
  else
114
114
  # `security` only works on Mac, fallback to `openssl`
115
115
  # via https://stackoverflow.com/a/14379814/252627
116
- decoded = `openssl smime -inform der -verify -noverify -in #{path} 2> #{err}`
116
+ decoded = `openssl smime -inform der -verify -noverify -in #{path.shellescape} 2> #{err}`
117
117
  end
118
118
  UI.error("Failure to decode #{path}. Exit: #{$?.exitstatus}: #{File.read(err)}") if $?.exitstatus != 0
119
119
  decoded
@@ -40,7 +40,7 @@ require 'spaceship/connect_api/models/app_preview_set'
40
40
  require 'spaceship/connect_api/models/app_preview'
41
41
  require 'spaceship/connect_api/models/app_price'
42
42
  require 'spaceship/connect_api/models/app_price_tier'
43
- require 'spaceship/connect_api/models/app_review_attachment'
43
+ require 'spaceship/connect_api/models/app_store_review_attachment'
44
44
  require 'spaceship/connect_api/models/app_store_review_detail'
45
45
  require 'spaceship/connect_api/models/app_store_version_submission'
46
46
  require 'spaceship/connect_api/models/app_screenshot_set'
@@ -50,6 +50,7 @@ require 'spaceship/connect_api/models/app_store_version_phased_release'
50
50
  require 'spaceship/connect_api/models/app_store_version'
51
51
  require 'spaceship/connect_api/models/idfa_declaration'
52
52
  require 'spaceship/connect_api/models/reset_ratings_request'
53
+ require 'spaceship/connect_api/models/sandbox_tester'
53
54
  require 'spaceship/connect_api/models/territory'
54
55
 
55
56
  module Spaceship
@@ -78,7 +78,7 @@ module Spaceship
78
78
  # App Info
79
79
  #
80
80
 
81
- def fetch_edit_app_info
81
+ def fetch_edit_app_info(includes: Spaceship::ConnectAPI::AppInfo::ESSENTIAL_INCLUDES)
82
82
  states = [
83
83
  Spaceship::ConnectAPI::AppInfo::AppStoreState::PREPARE_FOR_SUBMISSION,
84
84
  Spaceship::ConnectAPI::AppInfo::AppStoreState::DEVELOPER_REJECTED,
@@ -89,7 +89,7 @@ module Spaceship
89
89
  ]
90
90
 
91
91
  filter = { app: id }
92
- resp = Spaceship::ConnectAPI.get_app_infos(filter: filter)
92
+ resp = Spaceship::ConnectAPI.get_app_infos(filter: filter, includes: includes)
93
93
  return resp.to_models.select do |model|
94
94
  states.include?(model.app_store_state)
95
95
  end.first
@@ -110,6 +110,26 @@ module Spaceship
110
110
  # App Store Versions
111
111
  #
112
112
 
113
+ def reject_version_if_possible!(platform: nil)
114
+ platform ||= Spaceship::ConnectAPI::Platform::IOS
115
+ filter = {
116
+ appStoreState: [
117
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::PENDING_DEVELOPER_RELEASE,
118
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::IN_REVIEW,
119
+ Spaceship::ConnectAPI::AppStoreVersion::AppStoreState::WAITING_FOR_REVIEW
120
+ ].join(","),
121
+ platform: platform
122
+ }
123
+
124
+ # Get the latest version
125
+ version = get_app_store_versions(filter: filter, includes: "appStoreVersionSubmission")
126
+ .sort_by { |v| Gem::Version.new(v.version_string) }
127
+ .last
128
+
129
+ return false if version.nil?
130
+ return version.reject!
131
+ end
132
+
113
133
  # Will make sure the current edit_version matches the given version number
114
134
  # This will either create a new version or change the version number
115
135
  # from an existing version
@@ -9,8 +9,18 @@ module Spaceship
9
9
  attr_accessor :brazil_age_rating
10
10
  attr_accessor :kids_age_band
11
11
 
12
+ attr_accessor :primary_category
13
+ attr_accessor :primary_subcategory_one
14
+ attr_accessor :primary_subcategory_two
15
+ attr_accessor :secondary_category
16
+ attr_accessor :secondary_subcategory_one
17
+ attr_accessor :secondary_subcategory_two
18
+
12
19
  module AppStoreState
13
20
  READY_FOR_SALE = "READY_FOR_SALE"
21
+ PROCESSING_FOR_APP_STORE = "PROCESSING_FOR_APP_STORE"
22
+ PENDING_DEVELOPER_RELEASE = "PENDING_DEVELOPER_RELEASE"
23
+ IN_REVIEW = "IN_REVIEW"
14
24
  WAITING_FOR_REVIEW = "WAITING_FOR_REVIEW"
15
25
  DEVELOPER_REJECTED = "DEVELOPER_REJECTED"
16
26
  REJECTED = "REJECTED"
@@ -27,9 +37,25 @@ module Spaceship
27
37
  "appStoreState" => "app_store_state",
28
38
  "appStoreAgeRating" => "app_store_age_rating",
29
39
  "brazilAgeRating" => "brazil_age_rating",
30
- "kidsAgeBand" => "kids_age_band"
40
+ "kidsAgeBand" => "kids_age_band",
41
+
42
+ "primaryCategory" => "primary_category",
43
+ "primarySubcategoryOne" => "primary_subcategory_one",
44
+ "primarySubcategoryTwo" => "primary_subcategory_two",
45
+ "secondaryCategory" => "secondary_category",
46
+ "secondarySubcategoryOne" => "secondary_subcategory_one",
47
+ "secondarySubcategoryTwo" => "secondary_subcategory_two"
31
48
  })
32
49
 
50
+ ESSENTIAL_INCLUDES = [
51
+ "primaryCategory",
52
+ "primarySubcategoryOne",
53
+ "primarySubcategoryTwo",
54
+ "secondaryCategory",
55
+ "secondarySubcategoryOne",
56
+ "secondarySubcategoryTwo"
57
+ ].join(",")
58
+
33
59
  def self.type
34
60
  return "appInfos"
35
61
  end
@@ -60,7 +86,8 @@ module Spaceship
60
86
  end
61
87
 
62
88
  def get_app_info_localizations(filter: {}, includes: nil, limit: nil, sort: nil)
63
- return Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
89
+ resp = Spaceship::ConnectAPI.get_app_info_localizations(app_info_id: id, filter: filter, includes: includes, limit: limit, sort: sort)
90
+ return resp.to_models
64
91
  end
65
92
  end
66
93
  end
@@ -54,7 +54,7 @@ module Spaceship
54
54
  # @param app_preview_set_id The AppPreviewSet id
55
55
  # @param path The path of the file
56
56
  # @param frame_time_code The time code for the preview still frame (ex: "00:00:07:01")
57
- def self.create(app_preview_set_id: nil, path: nil, frame_time_code: nil)
57
+ def self.create(app_preview_set_id: nil, path: nil, wait_for_processing: true, frame_time_code: nil)
58
58
  require 'faraday'
59
59
 
60
60
  filename = File.basename(path)
@@ -95,7 +95,8 @@ module Spaceship
95
95
  end
96
96
 
97
97
  # Poll for video processing completion to set still frame time
98
- unless frame_time_code.nil?
98
+ wait_for_processing = true unless frame_time_code.nil?
99
+ if wait_for_processing
99
100
  loop do
100
101
  unless preview.video_url.nil?
101
102
  puts("Preview processing complete!") if Spaceship::Globals.verbose?
@@ -63,8 +63,37 @@ module Spaceship
63
63
  return resp.to_models
64
64
  end
65
65
 
66
- def upload_preview(path: nil, frame_time_code: nil)
67
- return Spaceship::ConnectAPI::AppPreview.create(app_preview_set_id: id, path: path, frame_time_code: frame_time_code)
66
+ def self.get(app_preview_set_id: nil, includes: "appPreviews")
67
+ return Spaceship::ConnectAPI.get_app_preview_set(app_preview_set_id: app_preview_set_id, filter: nil, includes: includes, limit: nil, sort: nil).first
68
+ end
69
+
70
+ def upload_preview(path: nil, wait_for_processing: true, position: nil, frame_time_code: nil)
71
+ # Upload preview
72
+ preview = Spaceship::ConnectAPI::AppPreview.create(app_preview_set_id: id, path: path, wait_for_processing: wait_for_processing, frame_time_code: frame_time_code)
73
+
74
+ # Reposition (if specified)
75
+ unless position.nil?
76
+ # Get all app preview ids
77
+ set = AppPreviewSet.get(app_preview_set_id: id)
78
+ app_preview_ids = set.app_previews.map(&:id)
79
+
80
+ # Remove new uploaded preview
81
+ app_preview_ids.delete(preview.id)
82
+
83
+ # Insert preview at specified position
84
+ app_preview_ids = app_preview_ids.insert(position, preview.id).compact
85
+
86
+ # Reorder previews
87
+ reorder_previews(app_preview_ids: app_preview_ids)
88
+ end
89
+
90
+ return preview
91
+ end
92
+
93
+ def reorder_previews(app_preview_ids: nil)
94
+ Spaceship::ConnectAPI.patch_app_preview_set_previews(app_preview_set_id: id, app_preview_ids: app_preview_ids)
95
+
96
+ return Spaceship::ConnectAPI.get_app_preview_set(app_preview_set_id: id, includes: "appPreviews").first
68
97
  end
69
98
  end
70
99
  end