fastlane 2.40.0.beta.20170620010029 → 2.40.0.beta.20170621010038

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ecb389e07fa98300df31ef752a0b9faad5d37eb
4
- data.tar.gz: f6705997d7cb41177ab53320bde6b4b79544bb85
3
+ metadata.gz: 1aecac2c764541b3681eedd9f44827843c3403f9
4
+ data.tar.gz: c4ff9cacb874e3a827fe12cabaee41d0ede44709
5
5
  SHA512:
6
- metadata.gz: b022742cce7f3c62e8b18649465cc9ab39cf97a3320dbe7416f802386fd4c1ca7defb61ce2ea173a653f96875be951f1a13078581aa751d600bdfaf3887dc66c
7
- data.tar.gz: f932c61eb2cc7a8b468877285bf794f54ee5d51c16d19c51b7d5b74b1e0049397ddf8f74cfa47b3e455a5b80de381672148df1c75c757647b9d8a6476bba762a
6
+ metadata.gz: 0f48d61a68aa009829cca85280ea29a59aa00a54f30ca788de4031d3bb96c14e8ac023a613df874e806908b90403dc1ad96744c9a139a24528ac6921240e5b36
7
+ data.tar.gz: 0b45be6c7d0609f8d3c8118efd4bbc2c6422b7fc306d344a0708c248f51e0b0482dc0a972e34689b65f0e9dd446aceb1a799e7bea63acb848019df2d8ac3d1ba
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.40.0.beta.20170620010029'.freeze
2
+ VERSION = '2.40.0.beta.20170621010038'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -268,9 +268,11 @@ module Supply
268
268
  current_edit.id,
269
269
  track
270
270
  )
271
+ return result.version_codes
272
+ rescue Google::Apis::ClientError => e
273
+ return [] if e.status_code == 404 && e.to_s.include?("trackEmpty")
274
+ raise
271
275
  end
272
-
273
- return result.version_codes
274
276
  end
275
277
 
276
278
  def update_apk_listing_for_language(apk_listing)
@@ -172,7 +172,13 @@ module Supply
172
172
  optional: true,
173
173
  verify_block: proc do |value|
174
174
  UI.user_error! "Could not parse URL '#{value}'" unless value =~ URI.regexp
175
- end)
175
+ end),
176
+ FastlaneCore::ConfigItem.new(key: :check_superseded_tracks,
177
+ env_name: "SUPPLY_CHECK_SUPERSEDED_TRACKS",
178
+ optional: true,
179
+ description: "Check the other tracks for superseded versions and disable them",
180
+ is_string: false,
181
+ default_value: false)
176
182
 
177
183
  ]
178
184
  end
@@ -158,10 +158,46 @@ module Supply
158
158
  if Supply.config[:track].eql? "rollout"
159
159
  client.update_track(Supply.config[:track], Supply.config[:rollout], apk_version_codes)
160
160
  else
161
+ check_superseded_tracks(apk_version_codes) if Supply.config[:check_superseded_tracks]
161
162
  client.update_track(Supply.config[:track], 1.0, apk_version_codes)
162
163
  end
163
164
  end
164
165
 
166
+ # Remove any version codes that is:
167
+ # - Lesser than the greatest of any later (i.e. production) track
168
+ # - Or lesser than the currently being uploaded if it's in an earlier (i.e. alpha) track
169
+ def check_superseded_tracks(apk_version_codes)
170
+ UI.message("Checking superseded tracks...")
171
+ max_apk_version_code = apk_version_codes.max
172
+ max_tracks_version_code = nil
173
+
174
+ tracks = ["production", "beta", "alpha"]
175
+ config_track_index = tracks.index(Supply.config[:track])
176
+
177
+ tracks.each_index do |track_index|
178
+ next if track_index.eql? config_track_index
179
+ track = tracks[track_index]
180
+
181
+ track_version_codes = client.track_version_codes(track).sort
182
+ next if track_version_codes.empty?
183
+
184
+ if max_tracks_version_code.nil?
185
+ max_tracks_version_code = track_version_codes.max
186
+ else
187
+ removed_version_codes = track_version_codes.take_while do |v|
188
+ v < max_tracks_version_code || (v < max_apk_version_code && track_index > config_track_index)
189
+ end
190
+
191
+ unless removed_version_codes.empty?
192
+ keep_version_codes = track_version_codes - removed_version_codes
193
+ max_tracks_version_code = keep_version_codes[0] unless keep_version_codes.empty?
194
+ client.update_track(track, 1.0, keep_version_codes)
195
+ UI.message("Superseded track '#{track}', removed '#{removed_version_codes}'")
196
+ end
197
+ end
198
+ end
199
+ end
200
+
165
201
  # returns only language directories from metadata_path
166
202
  def all_languages
167
203
  Dir.entries(metadata_path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.40.0.beta.20170620010029
4
+ version: 2.40.0.beta.20170621010038
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -15,7 +15,7 @@ authors:
15
15
  autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
- date: 2017-06-20 00:00:00.000000000 Z
18
+ date: 2017-06-21 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: slack-notifier
@@ -1375,23 +1375,23 @@ metadata:
1375
1375
  post_install_message:
1376
1376
  rdoc_options: []
1377
1377
  require_paths:
1378
- - screengrab/lib
1378
+ - pilot/lib
1379
+ - spaceship/lib
1379
1380
  - deliver/lib
1380
- - frameit/lib
1381
+ - pem/lib
1382
+ - sigh/lib
1381
1383
  - fastlane_core/lib
1382
- - match/lib
1383
- - pilot/lib
1384
1384
  - produce/lib
1385
- - sigh/lib
1386
- - pem/lib
1385
+ - snapshot/lib
1386
+ - supply/lib
1387
1387
  - gym/lib
1388
- - scan/lib
1389
- - cert/lib
1388
+ - match/lib
1390
1389
  - fastlane/lib
1391
- - spaceship/lib
1392
1390
  - credentials_manager/lib
1393
- - supply/lib
1394
- - snapshot/lib
1391
+ - scan/lib
1392
+ - screengrab/lib
1393
+ - frameit/lib
1394
+ - cert/lib
1395
1395
  required_ruby_version: !ruby/object:Gem::Requirement
1396
1396
  requirements:
1397
1397
  - - ">="