fastlane 2.134.0 → 2.135.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +72 -72
  3. data/fastlane/lib/fastlane/action.rb +1 -1
  4. data/fastlane/lib/fastlane/actions/actions_helper.rb +1 -1
  5. data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
  6. data/fastlane/lib/fastlane/actions/docs/sync_code_signing.md +4 -2
  7. data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +26 -2
  8. data/fastlane/lib/fastlane/actions/download_dsyms.rb +1 -1
  9. data/fastlane/lib/fastlane/actions/download_from_play_store.rb +1 -1
  10. data/fastlane/lib/fastlane/environment_printer.rb +2 -2
  11. data/fastlane/lib/fastlane/lane_manager.rb +1 -1
  12. data/fastlane/lib/fastlane/plugins/plugin_manager.rb +12 -2
  13. data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +1 -0
  14. data/fastlane/lib/fastlane/runner.rb +2 -2
  15. data/fastlane/lib/fastlane/version.rb +1 -1
  16. data/fastlane/swift/Deliverfile.swift +1 -1
  17. data/fastlane/swift/Fastlane.swift +50 -20
  18. data/fastlane/swift/Gymfile.swift +1 -1
  19. data/fastlane/swift/Matchfile.swift +1 -1
  20. data/fastlane/swift/MatchfileProtocol.swift +2 -2
  21. data/fastlane/swift/Precheckfile.swift +1 -1
  22. data/fastlane/swift/Scanfile.swift +1 -1
  23. data/fastlane/swift/Screengrabfile.swift +1 -1
  24. data/fastlane/swift/Snapshotfile.swift +1 -1
  25. data/fastlane_core/lib/fastlane_core/configuration/commander_generator.rb +3 -3
  26. data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +1 -1
  27. data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
  28. data/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb +1 -1
  29. data/{pilot/lib/pilot/.manager.rb.swp → gym/lib/gym/.module.rb.swp} +0 -0
  30. data/sigh/lib/assets/resign.sh +2 -2
  31. data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
  32. data/supply/lib/supply.rb +23 -0
  33. data/{fastlane/lib/fastlane/actions/.update_project_provisioning.rb.swp → supply/lib/supply/.client.rb.swp} +0 -0
  34. data/supply/lib/supply/.options.rb.swp +0 -0
  35. data/supply/lib/supply/.uploader.rb.swp +0 -0
  36. data/supply/lib/supply/client.rb +101 -55
  37. data/supply/lib/supply/options.rb +49 -14
  38. data/supply/lib/supply/release_listing.rb +18 -0
  39. data/supply/lib/supply/setup.rb +42 -34
  40. data/supply/lib/supply/uploader.rb +168 -93
  41. metadata +21 -24
  42. data/fastlane/lib/fastlane/actions/.download_dsyms.rb.swp +0 -0
  43. data/fastlane/lib/fastlane/actions/.hockey.rb.swp +0 -0
  44. data/fastlane/lib/fastlane/actions/.slack.rb.swp +0 -0
  45. data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.xcworkspace/xcuserdata/josh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  46. data/spaceship/lib/spaceship/connect_api/.DS_Store +0 -0
  47. 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.134.0
21
+ // Generated with fastlane 2.135.0
@@ -18,4 +18,4 @@ class Matchfile: MatchfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.134.0
21
+ // Generated with fastlane 2.135.0
@@ -91,7 +91,7 @@ protocol MatchfileProtocol: class {
91
91
  extension MatchfileProtocol {
92
92
  var type: String { return "development" }
93
93
  var readonly: Bool { return false }
94
- var generateAppleCerts: Bool { return true }
94
+ var generateAppleCerts: Bool { return false }
95
95
  var skipProvisioningProfiles: Bool { return false }
96
96
  var appIdentifier: [String] { return [] }
97
97
  var username: String { return "" }
@@ -122,4 +122,4 @@ extension MatchfileProtocol {
122
122
 
123
123
  // Please don't remove the lines below
124
124
  // They are used to detect outdated files
125
- // FastlaneRunnerAPIVersion [0.9.9]
125
+ // FastlaneRunnerAPIVersion [0.9.10]
@@ -18,4 +18,4 @@ class Precheckfile: PrecheckfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.134.0
21
+ // Generated with fastlane 2.135.0
@@ -18,4 +18,4 @@ class Scanfile: ScanfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.134.0
21
+ // Generated with fastlane 2.135.0
@@ -18,4 +18,4 @@ class Screengrabfile: ScreengrabfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.134.0
21
+ // Generated with fastlane 2.135.0
@@ -18,4 +18,4 @@ class Snapshotfile: SnapshotfileProtocol {
18
18
 
19
19
 
20
20
 
21
- // Generated with fastlane 2.134.0
21
+ // Generated with fastlane 2.135.0
@@ -93,9 +93,9 @@ module FastlaneCore
93
93
  return if short_switch.nil?
94
94
 
95
95
  UI.user_error!("Short option #{short_switch} already taken for key #{key}") if used_switches.include?(short_switch)
96
- UI.user_error!("-v is already used for the version (key #{key})") if short_switch == "-v"
97
- UI.user_error!("-h is already used for the help screen (key #{key})") if short_switch == "-h"
98
- UI.user_error!("-t is already used for the trace screen (key #{key})") if short_switch == "-t"
96
+ UI.user_error!("-v is already used for the fastlane version (key #{key})") if short_switch == "-v"
97
+ UI.user_error!("-h is already used for the fastlane help screen (key #{key})") if short_switch == "-h"
98
+ UI.user_error!("-t is already used for the fastlane trace screen (key #{key})") if short_switch == "-t"
99
99
 
100
100
  used_switches << short_switch
101
101
  end
@@ -120,7 +120,7 @@ module FastlaneCore
120
120
  index = @available_options.find_index { |item| item.key == conflicting_option_key }
121
121
  conflicting_option = @available_options[index]
122
122
 
123
- # ignore conflicts because because value of conflict option is nil
123
+ # ignore conflicts because value of conflict option is nil
124
124
  next if @values[conflicting_option.key].nil?
125
125
 
126
126
  if current.conflict_block
@@ -45,7 +45,7 @@ module FastlaneCore
45
45
 
46
46
  def self.show_loader
47
47
  return unless should_be_shown?
48
- # sound is disabled as i didn't find a royality free nice midi :(
48
+ # sound is disabled as I didn't find a royality free nice midi :(
49
49
  @output = StringIO.new
50
50
  # if FastlaneCore::Env.truthy?("FL_DO_SOUND")
51
51
  # @sound_thr = Thread.new do
@@ -117,7 +117,7 @@ module Commander
117
117
  abort(e.to_s)
118
118
  end
119
119
  end
120
- rescue FastlaneCore::Interface::FastlaneCommonException => e # these are exceptions that we dont count as crashes
120
+ rescue FastlaneCore::Interface::FastlaneCommonException => e # these are exceptions that we don't count as crashes
121
121
  display_user_error!(e, e.to_s)
122
122
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
123
123
  rescue_fastlane_error(e)
@@ -474,7 +474,7 @@ function resign {
474
474
  log "Profile app identifier prefix is '$APP_IDENTIFIER_PREFIX'"
475
475
  fi
476
476
 
477
- # Set new app identifer prefix if such entry exists in plist file
477
+ # Set new app identifier prefix if such entry exists in plist file
478
478
  PlistBuddy -c "Set :AppIdentifierPrefix $APP_IDENTIFIER_PREFIX." "$APP_PATH/Info.plist" 2>/dev/null
479
479
 
480
480
  TEAM_IDENTIFIER=$(PlistBuddy -c "Print :Entitlements:com.apple.developer.team-identifier" "$TEMP_DIR/profile.plist" | tr -d '\n')
@@ -690,7 +690,7 @@ function resign {
690
690
  # Get the old and new app identifier (prefix)
691
691
  APP_ID_KEY="application-identifier"
692
692
  # Extract just the identifier from the value
693
- # Use the fact that we are after some identifer, which is always at the start of the string
693
+ # Use the fact that we are after some identifier, which is always at the start of the string
694
694
  OLD_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$APP_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
695
695
  NEW_APP_ID=$(PlistBuddy -c "Print $APP_ID_KEY" "$PROFILE_ENTITLEMENTS" | grep -E '^[A-Z0-9]*' -o | tr -d '\n')
696
696
 
@@ -50,7 +50,7 @@ module Snapshot
50
50
  language = language[0]
51
51
  end
52
52
 
53
- # Clear logs so subsequent xcodebuild executions dont append to old ones
53
+ # Clear logs so subsequent xcodebuild executions don't append to old ones
54
54
  log_path = xcodebuild_log_path(language: language, locale: locale)
55
55
  File.delete(log_path) if File.exist?(log_path)
56
56
 
@@ -3,6 +3,7 @@ require 'supply/options'
3
3
  require 'supply/client'
4
4
  require 'supply/listing'
5
5
  require 'supply/apk_listing'
6
+ require 'supply/release_listing'
6
7
  require 'supply/uploader'
7
8
  require 'supply/languages'
8
9
 
@@ -23,8 +24,30 @@ module Supply
23
24
 
24
25
  CHANGELOGS_FOLDER_NAME = "changelogs"
25
26
 
27
+ # https://developers.google.com/android-publisher/#publishing
28
+ module Tracks
29
+ PRODUCTION = "production"
30
+ BETA = "beta"
31
+ ALPHA = "alpha"
32
+ INTERNAL = "internal"
33
+
34
+ DEFAULTS = [PRODUCTION, BETA, ALPHA, INTERNAL]
35
+ DEFAULT = PRODUCTION
36
+ end
37
+
38
+ # https://developers.google.com/android-publisher/api-ref/edits/tracks
39
+ module ReleaseStatus
40
+ COMPLETED = "completed"
41
+ DRAFT = "draft"
42
+ HALTED = "halted"
43
+ IN_PROGRESS = "inProgress"
44
+
45
+ ALL = [COMPLETED, DRAFT, HALTED, IN_PROGRESS]
46
+ end
47
+
26
48
  Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
27
49
  UI = FastlaneCore::UI
50
+ Boolean = Fastlane::Boolean
28
51
  ROOT = Pathname.new(File.expand_path('../..', __FILE__))
29
52
  DESCRIPTION = "Command line tool for updating Android apps and their metadata on the Google Play Store".freeze
30
53
  end
@@ -1,6 +1,6 @@
1
1
  require 'googleauth'
2
- require 'google/apis/androidpublisher_v2'
3
- Androidpublisher = Google::Apis::AndroidpublisherV2
2
+ require 'google/apis/androidpublisher_v3'
3
+ AndroidPublisher = Google::Apis::AndroidpublisherV3
4
4
 
5
5
  require 'net/http'
6
6
 
@@ -96,8 +96,8 @@ module Supply
96
96
  end
97
97
 
98
98
  class Client < AbstractGoogleServiceClient
99
- SERVICE = Androidpublisher::AndroidPublisherService
100
- SCOPE = Androidpublisher::AUTH_ANDROIDPUBLISHER
99
+ SERVICE = AndroidPublisher::AndroidPublisherService
100
+ SCOPE = AndroidPublisher::AUTH_ANDROIDPUBLISHER
101
101
 
102
102
  # Editing something
103
103
  # Reference to the entry we're currently editing. Might be nil if don't have one open
@@ -176,7 +176,7 @@ module Supply
176
176
  def listings
177
177
  ensure_active_edit!
178
178
 
179
- result = call_google_api { client.list_listings(current_package_name, current_edit.id) }
179
+ result = call_google_api { client.list_edit_listings(current_package_name, current_edit.id) }
180
180
 
181
181
  return result.listings.map do |row|
182
182
  Listing.new(self, row.language, row)
@@ -188,7 +188,7 @@ module Supply
188
188
  ensure_active_edit!
189
189
 
190
190
  begin
191
- result = client.get_listing(
191
+ result = client.get_edit_listing(
192
192
  current_package_name,
193
193
  current_edit.id,
194
194
  language
@@ -205,7 +205,7 @@ module Supply
205
205
  def apks_version_codes
206
206
  ensure_active_edit!
207
207
 
208
- result = call_google_api { client.list_apks(current_package_name, current_edit.id) }
208
+ result = call_google_api { client.list_edit_apks(current_package_name, current_edit.id) }
209
209
 
210
210
  return Array(result.apks).map(&:version_code)
211
211
  end
@@ -219,23 +219,57 @@ module Supply
219
219
  return Array(result.bundles).map(&:version_code)
220
220
  end
221
221
 
222
- # Get a list of all apk listings (changelogs) - returns the list
223
- def apk_listings(apk_version_code)
222
+ def release_listings(version)
224
223
  ensure_active_edit!
225
224
 
226
- result = call_google_api do
227
- client.list_apk_listings(
228
- current_package_name,
229
- current_edit.id,
230
- apk_version_code
231
- )
225
+ # Verify that tracks have releases
226
+ filtered_tracks = tracks.select { |t| !t.releases.nil? && t.releases.any? { |r| r.name == version } }
227
+
228
+ if filtered_tracks.length > 1
229
+ # Production track takes precedence if version is present in multiple tracks
230
+ # E.g.: A release might've been promoted from Alpha/Beta track. This means the release will be present in two or more tracks
231
+ if filtered_tracks.any? { |t| t.track == Supply::Tracks::DEFAULT }
232
+ filtered_tracks = filtered_tracks.select { |t| t.track == Supply::Tracks::DEFAULT }
233
+ else
234
+ # E.g.: A release might be in both Alpha & Beta (not sure if this is possible, just catching if it ever happens), giving Beta precedence.
235
+ filtered_tracks = filtered_tracks.select { |t| t.track == Supply::Tracks::BETA }
236
+ end
237
+ end
238
+
239
+ filtered_track = filtered_tracks.first
240
+ if filtered_track.nil?
241
+ UI.user_error!("Unable to find version '#{version}' for '#{current_package_name}' in all tracks. Please double check the version number.")
242
+ return nil
243
+ else
244
+ UI.message("Found '#{version}' in '#{filtered_track.track}' track.")
245
+ end
246
+
247
+ filtered_release = filtered_track.releases.first { |r| r.name == version }
248
+
249
+ # Since we can release on Alpha/Beta without release notes.
250
+ if filtered_release.release_notes.nil?
251
+ UI.user_error!("Version '#{version}' for '#{current_package_name}' does not seem to have any release notes. Nothing to download.")
252
+ return nil
232
253
  end
233
254
 
234
- return (result.listings || []).map do |row|
235
- ApkListing.new(row.recent_changes, row.language, apk_version_code)
255
+ return filtered_release.release_notes.map do |row|
256
+ Supply::ReleaseListing.new(filtered_track, filtered_release.name, filtered_release.version_codes, row.language, row.text)
236
257
  end
237
258
  end
238
259
 
260
+ def latest_version(track)
261
+ latest_version = tracks.select { |t| t.track == Supply::Tracks::DEFAULT }.map(&:releases).flatten.max_by(&:name)
262
+
263
+ # Check if user specified '--track' option if version information from 'production' track is nil
264
+ if latest_version.nil? && track == Supply::Tracks::DEFAULT
265
+ UI.user_error!(%(Unable to find latest version information from "#{Supply::Tracks::DEFAULT}" track. Please specify track information by using the '--track' option.))
266
+ else
267
+ latest_version = tracks.select { |t| t.track == track }.map(&:releases).flatten.max_by(&:name)
268
+ end
269
+
270
+ return latest_version
271
+ end
272
+
239
273
  #####################################################
240
274
  # @!group Modifying data
241
275
  #####################################################
@@ -244,7 +278,7 @@ module Supply
244
278
  def update_listing_for_language(language: nil, title: nil, short_description: nil, full_description: nil, video: nil)
245
279
  ensure_active_edit!
246
280
 
247
- listing = Androidpublisher::Listing.new({
281
+ listing = AndroidPublisher::Listing.new({
248
282
  language: language,
249
283
  title: title,
250
284
  full_description: full_description,
@@ -253,7 +287,7 @@ module Supply
253
287
  })
254
288
 
255
289
  call_google_api do
256
- client.update_listing(
290
+ client.update_edit_listing(
257
291
  current_package_name,
258
292
  current_edit.id,
259
293
  language,
@@ -266,7 +300,7 @@ module Supply
266
300
  ensure_active_edit!
267
301
 
268
302
  result_upload = call_google_api do
269
- client.upload_apk(
303
+ client.upload_edit_apk(
270
304
  current_package_name,
271
305
  current_edit.id,
272
306
  upload_source: path_to_apk
@@ -306,29 +340,28 @@ module Supply
306
340
  return result_upload.version_code
307
341
  end
308
342
 
309
- # Updates the track for the provided version code(s)
310
- def update_track(track, rollout, apk_version_code)
343
+ # Get a list of all tracks - returns the list
344
+ def tracks(*tracknames)
311
345
  ensure_active_edit!
312
346
 
313
- track_version_codes = apk_version_code.kind_of?(Array) ? apk_version_code : [apk_version_code]
347
+ all_tracks = call_google_api { client.list_edit_tracks(current_package_name, current_edit.id) }.tracks
348
+
349
+ if tracknames.length > 0
350
+ all_tracks = all_tracks.select { |track| tracknames.include?(track.track) }
351
+ end
314
352
 
315
- # This change happened on 2018-04-24
316
- # rollout cannot be sent on any other track besides "rollout"
317
- # https://github.com/fastlane/fastlane/issues/12372
318
- rollout = nil unless track == "rollout"
353
+ return all_tracks
354
+ end
319
355
 
320
- track_body = Androidpublisher::Track.new({
321
- track: track,
322
- user_fraction: rollout,
323
- version_codes: track_version_codes
324
- })
356
+ def update_track(track_name, track_object)
357
+ ensure_active_edit!
325
358
 
326
359
  call_google_api do
327
- client.update_track(
360
+ client.update_edit_track(
328
361
  current_package_name,
329
362
  current_edit.id,
330
- track,
331
- track_body
363
+ track_name,
364
+ track_object
332
365
  )
333
366
  end
334
367
  end
@@ -338,33 +371,27 @@ module Supply
338
371
  ensure_active_edit!
339
372
 
340
373
  begin
341
- result = client.get_track(
374
+ result = client.get_edit_track(
342
375
  current_package_name,
343
376
  current_edit.id,
344
377
  track
345
378
  )
346
- return result.version_codes || []
379
+ return result.releases.flat_map(&:version_codes) || []
347
380
  rescue Google::Apis::ClientError => e
348
381
  return [] if e.status_code == 404 && e.to_s.include?("trackEmpty")
349
382
  raise
350
383
  end
351
384
  end
352
385
 
353
- def update_apk_listing_for_language(apk_listing)
386
+ def upload_changelogs(track, track_name)
354
387
  ensure_active_edit!
355
388
 
356
- apk_listing_object = Androidpublisher::ApkListing.new({
357
- language: apk_listing.language,
358
- recent_changes: apk_listing.recent_changes
359
- })
360
-
361
389
  call_google_api do
362
- client.update_apk_listing(
390
+ client.update_edit_track(
363
391
  current_package_name,
364
- current_edit.id,
365
- apk_listing.apk_version_code,
366
- apk_listing.language,
367
- apk_listing_object
392
+ self.current_edit.id,
393
+ track_name,
394
+ track
368
395
  )
369
396
  end
370
397
  end
@@ -373,12 +400,12 @@ module Supply
373
400
  ensure_active_edit!
374
401
 
375
402
  call_google_api do
376
- client.update_expansion_file(
403
+ client.update_edit_expansionfile(
377
404
  current_package_name,
378
405
  current_edit.id,
379
406
  apk_version_code,
380
407
  expansion_file_type,
381
- Google::Apis::AndroidpublisherV2::ExpansionFile.new(
408
+ AndroidPublisher::ExpansionFile.new(
382
409
  references_version: references_version,
383
410
  file_size: file_size
384
411
  )
@@ -394,7 +421,7 @@ module Supply
394
421
  ensure_active_edit!
395
422
 
396
423
  result = call_google_api do
397
- client.list_images(
424
+ client.list_edit_images(
398
425
  current_package_name,
399
426
  current_edit.id,
400
427
  language,
@@ -402,7 +429,26 @@ module Supply
402
429
  )
403
430
  end
404
431
 
405
- (result.images || []).map(&:url)
432
+ urls = (result.images || []).map(&:url)
433
+ images = urls.map do |url|
434
+ uri = URI.parse(url)
435
+ clean_url = [
436
+ uri.scheme,
437
+ uri.userinfo,
438
+ uri.host,
439
+ uri.port,
440
+ uri.path
441
+ ].join
442
+
443
+ UI.verbose("Initial URL received: '#{url}'")
444
+ UI.verbose("Removed params ('#{uri.query}') from the URL")
445
+ UI.verbose("URL after removing params: '#{clean_url}'")
446
+
447
+ full_url = "#{url}=s0" # '=s0' param ensures full image size is returned (https://github.com/fastlane/fastlane/pull/14322#issuecomment-473012462)
448
+ full_url
449
+ end
450
+
451
+ return images
406
452
  end
407
453
 
408
454
  # @param image_type (e.g. phoneScreenshots, sevenInchScreenshots, ...)
@@ -410,7 +456,7 @@ module Supply
410
456
  ensure_active_edit!
411
457
 
412
458
  call_google_api do
413
- client.upload_image(
459
+ client.upload_edit_image(
414
460
  current_package_name,
415
461
  current_edit.id,
416
462
  language,
@@ -425,7 +471,7 @@ module Supply
425
471
  ensure_active_edit!
426
472
 
427
473
  call_google_api do
428
- client.delete_all_images(
474
+ client.deleteall_edit_image(
429
475
  current_package_name,
430
476
  current_edit.id,
431
477
  language,
@@ -438,7 +484,7 @@ module Supply
438
484
  ensure_active_edit!
439
485
 
440
486
  call_google_api do
441
- client.upload_expansion_file(
487
+ client.upload_edit_expansionfile(
442
488
  current_package_name,
443
489
  current_edit.id,
444
490
  apk_version_code,