fastlane 2.155.2 → 2.157.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +74 -74
  3. data/deliver/lib/deliver.rb +1 -0
  4. data/deliver/lib/deliver/app_screenshot_iterator.rb +95 -0
  5. data/deliver/lib/deliver/detect_values.rb +4 -1
  6. data/deliver/lib/deliver/languages.rb +7 -0
  7. data/deliver/lib/deliver/loader.rb +4 -5
  8. data/deliver/lib/deliver/queue_worker.rb +64 -0
  9. data/deliver/lib/deliver/runner.rb +7 -5
  10. data/deliver/lib/deliver/upload_screenshots.rb +143 -128
  11. data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +120 -0
  12. data/fastlane/lib/fastlane/actions/commit_version_bump.rb +1 -1
  13. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -0
  14. data/fastlane/lib/fastlane/actions/docs/upload_to_testflight.md +17 -1
  15. data/fastlane/lib/fastlane/actions/set_changelog.rb +2 -2
  16. data/fastlane/lib/fastlane/actions/sonar.rb +5 -0
  17. data/fastlane/lib/fastlane/actions/spaceship_stats.rb +73 -0
  18. data/fastlane/lib/fastlane/actions/upload_to_testflight.rb +4 -0
  19. data/fastlane/lib/fastlane/version.rb +1 -1
  20. data/fastlane/swift/Deliverfile.swift +1 -1
  21. data/fastlane/swift/DeliverfileProtocol.swift +1 -1
  22. data/fastlane/swift/Fastlane.swift +67 -7
  23. data/fastlane/swift/Gymfile.swift +1 -1
  24. data/fastlane/swift/GymfileProtocol.swift +1 -1
  25. data/fastlane/swift/Matchfile.swift +1 -1
  26. data/fastlane/swift/MatchfileProtocol.swift +1 -1
  27. data/fastlane/swift/Precheckfile.swift +1 -1
  28. data/fastlane/swift/PrecheckfileProtocol.swift +1 -1
  29. data/fastlane/swift/Scanfile.swift +1 -1
  30. data/fastlane/swift/ScanfileProtocol.swift +1 -1
  31. data/fastlane/swift/Screengrabfile.swift +1 -1
  32. data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
  33. data/fastlane/swift/Snapshotfile.swift +1 -1
  34. data/fastlane/swift/SnapshotfileProtocol.swift +1 -1
  35. data/fastlane_core/lib/fastlane_core/command_executor.rb +1 -0
  36. data/fastlane_core/lib/fastlane_core/itunes_transporter.rb +71 -42
  37. data/fastlane_core/lib/fastlane_core/project.rb +1 -0
  38. data/gym/lib/gym/error_handler.rb +1 -1
  39. data/gym/lib/gym/generators/build_command_generator.rb +0 -1
  40. data/pilot/lib/pilot/build_manager.rb +18 -4
  41. data/pilot/lib/pilot/manager.rb +16 -5
  42. data/pilot/lib/pilot/options.rb +16 -0
  43. data/produce/lib/produce/itunes_connect.rb +2 -2
  44. data/scan/lib/scan/test_command_generator.rb +3 -1
  45. data/screengrab/lib/screengrab/runner.rb +36 -17
  46. data/sigh/lib/sigh/runner.rb +6 -5
  47. data/snapshot/lib/snapshot/test_command_generator_base.rb +3 -1
  48. data/spaceship/lib/spaceship.rb +4 -0
  49. data/spaceship/lib/spaceship/client.rb +2 -0
  50. data/spaceship/lib/spaceship/connect_api.rb +0 -15
  51. data/spaceship/lib/spaceship/connect_api/api_client.rb +270 -0
  52. data/spaceship/lib/spaceship/connect_api/client.rb +144 -213
  53. data/spaceship/lib/spaceship/connect_api/models/profile.rb +3 -2
  54. data/spaceship/lib/spaceship/connect_api/provisioning/client.rb +8 -17
  55. data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +75 -64
  56. data/spaceship/lib/spaceship/connect_api/spaceship.rb +98 -0
  57. data/spaceship/lib/spaceship/connect_api/testflight/client.rb +8 -17
  58. data/spaceship/lib/spaceship/connect_api/testflight/testflight.rb +288 -277
  59. data/spaceship/lib/spaceship/connect_api/token.rb +46 -5
  60. data/spaceship/lib/spaceship/connect_api/token_refresh_middleware.rb +24 -0
  61. data/spaceship/lib/spaceship/connect_api/tunes/client.rb +8 -17
  62. data/spaceship/lib/spaceship/connect_api/tunes/tunes.rb +717 -706
  63. data/spaceship/lib/spaceship/connect_api/users/client.rb +8 -17
  64. data/spaceship/lib/spaceship/connect_api/users/users.rb +28 -17
  65. data/spaceship/lib/spaceship/stats_middleware.rb +65 -0
  66. metadata +25 -19
  67. data/sigh/lib/sigh/.module.rb.swp +0 -0
  68. data/sigh/lib/sigh/.options.rb.swp +0 -0
  69. data/sigh/lib/sigh/.runner.rb.swp +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3b88937951b883459302bc07e9a66fdba08b143c69c19b99d1c686fe94ed31b
4
- data.tar.gz: fedcf41735373196f76caa13a2908fd7d84a174795bd820d85a6415e737efe6a
3
+ metadata.gz: 55737a8f7b3af40ddeb4e00f4466372cfa18a26add15401b31ada8a8c75e1fbc
4
+ data.tar.gz: afd86451de8c50a3072ebb5a52fd4193b6af6c22a4c578ad1de0b5d3a5a5a110
5
5
  SHA512:
6
- metadata.gz: b3f45c9c40951e5c6f36c8cfdfd1461ac148b2234fd94d2d9ef2e2d66955f6f54a8f8d8a3b20994c0bf764cbcf02caf35e35bf7218fcf71799e608201ad58c79
7
- data.tar.gz: a807ff6348c844b11a937ef40b7cebd91e7633e0a3d689958226b0715391d327de0b60dbe43b78d640a1e41bf5698a0cb1d9491ba27d9e2ea679d7d2b3f7b8f4
6
+ metadata.gz: 8726dd0393f1af51a65958340652efc406be6e78b65e03d4febaf5bd944fc2224c5cd05e05cd4719a0c9045d6734d0ca1dc9c772b4ca5519292f927ceb3b8fef
7
+ data.tar.gz: 932807e7809d67579397f6a513161342ace1afb4589058d7e77607961681de53a9424742e3bb3b757980bacfe0b7bc5d48d19cb7f1bb21de960cf516c83ff9ca
data/README.md CHANGED
@@ -34,49 +34,43 @@ 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='luka-mirosevic'>
38
- <a href='https://github.com/lmirosevic'>
39
- <img src='https://github.com/lmirosevic.png?size=140'>
37
+ <td id='matthew-ellis'>
38
+ <a href='https://github.com/matthewellis'>
39
+ <img src='https://github.com/matthewellis.png?size=140'>
40
40
  </a>
41
- <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></h4>
41
+ <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
42
42
  </td>
43
- <td id='kohki-miki'>
44
- <a href='https://github.com/giginet'>
45
- <img src='https://github.com/giginet.png?size=140'>
43
+ <td id='olivier-halligon'>
44
+ <a href='https://github.com/AliSoftware'>
45
+ <img src='https://github.com/AliSoftware.png?size=140'>
46
46
  </a>
47
- <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
47
+ <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
48
48
  </td>
49
- <td id='danielle-tomlinson'>
50
- <a href='https://github.com/endocrimes'>
51
- <img src='https://github.com/endocrimes.png?size=140'>
49
+ <td id='iulian-onofrei'>
50
+ <a href='https://github.com/revolter'>
51
+ <img src='https://github.com/revolter.png?size=140'>
52
52
  </a>
53
- <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
53
+ <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
54
54
  </td>
55
- <td id='jérôme-lacoste'>
56
- <a href='https://github.com/lacostej'>
57
- <img src='https://github.com/lacostej.png?size=140'>
55
+ <td id='jimmy-dee'>
56
+ <a href='https://github.com/jdee'>
57
+ <img src='https://github.com/jdee.png?size=140'>
58
58
  </a>
59
- <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
59
+ <h4 align='center'>Jimmy Dee</h4>
60
60
  </td>
61
- <td id='joshua-liebowitz'>
62
- <a href='https://github.com/taquitos'>
63
- <img src='https://github.com/taquitos.png?size=140'>
61
+ <td id='jan-piotrowski'>
62
+ <a href='https://github.com/janpio'>
63
+ <img src='https://github.com/janpio.png?size=140'>
64
64
  </a>
65
- <h4 align='center'><a href='https://twitter.com/taquitos'>Joshua Liebowitz</a></h4>
65
+ <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
66
66
  </td>
67
67
  </tr>
68
68
  <tr>
69
- <td id='jorge-revuelta-h'>
70
- <a href='https://github.com/minuscorp'>
71
- <img src='https://github.com/minuscorp.png?size=140'>
72
- </a>
73
- <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
74
- </td>
75
- <td id='maksym-grebenets'>
76
- <a href='https://github.com/mgrebenets'>
77
- <img src='https://github.com/mgrebenets.png?size=140'>
69
+ <td id='fumiya-nakamura'>
70
+ <a href='https://github.com/nafu'>
71
+ <img src='https://github.com/nafu.png?size=140'>
78
72
  </a>
79
- <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
73
+ <h4 align='center'><a href='https://twitter.com/nafu003'>Fumiya Nakamura</a></h4>
80
74
  </td>
81
75
  <td id='josh-holtz'>
82
76
  <a href='https://github.com/joshdholtz'>
@@ -90,11 +84,17 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
90
84
  </a>
91
85
  <h4 align='center'><a href='https://twitter.com/armcburney'>Andrew McBurney</a></h4>
92
86
  </td>
93
- <td id='max-ott'>
94
- <a href='https://github.com/max-ott'>
95
- <img src='https://github.com/max-ott.png?size=140'>
87
+ <td id='kohki-miki'>
88
+ <a href='https://github.com/giginet'>
89
+ <img src='https://github.com/giginet.png?size=140'>
96
90
  </a>
97
- <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
91
+ <h4 align='center'><a href='https://twitter.com/giginet'>Kohki Miki</a></h4>
92
+ </td>
93
+ <td id='helmut-januschka'>
94
+ <a href='https://github.com/hjanuschka'>
95
+ <img src='https://github.com/hjanuschka.png?size=140'>
96
+ </a>
97
+ <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
98
98
  </td>
99
99
  </tr>
100
100
  <tr>
@@ -104,23 +104,23 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
104
104
  </a>
105
105
  <h4 align='center'><a href='https://twitter.com/mollyIV'>Daniel Jankowski</a></h4>
106
106
  </td>
107
- <td id='manu-wallner'>
108
- <a href='https://github.com/milch'>
109
- <img src='https://github.com/milch.png?size=140'>
107
+ <td id='jorge-revuelta-h'>
108
+ <a href='https://github.com/minuscorp'>
109
+ <img src='https://github.com/minuscorp.png?size=140'>
110
110
  </a>
111
- <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
111
+ <h4 align='center'><a href='https://twitter.com/minuscorp'>Jorge Revuelta H</a></h4>
112
112
  </td>
113
- <td id='felix-krause'>
114
- <a href='https://github.com/KrauseFx'>
115
- <img src='https://github.com/KrauseFx.png?size=140'>
113
+ <td id='max-ott'>
114
+ <a href='https://github.com/max-ott'>
115
+ <img src='https://github.com/max-ott.png?size=140'>
116
116
  </a>
117
- <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
117
+ <h4 align='center'><a href='https://twitter.com/ott_max'>Max Ott</a></h4>
118
118
  </td>
119
- <td id='stefan-natchev'>
120
- <a href='https://github.com/snatchev'>
121
- <img src='https://github.com/snatchev.png?size=140'>
119
+ <td id='maksym-grebenets'>
120
+ <a href='https://github.com/mgrebenets'>
121
+ <img src='https://github.com/mgrebenets.png?size=140'>
122
122
  </a>
123
- <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
123
+ <h4 align='center'><a href='https://twitter.com/mgrebenets'>Maksym Grebenets</a></h4>
124
124
  </td>
125
125
  <td id='aaron-brager'>
126
126
  <a href='https://github.com/getaaron'>
@@ -130,49 +130,49 @@ If the above doesn't help, please [submit an issue](https://github.com/fastlane/
130
130
  </td>
131
131
  </tr>
132
132
  <tr>
133
- <td id='matthew-ellis'>
134
- <a href='https://github.com/matthewellis'>
135
- <img src='https://github.com/matthewellis.png?size=140'>
133
+ <td id='stefan-natchev'>
134
+ <a href='https://github.com/snatchev'>
135
+ <img src='https://github.com/snatchev.png?size=140'>
136
136
  </a>
137
- <h4 align='center'><a href='https://twitter.com/mellis1995'>Matthew Ellis</a></h4>
137
+ <h4 align='center'><a href='https://twitter.com/snatchev'>Stefan Natchev</a></h4>
138
138
  </td>
139
- <td id='olivier-halligon'>
140
- <a href='https://github.com/AliSoftware'>
141
- <img src='https://github.com/AliSoftware.png?size=140'>
139
+ <td id='danielle-tomlinson'>
140
+ <a href='https://github.com/endocrimes'>
141
+ <img src='https://github.com/endocrimes.png?size=140'>
142
142
  </a>
143
- <h4 align='center'><a href='https://twitter.com/aligatr'>Olivier Halligon</a></h4>
143
+ <h4 align='center'><a href='https://twitter.com/endocrimes'>Danielle Tomlinson</a></h4>
144
144
  </td>
145
- <td id='jan-piotrowski'>
146
- <a href='https://github.com/janpio'>
147
- <img src='https://github.com/janpio.png?size=140'>
145
+ <td id='manu-wallner'>
146
+ <a href='https://github.com/milch'>
147
+ <img src='https://github.com/milch.png?size=140'>
148
148
  </a>
149
- <h4 align='center'><a href='https://twitter.com/Sujan'>Jan Piotrowski</a></h4>
149
+ <h4 align='center'><a href='https://twitter.com/acrooow'>Manu Wallner</a></h4>
150
150
  </td>
151
- <td id='iulian-onofrei'>
152
- <a href='https://github.com/revolter'>
153
- <img src='https://github.com/revolter.png?size=140'>
151
+ <td id='luka-mirosevic'>
152
+ <a href='https://github.com/lmirosevic'>
153
+ <img src='https://github.com/lmirosevic.png?size=140'>
154
154
  </a>
155
- <h4 align='center'><a href='https://twitter.com/Revolt666'>Iulian Onofrei</a></h4>
155
+ <h4 align='center'><a href='https://twitter.com/lmirosevic'>Luka Mirosevic</a></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='joshua-liebowitz'>
158
+ <a href='https://github.com/taquitos'>
159
+ <img src='https://github.com/taquitos.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/taquitos'>Joshua Liebowitz</a></h4>
162
162
  </td>
163
163
  </tr>
164
164
  <tr>
165
- <td id='jimmy-dee'>
166
- <a href='https://github.com/jdee'>
167
- <img src='https://github.com/jdee.png?size=140'>
165
+ <td id='jérôme-lacoste'>
166
+ <a href='https://github.com/lacostej'>
167
+ <img src='https://github.com/lacostej.png?size=140'>
168
168
  </a>
169
- <h4 align='center'>Jimmy Dee</h4>
169
+ <h4 align='center'><a href='https://twitter.com/lacostej'>Jérôme Lacoste</a></h4>
170
170
  </td>
171
- <td id='helmut-januschka'>
172
- <a href='https://github.com/hjanuschka'>
173
- <img src='https://github.com/hjanuschka.png?size=140'>
171
+ <td id='felix-krause'>
172
+ <a href='https://github.com/KrauseFx'>
173
+ <img src='https://github.com/KrauseFx.png?size=140'>
174
174
  </a>
175
- <h4 align='center'><a href='https://twitter.com/hjanuschka'>Helmut Januschka</a></h4>
175
+ <h4 align='center'><a href='https://twitter.com/KrauseFx'>Felix Krause</a></h4>
176
176
  </td>
177
177
  </table>
178
178
 
@@ -1,3 +1,4 @@
1
+ require_relative 'deliver/languages'
1
2
  require_relative 'deliver/loader'
2
3
  require_relative 'deliver/options'
3
4
  require_relative 'deliver/commands_generator'
@@ -0,0 +1,95 @@
1
+ module Deliver
2
+ # This is a convinient class that enumerates app store connect's screenshots in various degrees.
3
+ class AppScreenshotIterator
4
+ NUMBER_OF_THREADS = Helper.test? ? 1 : [ENV.fetch("DELIVER_NUMBER_OF_THREADS", 10).to_i, 10].min
5
+
6
+ # @param localizations [Array<Spaceship::ConnectAPI::AppStoreVersionLocalization>]
7
+ def initialize(localizations)
8
+ @localizations = localizations
9
+ end
10
+
11
+ # Iterate app_screenshot_set over localizations
12
+ #
13
+ # @yield [localization, app_screenshot_set]
14
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreVersionLocalization] localization
15
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreScreenshotSet] app_screenshot_set
16
+ def each_app_screenshot_set(localizations = @localizations, &block)
17
+ return enum_for(__method__, localizations) unless block_given?
18
+
19
+ # Collect app_screenshot_sets from localizations in parallel but
20
+ # limit the number of threads working at a time with using `lazy` and `force` controls
21
+ # to not attack App Store Connect
22
+ results = localizations.each_slice(NUMBER_OF_THREADS).lazy.map do |localizations_grouped|
23
+ localizations_grouped.map do |localization|
24
+ Thread.new do
25
+ [localization, localization.get_app_screenshot_sets]
26
+ end
27
+ end
28
+ end.flat_map do |threads|
29
+ threads.map { |t| t.join.value }
30
+ end.force
31
+
32
+ results.each do |localization, app_screenshot_sets|
33
+ app_screenshot_sets.each do |app_screenshot_set|
34
+ yield(localization, app_screenshot_set)
35
+ end
36
+ end
37
+ end
38
+
39
+ # Iterate app_screenshot over localizations and app_screenshot_sets
40
+ #
41
+ # @yield [localization, app_screenshot_set, app_screenshot]
42
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreVersionLocalization] localization
43
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreScreenshotSet] app_screenshot_set
44
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreScreenshot] app_screenshot
45
+ def each_app_screenshot(&block)
46
+ return enum_for(__method__) unless block_given?
47
+
48
+ each_app_screenshot_set do |localization, app_screenshot_set|
49
+ app_screenshot_set.app_screenshots.each do |app_screenshot|
50
+ yield(localization, app_screenshot_set, app_screenshot)
51
+ end
52
+ end
53
+ end
54
+
55
+ # Iterate given local app_screenshot over localizations and app_screenshot_sets with index within each app_screenshot_set
56
+ #
57
+ # @param screenshots_per_language [Hash<String, Array<Deliver::AppScreenshot>]
58
+ # @yield [localization, app_screenshot_set, app_screenshot, index]
59
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreVersionLocalization] localization
60
+ # @yieldparam [optional, Spaceship::ConnectAPI::AppStoreScreenshotSet] app_screenshot_set
61
+ # @yieldparam [optional, Deliver::AppScreenshot] screenshot
62
+ # @yieldparam [optional, Integer] index a number reperesents which position the screenshot will be
63
+ def each_local_screenshot(screenshots_per_language, &block)
64
+ return enum_for(__method__, screenshots_per_language) unless block_given?
65
+
66
+ # filter unnecessary localizations
67
+ supported_localizations = @localizations.reject { |l| screenshots_per_language[l.locale].nil? }
68
+
69
+ # build a hash that can access app_screenshot_set corresponding to given locale and display_type
70
+ # via parallelized each_app_screenshot_set to gain performance
71
+ app_screenshot_set_per_locale_and_display_type = each_app_screenshot_set(supported_localizations)
72
+ .each_with_object({}) do |(localization, app_screenshot_set), hash|
73
+ hash[localization.locale] ||= {}
74
+ hash[localization.locale][app_screenshot_set.screenshot_display_type] = app_screenshot_set
75
+ end
76
+
77
+ # iterate over screenshots per localization
78
+ screenshots_per_language.each do |language, screenshots_for_language|
79
+ localization = supported_localizations.find { |l| l.locale == language }
80
+ screenshots_per_display_type = screenshots_for_language.reject { |screenshot| screenshot.device_type.nil? }.group_by(&:device_type)
81
+
82
+ screenshots_per_display_type.each do |display_type, screenshots|
83
+ # create AppScreenshotSet for given display_type if it doesn't exsit
84
+ app_screenshot_set = (app_screenshot_set_per_locale_and_display_type[language] || {})[display_type]
85
+ app_screenshot_set ||= localization.create_app_screenshot_set(attributes: { screenshotDisplayType: display_type })
86
+
87
+ # iterate over screenshots per display size with index
88
+ screenshots.each.with_index do |screenshot, index|
89
+ yield(localization, app_screenshot_set, screenshot, index)
90
+ end
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -5,6 +5,7 @@ require 'spaceship/tunes/tunes'
5
5
  require 'spaceship/tunes/application'
6
6
 
7
7
  require_relative 'module'
8
+ require_relative 'languages'
8
9
 
9
10
  module Deliver
10
11
  class DetectValues
@@ -88,7 +89,9 @@ module Deliver
88
89
  languages = options[:languages]
89
90
  return unless languages
90
91
 
91
- all_languages = Spaceship::Tunes.client.available_languages
92
+ # 2020-08-24 - Available locales are not available as an endpoint in App Store Connect
93
+ # Update with Spaceship::Tunes.client.available_languages.sort (as long as endpoint is avilable)
94
+ all_languages = Deliver::Languages::ALL_LANGUAGES
92
95
  diff = languages - all_languages
93
96
 
94
97
  unless diff.empty?
@@ -0,0 +1,7 @@
1
+ module Deliver
2
+ module Languages
3
+ # 2020-08-24 - Available locales are not available as an endpoint in App Store Connect
4
+ # Update with Spaceship::Tunes.client.available_languages.sort (as long as endpoint is avilable)
5
+ ALL_LANGUAGES = ["ar-SA", "ca", "cs", "da", "de-DE", "el", "en-AU", "en-CA", "en-GB", "en-US", "es-ES", "es-MX", "fi", "fr-CA", "fr-FR", "he", "hi", "hr", "hu", "id", "it", "ja", "ko", "ms", "nl-NL", "no", "pl", "pt-BR", "pt-PT", "ro", "ru", "sk", "sv", "th", "tr", "uk", "vi", "zh-Hans", "zh-Hant"]
6
+ end
7
+ end
@@ -3,6 +3,7 @@ require 'spaceship/tunes/tunes'
3
3
 
4
4
  require_relative 'module'
5
5
  require_relative 'upload_metadata'
6
+ require_relative 'languages'
6
7
 
7
8
  module Deliver
8
9
  module Loader
@@ -24,11 +25,9 @@ module Deliver
24
25
  def self.language_folders(root, ignore_validation)
25
26
  folders = Dir.glob(File.join(root, '*'))
26
27
 
27
- if Helper.test?
28
- available_languages = FastlaneCore::Languages::ALL_LANGUAGES
29
- else
30
- available_languages = Spaceship::Tunes.client.available_languages.sort
31
- end
28
+ # 2020-08-24 - Available locales are not available as an endpoint in App Store Connect
29
+ # Update with Spaceship::Tunes.client.available_languages.sort (as long as endpoint is avilable)
30
+ available_languages = Deliver::Languages::ALL_LANGUAGES
32
31
 
33
32
  allowed_directory_names_with_case = (available_languages + SPECIAL_DIR_NAMES)
34
33
  allowed_directory_names = allowed_directory_names_with_case.map(&:downcase).freeze
@@ -0,0 +1,64 @@
1
+ require 'thread'
2
+
3
+ module Deliver
4
+ # This dispatches jobs to worker threads and make it work in parallel.
5
+ # It's suitable for I/O bounds works and not for CPU bounds works.
6
+ # Use this when you have all the items that you'll process in advance.
7
+ # Simply enqueue them to this and call `QueueWorker#start`.
8
+ class QueueWorker
9
+ # @param concurrency (Numeric) - A number of threads to be created
10
+ # @param block (Proc) - A task you want to execute with enqueued items
11
+ def initialize(concurrency, &block)
12
+ @concurrency = concurrency
13
+ @block = block
14
+ @queue = Queue.new
15
+ end
16
+
17
+ # @param job (Object) - An arbitary object that keeps parameters
18
+ def enqueue(job)
19
+ @queue.push(job)
20
+ end
21
+
22
+ # Call this after you enqueuned all the jobs you want to process
23
+ # This method blocks current thread until all the enqueued jobs are processed
24
+ def start
25
+ threads = []
26
+ @concurrency.times do
27
+ threads << Thread.new do
28
+ while running? && !empty?
29
+ job = @queue.pop
30
+ @block.call(job) if job
31
+ end
32
+ end
33
+ end
34
+
35
+ wait_for_complete
36
+ threads.each(&:join)
37
+ end
38
+
39
+ private
40
+
41
+ def running?
42
+ !@queue.closed?
43
+ end
44
+
45
+ def empty?
46
+ @queue.empty?
47
+ end
48
+
49
+ def wait_for_complete
50
+ wait_thread = Thread.new do
51
+ loop do
52
+ if @queue.empty?
53
+ @queue.close
54
+ break
55
+ end
56
+
57
+ sleep(1)
58
+ end
59
+ end
60
+
61
+ wait_thread.join
62
+ end
63
+ end
64
+ end
@@ -27,8 +27,8 @@ module Deliver
27
27
 
28
28
  def login
29
29
  UI.message("Login to App Store Connect (#{options[:username]})")
30
- Spaceship::Tunes.login(options[:username])
31
- Spaceship::Tunes.select_team
30
+ Spaceship::ConnectAPI.login(options[:username], nil, use_portal: false, use_tunes: true)
31
+ Spaceship::ConnectAPI.select_team
32
32
  UI.message("Login successful")
33
33
  end
34
34
 
@@ -177,17 +177,19 @@ module Deliver
177
177
  # If there are multiple teams, infer the provider from the selected team name.
178
178
  # If there are fewer than two teams, don't infer the provider.
179
179
  def transporter_for_selected_team
180
+ tunes_client = Spaceship::ConnectAPI.client.tunes_client
181
+
180
182
  generic_transporter = FastlaneCore::ItunesTransporter.new(options[:username], nil, false, options[:itc_provider])
181
- return generic_transporter unless options[:itc_provider].nil? && Spaceship::Tunes.client.teams.count > 1
183
+ return generic_transporter unless options[:itc_provider].nil? && tunes_client.teams.count > 1
182
184
 
183
185
  begin
184
- team = Spaceship::Tunes.client.teams.find { |t| t['contentProvider']['contentProviderId'].to_s == Spaceship::Tunes.client.team_id }
186
+ team = tunes_client.teams.find { |t| t['contentProvider']['contentProviderId'].to_s == tunes_client.team_id }
185
187
  name = team['contentProvider']['name']
186
188
  provider_id = generic_transporter.provider_ids[name]
187
189
  UI.verbose("Inferred provider id #{provider_id} for team #{name}.")
188
190
  return FastlaneCore::ItunesTransporter.new(options[:username], nil, false, provider_id)
189
191
  rescue => ex
190
- UI.verbose("Couldn't infer a provider short name for team with id #{Spaceship::Tunes.client.team_id} automatically: #{ex}. Proceeding without provider short name.")
192
+ UI.verbose("Couldn't infer a provider short name for team with id #{tunes_client.team_id} automatically: #{ex}. Proceeding without provider short name.")
191
193
  return generic_transporter
192
194
  end
193
195
  end