fastlane 2.22.0.beta.20170321010023 → 2.22.0

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: 9b9f80b580abe043efd2338aca85a321ab86c672
4
- data.tar.gz: fb22f8621800221d634a49bc01c8951aa367a191
3
+ metadata.gz: cc85c3d22a331b29160c003ee7b6eebd036602f6
4
+ data.tar.gz: 16c1810bd73be99209335cc62e74d07e44be16c3
5
5
  SHA512:
6
- metadata.gz: ededb87eef0d17179a2ab0d547d906eb64e7f77b88de7c459e4678ba8572850daf74b988dd69be43d02d47afaefe68fc75698b2354c163941b1ff684cd9643bb
7
- data.tar.gz: ac135baae6ba2b0ea28141eabb896369feef5410fe52338e1c9c93ff01b2004a4ea6af6f6824ad17d73c9d4337242adb02241da08dcff8e28d01575a0b05b904
6
+ metadata.gz: 80ebbeb5b7f3f160a095e04b91417cfd8d1d6dd5418c6b1af396c91bdfff26a632e3bf860a54dc892ac05d1ad5a92f36221f4b55b3c118364cee1fec2883655a
7
+ data.tar.gz: 83d5ef7998fb3cbc6bcc6321f8a9ffb57f83cc989ceae2d73a664c2515607ec2852d8fca585e2dc221b7e6d2995fbc2a679640dd2eb5e7d53ce22fc0e777848e
@@ -111,6 +111,8 @@ module Fastlane
111
111
  c.syntax = 'fastlane init'
112
112
  c.description = 'Helps you with your initial fastlane setup'
113
113
 
114
+ c.option '-u STRING', '--user STRING', String, 'iOS projects only: Your Apple ID'
115
+
114
116
  CrashlyticsBetaCommandLineHandler.apply_options(c)
115
117
 
116
118
  c.action do |args, options|
@@ -118,7 +120,7 @@ module Fastlane
118
120
  beta_info = CrashlyticsBetaCommandLineHandler.info_from_options(options)
119
121
  Fastlane::CrashlyticsBeta.new(beta_info, Fastlane::CrashlyticsBetaUi.new).run
120
122
  else
121
- Fastlane::Setup.new.run
123
+ Fastlane::Setup.new.run(user: options.user)
122
124
  end
123
125
  end
124
126
  end
@@ -309,7 +311,7 @@ module Fastlane
309
311
  def ensure_fastfile
310
312
  return true if FastlaneCore::FastlaneFolder.setup?
311
313
 
312
- create = UI.confirm('Could not find fastlane in current directory. Would you like to set it up?')
314
+ create = UI.confirm('Could not find fastlane in current directory. Make sure to have your fastlane configuration files inside a folder called "fastlane". Would you like to set fastlane up?')
313
315
  Fastlane::Setup.new.run if create
314
316
  return false
315
317
  end
@@ -1,7 +1,7 @@
1
1
  module Fastlane
2
2
  class Setup
3
3
  # Start the setup process
4
- def run
4
+ def run(user: nil)
5
5
  if FastlaneCore::FastlaneFolder.setup? and !Helper.is_test?
6
6
  UI.important("fastlane is already set up at path #{FastlaneCore::FastlaneFolder.path}")
7
7
  return
@@ -21,7 +21,7 @@ module Fastlane
21
21
  end
22
22
 
23
23
  if platform == :ios
24
- SetupIos.new.run
24
+ SetupIos.new.run(user: user)
25
25
  elsif platform == :android
26
26
  SetupAndroid.new.run
27
27
  else
@@ -14,7 +14,8 @@ module Fastlane
14
14
  attr_accessor :app_identifier
15
15
  attr_accessor :app_name
16
16
 
17
- def run
17
+ def run(user: nil)
18
+ self.apple_id = user
18
19
  show_infos
19
20
 
20
21
  FastlaneCore::FastlaneFolder.create_folder! unless Helper.is_test?
@@ -36,7 +37,15 @@ module Fastlane
36
37
  manual_setup
37
38
  end
38
39
  UI.success('Successfully finished setting up fastlane')
40
+ rescue Spaceship::Client::InsufficientPermissions, Spaceship::Client::ProgramLicenseAgreementUpdated => ex
41
+ # We don't want to fallback to manual onboarding for this
42
+ # as the user needs to first accept the agreement / get more permissions
43
+ # Let's re-raise the exception to properly show the error message
44
+ raise ex
39
45
  rescue => ex # this will also be caused by Ctrl + C
46
+ UI.message("Ran into error while trying to connect to iTunes Connect / Dev Portal: #{ex}")
47
+ UI.message("Falling back to manual onboarding")
48
+
40
49
  if is_manual_setup
41
50
  handle_exception(exception: ex)
42
51
  else
@@ -45,7 +54,6 @@ module Fastlane
45
54
  try_manual_setup
46
55
  end
47
56
  end
48
- # rubocop:enable Lint/RescueException
49
57
  end
50
58
 
51
59
  def handle_exception(exception: nil)
@@ -178,7 +186,7 @@ module Fastlane
178
186
  def detect_if_app_is_available
179
187
  require 'spaceship'
180
188
 
181
- UI.important "Verifying if app is available on the Apple Developer Portal and iTunes Connect..."
189
+ UI.important "Verifying that app is available on the Apple Developer Portal and iTunes Connect..."
182
190
  UI.message "Starting login with user '#{self.apple_id}'"
183
191
  Spaceship.login(self.apple_id, nil)
184
192
  self.dev_portal_team = Spaceship.select_team
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.22.0.beta.20170321010023'.freeze
2
+ VERSION = '2.22.0'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -13,7 +13,9 @@ module FastlaneCore
13
13
 
14
14
  # Path to the Fastfile inside the fastlane folder. This is nil when none is available
15
15
  def self.fastfile_path
16
- path = File.join(self.path || '.', 'Fastfile')
16
+ return nil if self.path.nil?
17
+
18
+ path = File.join(self.path, 'Fastfile')
17
19
  return path if File.exist?(path)
18
20
  return nil
19
21
  end
@@ -51,6 +51,12 @@ module Spaceship
51
51
  # Raised when no user credentials were passed at all
52
52
  class NoUserCredentialsError < BasicPreferredInfoError; end
53
53
 
54
+ class ProgramLicenseAgreementUpdated < BasicPreferredInfoError
55
+ def show_github_issues
56
+ false
57
+ end
58
+ end
59
+
54
60
  # User doesn't have enough permission for given action
55
61
  class InsufficientPermissions < BasicPreferredInfoError
56
62
  TITLE = 'Insufficient permissions for your Apple ID:'.freeze
@@ -446,10 +452,7 @@ module Spaceship
446
452
  content = expected_key ? response.body[expected_key] : response.body
447
453
  end
448
454
  if content.nil?
449
- # Check if the failure is due to missing permissions (iTunes Connect)
450
- if response.body && response.body["messages"] && response.body["messages"]["error"].include?("Forbidden")
451
- raise_insuffient_permission_error!
452
- end
455
+ detect_most_common_errors_and_raise_exceptions(response.body) if response.body
453
456
  raise UnexpectedResponse, response.body
454
457
  elsif content.kind_of?(Hash) && (content["resultString"] || "").include?("NotAllowed")
455
458
  # example content when doing a Developer Portal action with not enough permission
@@ -469,6 +472,15 @@ module Spaceship
469
472
  end
470
473
  end
471
474
 
475
+ def detect_most_common_errors_and_raise_exceptions(body)
476
+ # Check if the failure is due to missing permissions (iTunes Connect)
477
+ if body["messages"] && body["messages"]["error"].include?("Forbidden")
478
+ raise_insuffient_permission_error!
479
+ elsif (body["resultString"] || "").include?("Program License Agreement")
480
+ raise ProgramLicenseAgreementUpdated, "#{body['userString']} Please manually log into iTunes Connect to review and accept the updated agreement."
481
+ end
482
+ end
483
+
472
484
  # This also gets called from subclasses
473
485
  def raise_insuffient_permission_error!(additional_error_string: nil)
474
486
  # get the method name of the request that failed
@@ -107,6 +107,7 @@ module Spaceship
107
107
  # @param mac [Bool] Searches Mac apps if true
108
108
  # @return (App) The app you're looking for. This is nil if the app can't be found.
109
109
  def find(bundle_id, mac: false)
110
+ raise "`bundle_id` parameter must not be nil" if bundle_id.nil?
110
111
  all(mac: mac).find do |app|
111
112
  return app if app.bundle_id.casecmp(bundle_id) == 0
112
113
  end
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.22.0.beta.20170321010023
4
+ version: 2.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -1296,23 +1296,23 @@ metadata:
1296
1296
  post_install_message:
1297
1297
  rdoc_options: []
1298
1298
  require_paths:
1299
- - snapshot/lib
1299
+ - cert/lib
1300
+ - credentials_manager/lib
1301
+ - deliver/lib
1302
+ - fastlane/lib
1303
+ - fastlane_core/lib
1300
1304
  - frameit/lib
1301
- - scan/lib
1305
+ - gym/lib
1306
+ - match/lib
1302
1307
  - pem/lib
1303
- - credentials_manager/lib
1304
- - spaceship/lib
1308
+ - pilot/lib
1305
1309
  - produce/lib
1310
+ - scan/lib
1306
1311
  - screengrab/lib
1307
1312
  - sigh/lib
1313
+ - snapshot/lib
1314
+ - spaceship/lib
1308
1315
  - supply/lib
1309
- - fastlane/lib
1310
- - gym/lib
1311
- - fastlane_core/lib
1312
- - cert/lib
1313
- - deliver/lib
1314
- - match/lib
1315
- - pilot/lib
1316
1316
  required_ruby_version: !ruby/object:Gem::Requirement
1317
1317
  requirements:
1318
1318
  - - ">="
@@ -1320,14 +1320,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
1320
1320
  version: 2.0.0
1321
1321
  required_rubygems_version: !ruby/object:Gem::Requirement
1322
1322
  requirements:
1323
- - - ">"
1323
+ - - ">="
1324
1324
  - !ruby/object:Gem::Version
1325
- version: 1.3.1
1325
+ version: '0'
1326
1326
  requirements: []
1327
1327
  rubyforge_project:
1328
- rubygems_version: 2.4.5.2
1328
+ rubygems_version: 2.6.10
1329
1329
  signing_key:
1330
1330
  specification_version: 4
1331
1331
  summary: The easiest way to automate beta deployments and releases for your iOS and
1332
1332
  Android apps
1333
1333
  test_files: []
1334
+ has_rdoc: