fastlane 2.150.0.rc4 → 2.150.1

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 +76 -76
  3. data/deliver/lib/deliver/download_screenshots.rb +48 -26
  4. data/deliver/lib/deliver/runner.rb +4 -1
  5. data/deliver/lib/deliver/submit_for_review.rb +26 -7
  6. data/deliver/lib/deliver/upload_metadata.rb +33 -14
  7. data/deliver/lib/deliver/upload_screenshots.rb +24 -5
  8. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  9. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  10. data/fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp +0 -0
  11. data/fastlane/lib/fastlane/actions/docs/upload_to_app_store.md.erb +4 -0
  12. data/fastlane/lib/fastlane/version.rb +1 -1
  13. data/fastlane/swift/Deliverfile.swift +1 -1
  14. data/fastlane/swift/DeliverfileProtocol.swift +6 -6
  15. data/fastlane/swift/Fastlane.swift +22 -19
  16. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  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/build_watcher.rb +4 -4
  25. data/fastlane_core/lib/fastlane_core/ipa_file_analyser.rb +0 -1
  26. data/fastlane_core/lib/fastlane_core/provisioning_profile.rb +1 -1
  27. data/pilot/lib/pilot/.manager.rb.swp +0 -0
  28. data/produce/lib/produce/itunes_connect.rb +29 -2
  29. data/spaceship/lib/spaceship/connect_api.rb +1 -1
  30. data/spaceship/lib/spaceship/{.DS_Store → connect_api/.DS_Store} +0 -0
  31. data/spaceship/lib/spaceship/connect_api/client.rb +1 -1
  32. data/spaceship/lib/spaceship/connect_api/models/app.rb +38 -3
  33. data/spaceship/lib/spaceship/connect_api/models/app_info.rb +5 -1
  34. data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +54 -1
  35. data/spaceship/lib/spaceship/connect_api/models/app_screenshot_set.rb +32 -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/user.rb +2 -1
  40. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +38 -20
  41. data/spaceship/lib/spaceship/connect_api/users/users.rb +13 -0
  42. metadata +36 -31
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f736bd9272a03db4f9c52dcb3f3cbe1cc21b3f78221a8a27849a0801ad791177
4
- data.tar.gz: 61ea559625a0a4fd290774205aecfec2754b7f7a6f4264a3775b51145fd6169e
3
+ metadata.gz: 8d3237fc06a48b208196d7032e411bd13b963d7c26ddddbf0202e48f53fbd5c8
4
+ data.tar.gz: db3869ebbf2d643634ef331898b3432b431fb01da909d3dac694d79cc0b4724d
5
5
  SHA512:
6
- metadata.gz: 769baf252715d93327440d48a152c53bd5f532741f5d9118e04cc09433b1fcd654d0d68973d8c0376e979fda909f0264e6f9e61e9dd66d4d9dacc5027f4ba87b
7
- data.tar.gz: 3ee6471846ffcdd74dc4e953822aed04fd05caf5ad03ee1f242d486a3197c66168fda158b9b417831b3221e8782b039bda4d59016653be9416c977691d24effb
6
+ metadata.gz: 7f17b8ef0ec7d70e3600ce0d3d9080083c16f347db7dd5d04b21a8c80552bc96ab07358f08a1e4369fb37e348bcef09ffdef5415c715128fe0b7b89d1cbb2b5a
7
+ data.tar.gz: 30f46c293961f91d1d0ab85cfb6d06cf783b25c13e0ea307059013f20a906c349bbcda19e3e445ad20cfe0576d2c750f54ffef791f3c0c8c7a206ed23929134c
data/README.md CHANGED
@@ -34,11 +34,17 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
34
34
  <!-- This table is regenerated and resorted on each release -->
35
35
  <table id='team'>
36
36
  <tr>
37
- <td id='iulian-onofrei'>
38
- <a href='https://github.com/revolter'>
39
- <img src='https://github.com/revolter.png?size=140'>
37
+ <td id='maksym-grebenets'>
38
+ <a href='https://github.com/mgrebenets'>
39
+ <img src='https://github.com/mgrebenets.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
42
+ </td>
43
+ <td id='jérôme-lacoste'>
44
+ <a href='https://github.com/lacostej'>
45
+ <img src='https://github.com/lacostej.png?size=140'>
46
+ </a>
47
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
42
48
  </td>
43
49
  <td id='stefan-natchev'>
44
50
  <a href='https://github.com/snatchev'>
@@ -46,11 +52,11 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
46
52
  </a>
47
53
  <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
48
54
  </td>
49
- <td id='joshua-liebowitz'>
50
- <a href='https://github.com/taquitos'>
51
- <img src='https://github.com/taquitos.png?size=140'>
55
+ <td id='max-ott'>
56
+ <a href='https://github.com/max-ott'>
57
+ <img src='https://github.com/max-ott.png?size=140'>
52
58
  </a>
53
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
59
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
54
60
  </td>
55
61
  <td id='helmut-januschka'>
56
62
  <a href='https://github.com/hjanuschka'>
@@ -58,19 +64,19 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
58
64
  </a>
59
65
  <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
60
66
  </td>
61
- <td id='jorge-revuelta-h'>
62
- <a href='https://github.com/minuscorp'>
63
- <img src='https://github.com/minuscorp.png?size=140'>
64
- </a>
65
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
66
- </td>
67
67
  </tr>
68
68
  <tr>
69
- <td id='luka-mirosevic'>
70
- <a href='https://github.com/lmirosevic'>
71
- <img src='https://github.com/lmirosevic.png?size=140'>
69
+ <td id='kohki-miki'>
70
+ <a href='https://github.com/giginet'>
71
+ <img src='https://github.com/giginet.png?size=140'>
72
72
  </a>
73
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
73
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
74
+ </td>
75
+ <td id='matthew-ellis'>
76
+ <a href='https://github.com/matthewellis'>
77
+ <img src='https://github.com/matthewellis.png?size=140'>
78
+ </a>
79
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
74
80
  </td>
75
81
  <td id='danielle-tomlinson'>
76
82
  <a href='https://github.com/endocrimes'>
@@ -78,37 +84,37 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
78
84
  </a>
79
85
  <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
80
86
  </td>
81
- <td id='jan-piotrowski'>
82
- <a href='https://github.com/janpio'>
83
- <img src='https://github.com/janpio.png?size=140'>
87
+ <td id='andrew-mcburney'>
88
+ <a href='https://github.com/armcburney'>
89
+ <img src='https://github.com/armcburney.png?size=140'>
84
90
  </a>
85
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
86
92
  </td>
93
+ <td id='fumiya-nakamura'>
94
+ <a href='https://github.com/nafu'>
95
+ <img src='https://github.com/nafu.png?size=140'>
96
+ </a>
97
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
98
+ </td>
99
+ </tr>
100
+ <tr>
87
101
  <td id='aaron-brager'>
88
102
  <a href='https://github.com/getaaron'>
89
103
  <img src='https://github.com/getaaron.png?size=140'>
90
104
  </a>
91
105
  <h4 align='center'><a href='https://twitter.com/getaaron'>Aaron Brager</a></h4>
92
106
  </td>
93
- <td id='olivier-halligon'>
94
- <a href='https://github.com/AliSoftware'>
95
- <img src='https://github.com/AliSoftware.png?size=140'>
96
- </a>
97
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
98
- </td>
99
- </tr>
100
- <tr>
101
- <td id='jimmy-dee'>
102
- <a href='https://github.com/jdee'>
103
- <img src='https://github.com/jdee.png?size=140'>
107
+ <td id='manu-wallner'>
108
+ <a href='https://github.com/milch'>
109
+ <img src='https://github.com/milch.png?size=140'>
104
110
  </a>
105
- <h4 align='center'>Jimmy Dee</h4>
111
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
106
112
  </td>
107
- <td id='daniel-jankowski'>
108
- <a href='https://github.com/mollyIV'>
109
- <img src='https://github.com/mollyIV.png?size=140'>
113
+ <td id='jorge-revuelta-h'>
114
+ <a href='https://github.com/minuscorp'>
115
+ <img src='https://github.com/minuscorp.png?size=140'>
110
116
  </a>
111
- <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
112
118
  </td>
113
119
  <td id='felix-krause'>
114
120
  <a href='https://github.com/KrauseFx'>
@@ -116,63 +122,57 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
116
122
  </a>
117
123
  <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
118
124
  </td>
119
- <td id='matthew-ellis'>
120
- <a href='https://github.com/matthewellis'>
121
- <img src='https://github.com/matthewellis.png?size=140'>
122
- </a>
123
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
124
- </td>
125
- <td id='manu-wallner'>
126
- <a href='https://github.com/milch'>
127
- <img src='https://github.com/milch.png?size=140'>
125
+ <td id='josh-holtz'>
126
+ <a href='https://github.com/joshdholtz'>
127
+ <img src='https://github.com/joshdholtz.png?size=140'>
128
128
  </a>
129
- <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
129
+ <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
130
130
  </td>
131
131
  </tr>
132
132
  <tr>
133
- <td id='andrew-mcburney'>
134
- <a href='https://github.com/armcburney'>
135
- <img src='https://github.com/armcburney.png?size=140'>
133
+ <td id='luka-mirosevic'>
134
+ <a href='https://github.com/lmirosevic'>
135
+ <img src='https://github.com/lmirosevic.png?size=140'>
136
136
  </a>
137
- <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
137
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
138
138
  </td>
139
- <td id='jérôme-lacoste'>
140
- <a href='https://github.com/lacostej'>
141
- <img src='https://github.com/lacostej.png?size=140'>
139
+ <td id='iulian-onofrei'>
140
+ <a href='https://github.com/revolter'>
141
+ <img src='https://github.com/revolter.png?size=140'>
142
142
  </a>
143
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
143
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
144
144
  </td>
145
- <td id='max-ott'>
146
- <a href='https://github.com/max-ott'>
147
- <img src='https://github.com/max-ott.png?size=140'>
145
+ <td id='joshua-liebowitz'>
146
+ <a href='https://github.com/taquitos'>
147
+ <img src='https://github.com/taquitos.png?size=140'>
148
148
  </a>
149
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
149
+ <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
150
150
  </td>
151
- <td id='josh-holtz'>
152
- <a href='https://github.com/joshdholtz'>
153
- <img src='https://github.com/joshdholtz.png?size=140'>
151
+ <td id='jimmy-dee'>
152
+ <a href='https://github.com/jdee'>
153
+ <img src='https://github.com/jdee.png?size=140'>
154
154
  </a>
155
- <h4 align='center'><a href='https://twitter.com/joshdholtz'>Josh Holtz</a></h4>
155
+ <h4 align='center'>Jimmy Dee</h4>
156
156
  </td>
157
- <td id='fumiya-nakamura'>
158
- <a href='https://github.com/nafu'>
159
- <img src='https://github.com/nafu.png?size=140'>
157
+ <td id='jan-piotrowski'>
158
+ <a href='https://github.com/janpio'>
159
+ <img src='https://github.com/janpio.png?size=140'>
160
160
  </a>
161
- <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
161
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
162
162
  </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='maksym-grebenets'>
166
- <a href='https://github.com/mgrebenets'>
167
- <img src='https://github.com/mgrebenets.png?size=140'>
165
+ <td id='daniel-jankowski'>
166
+ <a href='https://github.com/mollyIV'>
167
+ <img src='https://github.com/mollyIV.png?size=140'>
168
168
  </a>
169
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
169
+ <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
170
170
  </td>
171
- <td id='kohki-miki'>
172
- <a href='https://github.com/giginet'>
173
- <img src='https://github.com/giginet.png?size=140'>
171
+ <td id='olivier-halligon'>
172
+ <a href='https://github.com/AliSoftware'>
173
+ <img src='https://github.com/AliSoftware.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -1,4 +1,5 @@
1
1
  require_relative 'module'
2
+ require 'spaceship'
2
3
  require 'open-uri'
3
4
 
4
5
  module Deliver
@@ -13,35 +14,56 @@ module Deliver
13
14
  end
14
15
 
15
16
  def self.download(options, folder_path)
16
- v = options[:use_live_version] ? options[:app].live_version(platform: options[:platform]) : options[:app].latest_version(platform: options[:platform])
17
-
18
- v.screenshots.each do |language, screenshots|
19
- screenshots.each do |screenshot|
20
- file_name = [screenshot.sort_order, screenshot.device_type, screenshot.sort_order].join("_")
21
- original_file_extension = File.basename(screenshot.original_file_name)
22
- file_name += "." + original_file_extension
23
-
24
- UI.message("Downloading existing screenshot '#{file_name}' for language '#{language}'")
25
-
26
- # If the screen shot is for an appleTV we need to store it in a way that we'll know it's an appleTV
27
- # screen shot later as the screen size is the same as an iPhone 6 Plus in landscape.
28
- if screenshot.device_type == "appleTV"
29
- containing_folder = File.join(folder_path, "appleTV", screenshot.language)
30
- else
31
- containing_folder = File.join(folder_path, screenshot.language)
32
- end
17
+ legacy_app = options[:app]
18
+ app_id = legacy_app.apple_id
19
+ app = Spaceship::ConnectAPI::App.get(app_id: app_id)
33
20
 
34
- if screenshot.is_imessage
35
- containing_folder = File.join(folder_path, "iMessage", screenshot.language)
36
- end
21
+ platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
22
+ if options[:use_live_version]
23
+ version = app.get_live_app_store_version(platform: platform)
24
+ UI.user_error!("Could not find a live version on App Store Connect. Try using '--use_live_version false'") if version.nil?
25
+ else
26
+ version = app.get_edit_app_store_version(platform: platform)
27
+ UI.user_error!("Could not find an edit version on App Store Connect. Try using '--use_live_version true'") if version.nil?
28
+ end
29
+
30
+ localizations = version.get_app_store_version_localizations
31
+ localizations.each do |localization|
32
+ screenshot_sets = localization.get_app_screenshot_sets
33
+ screenshot_sets.each do |screenshot_set|
34
+ screenshot_set.app_screenshots.each_with_index do |screenshot, index|
35
+ file_name = [index, screenshot_set.screenshot_display_type, index].join("_")
36
+ original_file_extension = File.extname(screenshot.file_name).strip.downcase[1..-1]
37
+ file_name += "." + original_file_extension
38
+
39
+ url = screenshot.image_asset_url(type: original_file_extension)
40
+ next if url.nil?
41
+
42
+ language = localization.locale
43
+
44
+ UI.message("Downloading existing screenshot '#{file_name}' for language '#{language}'")
45
+
46
+ # If the screen shot is for an appleTV we need to store it in a way that we'll know it's an appleTV
47
+ # screen shot later as the screen size is the same as an iPhone 6 Plus in landscape.
48
+ if screenshot_set.apple_tv?
49
+ containing_folder = File.join(folder_path, "appleTV", language)
50
+ else
51
+ containing_folder = File.join(folder_path, language)
52
+ end
53
+
54
+ if screenshot_set.imessage?
55
+ containing_folder = File.join(folder_path, "iMessage", language)
56
+ end
57
+
58
+ begin
59
+ FileUtils.mkdir_p(containing_folder)
60
+ rescue
61
+ # if it's already there
62
+ end
37
63
 
38
- begin
39
- FileUtils.mkdir_p(containing_folder)
40
- rescue
41
- # if it's already there
64
+ path = File.join(containing_folder, file_name)
65
+ File.binwrite(path, open(url).read)
42
66
  end
43
- path = File.join(containing_folder, file_name)
44
- File.binwrite(path, open(screenshot.url).read)
45
67
  end
46
68
  end
47
69
  end
@@ -159,7 +159,10 @@ module Deliver
159
159
  end
160
160
 
161
161
  def reject_version_if_possible
162
- app = options[:app]
162
+ legacy_app = options[:app]
163
+ app_id = legacy_app.apple_id
164
+ app = Spaceship::ConnectAPI::App.get(app_id: app_id)
165
+
163
166
  if app.reject_version_if_possible!
164
167
  UI.success("Successfully rejected previous version!")
165
168
  end
@@ -59,6 +59,8 @@ module Deliver
59
59
 
60
60
  def update_export_compliance(options, app, build)
61
61
  submission_information = options[:submission_information] || {}
62
+ submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
63
+
62
64
  uses_encryption = submission_information[:export_compliance_uses_encryption]
63
65
 
64
66
  if build.uses_non_exempt_encryption.nil?
@@ -70,6 +72,8 @@ module Deliver
70
72
  "Add information to the :submission_information option...",
71
73
  " Docs: http://docs.fastlane.tools/actions/deliver/#compliance-and-idfa-settings",
72
74
  " Example: submission_information: { export_compliance_uses_encryption: false }",
75
+ " Example CLI:",
76
+ " --submission_information \"{\\\"export_compliance_uses_encryption\\\": false}\"",
73
77
  "This can also be set in your Info.plist with key 'ITSAppUsesNonExemptEncryption'"
74
78
  ].join("\n")
75
79
  UI.user_error!(message)
@@ -85,6 +89,8 @@ module Deliver
85
89
 
86
90
  def update_idfa(options, app, version)
87
91
  submission_information = options[:submission_information] || {}
92
+ submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
93
+
88
94
  uses_idfa = submission_information[:add_id_info_uses_idfa]
89
95
 
90
96
  idfa_declaration = begin
@@ -93,14 +99,17 @@ module Deliver
93
99
  nil
94
100
  end
95
101
 
102
+ updated_idfa = false
103
+
96
104
  # Set IDFA on version
97
- UI.verbose("Updating app store version for IDFA status of '#{uses_idfa}'")
98
105
  unless uses_idfa.nil?
106
+ UI.verbose("Updating app store version for IDFA status of '#{uses_idfa}'")
99
107
  version = version.update(attributes: {
100
108
  usesIdfa: uses_idfa
101
109
  })
110
+ UI.verbose("Updated app store version for IDFA status of '#{version.uses_idfa}'")
111
+ updated_idfa = true
102
112
  end
103
- UI.verbose("Updated app store version for IDFA status of '#{version.uses_idfa}'")
104
113
 
105
114
  # Error if uses_idfa not set
106
115
  if version.uses_idfa.nil?
@@ -115,7 +124,9 @@ module Deliver
115
124
  " add_id_info_serves_ads: false,",
116
125
  " add_id_info_uses_idfa: false,",
117
126
  " add_id_info_tracks_install: false",
118
- " }"
127
+ " }",
128
+ " Example CLI:",
129
+ " --submission_information \"{\\\"add_id_info_uses_idfa\\\": false}\""
119
130
  ].join("\n")
120
131
  UI.user_error!(message)
121
132
  end
@@ -125,6 +136,7 @@ module Deliver
125
136
  if idfa_declaration
126
137
  UI.verbose("Deleting IDFA delcaration")
127
138
  idfa_declaration.delete!
139
+ updated_idfa = true
128
140
  UI.verbose("Deleted IDFA delcaration")
129
141
  end
130
142
  elsif uses_idfa == true
@@ -144,13 +156,16 @@ module Deliver
144
156
  version.create_idfa_declaration(attributes: attributes)
145
157
  UI.verbose("Created IDFA delcaration")
146
158
  end
159
+
160
+ updated_idfa = true
147
161
  end
148
162
 
149
- UI.success("Successfully updated IDFA delcarations on App Store Connect")
163
+ UI.success("Successfully updated IDFA delcarations on App Store Connect") if updated_idfa
150
164
  end
151
165
 
152
166
  def update_submission_information(options, app)
153
167
  submission_information = options[:submission_information] || {}
168
+ submission_information = submission_information.collect { |k, v| [k.to_sym, v] }.to_h
154
169
 
155
170
  content_rights = submission_information[:content_rights_contains_third_party_content]
156
171
 
@@ -171,6 +186,7 @@ module Deliver
171
186
 
172
187
  def wait_for_build_processing_to_be_complete(app: nil, platform: nil, options: nil)
173
188
  app_version = options[:app_version]
189
+
174
190
  app_version ||= FastlaneCore::IpaFileAnalyser.fetch_app_version(options[:ipa]) if options[:ipa]
175
191
  app_version ||= FastlaneCore::PkgFileAnalyser.fetch_app_version(options[:pkg]) if options[:pkg]
176
192
 
@@ -184,11 +200,14 @@ module Deliver
184
200
  build_version: app_build,
185
201
  poll_interval: 15,
186
202
  return_when_build_appears: false,
187
- return_spaceship_testflight_build: false
203
+ return_spaceship_testflight_build: false,
204
+ select_latest: true
188
205
  )
189
206
 
190
- unless latest_build.app_version == app_version && latest_build.version == app_build
191
- UI.important("Uploaded app #{app_version} - #{app_build}, but received build #{latest_build.app_version} - #{latest_build.version}.")
207
+ if !app_version.nil? && !app_build.nil?
208
+ unless latest_build.app_version == app_version && latest_build.version == app_build
209
+ UI.important("Uploaded app #{app_version} - #{app_build}, but received build #{latest_build.app_version} - #{latest_build.version}.")
210
+ end
192
211
  end
193
212
 
194
213
  return latest_build
@@ -80,8 +80,10 @@ module Deliver
80
80
 
81
81
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
82
82
 
83
- app_store_version_localizations = verify_available_version_languages!(options, app) unless options[:edit_live]
84
- app_info_localizations = verify_available_info_languages!(options, app) unless options[:edit_live]
83
+ enabled_languages = detect_languages(options)
84
+
85
+ app_store_version_localizations = verify_available_version_languages!(options, app, enabled_languages) unless options[:edit_live]
86
+ app_info_localizations = verify_available_info_languages!(options, app, enabled_languages) unless options[:edit_live]
85
87
 
86
88
  if options[:edit_live]
87
89
  # not all values are editable when using live_version
@@ -106,7 +108,9 @@ module Deliver
106
108
  end
107
109
 
108
110
  # Needed for to filter out release notes from being sent up
109
- is_first_version = app.get_live_app_store_version(platform: platform).nil?
111
+ number_of_versions = app.get_app_store_versions(filter: { platform: platform }, limit: 2).size
112
+ is_first_version = number_of_versions == 1
113
+ UI.verbose("Version '#{version.version_string}' is the first version on App Store Connect") if is_first_version
110
114
 
111
115
  UI.important("Will begin uploading metadata for '#{version.version_string}' on App Store Connect")
112
116
 
@@ -158,7 +162,11 @@ module Deliver
158
162
  end
159
163
 
160
164
  release_type = if options[:auto_release_date]
161
- non_localized_version_attributes['earliestReleaseDate'] = options[:auto_release_date]
165
+ # Convert time format to 2020-06-17T12:00:00-07:00
166
+ time_in_ms = options[:auto_release_date]
167
+ date = convert_ms_to_iso8601(time_in_ms)
168
+
169
+ non_localized_version_attributes['earliestReleaseDate'] = date
162
170
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::SCHEDULED
163
171
  elsif options[:automatic_release]
164
172
  Spaceship::ConnectAPI::AppStoreVersion::ReleaseType::AFTER_APPROVAL
@@ -315,6 +323,16 @@ module Deliver
315
323
 
316
324
  # rubocop:enable Metrics/PerceivedComplexity
317
325
 
326
+ def convert_ms_to_iso8601(time_in_ms)
327
+ time_in_s = time_in_ms / 1000
328
+
329
+ # Remove minutes and seconds (whole hour)
330
+ seconds_in_hour = 60 * 60
331
+ time_in_s_to_hour = (time_in_s / seconds_in_hour).to_i * seconds_in_hour
332
+
333
+ return Time.at(time_in_s_to_hour).strftime("%Y-%m-%dT%H:%M:%S%:z")
334
+ end
335
+
318
336
  # If the user is using the 'default' language, then assign values where they are needed
319
337
  def assign_defaults(options)
320
338
  # Normalizes languages keys from symbols to strings
@@ -389,7 +407,7 @@ module Deliver
389
407
  end
390
408
 
391
409
  # Finding languages to enable
392
- def verify_available_info_languages!(options, app)
410
+ def verify_available_info_languages!(options, app, languages)
393
411
  app_info = app.fetch_edit_app_info
394
412
 
395
413
  unless app_info
@@ -399,7 +417,7 @@ module Deliver
399
417
 
400
418
  localizations = app_info.get_app_info_localizations
401
419
 
402
- languages = (options[:languages] || []).reject { |lang| lang == "default" }
420
+ languages = (languages || []).reject { |lang| lang == "default" }
403
421
  locales_to_enable = languages - localizations.map(&:locale)
404
422
 
405
423
  if locales_to_enable.count > 0
@@ -423,7 +441,7 @@ module Deliver
423
441
  end
424
442
 
425
443
  # Finding languages to enable
426
- def verify_available_version_languages!(options, app)
444
+ def verify_available_version_languages!(options, app, languages)
427
445
  platform = Spaceship::ConnectAPI::Platform.map(options[:platform])
428
446
  version = app.get_edit_app_store_version(platform: platform)
429
447
 
@@ -434,7 +452,7 @@ module Deliver
434
452
 
435
453
  localizations = version.get_app_store_version_localizations
436
454
 
437
- languages = (options[:languages] || []).reject { |lang| lang == "default" }
455
+ languages = (languages || []).reject { |lang| lang == "default" }
438
456
  locales_to_enable = languages - localizations.map(&:locale)
439
457
 
440
458
  if locales_to_enable.count > 0
@@ -532,7 +550,8 @@ module Deliver
532
550
  UI.message("Uploading app review information to App Store Connect")
533
551
  app_store_review_detail = begin
534
552
  version.fetch_app_store_review_detail
535
- rescue
553
+ rescue => error
554
+ UI.error("Error fetching app store review detail - #{error.message}")
536
555
  nil
537
556
  end # errors if doesn't exist
538
557
  if app_store_review_detail
@@ -544,19 +563,19 @@ module Deliver
544
563
 
545
564
  def set_review_attachment_file(version, options)
546
565
  app_store_review_detail = version.fetch_app_store_review_detail
547
- app_review_attachments = app_store_review_detail.fetch_app_review_attachments
566
+ app_store_review_attachments = app_store_review_detail.app_store_review_attachments || []
548
567
 
549
568
  if options[:app_review_attachment_file]
550
- app_review_attachments.each do |app_review_attachment|
569
+ app_store_review_attachments.each do |app_store_review_attachment|
551
570
  UI.message("Removing previous review attachment file from App Store Connect")
552
- app_review_attachment.delete!
571
+ app_store_review_attachment.delete!
553
572
  end
554
573
 
555
574
  UI.message("Uploading review attachment file to App Store Connect")
556
575
  app_store_review_detail.upload_attachment(path: options[:app_review_attachment_file])
557
576
  else
558
- app_review_attachments.each(&:delete!)
559
- UI.message("Removing review attachment file to App Store Connect") unless app_review_attachments.empty?
577
+ app_store_review_attachments.each(&:delete!)
578
+ UI.message("Removing review attachment file to App Store Connect") unless app_store_review_attachments.empty?
560
579
  end
561
580
  end
562
581