fastlane 2.24.0.beta.20170325010032 → 2.24.0.beta.20170326010023

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: 4da0188d70f1c82ed98e961d6000101cc022fa64
4
- data.tar.gz: 7d6ddc6fbbc017bc190e8714d3dfdc9cc2b72690
3
+ metadata.gz: ee5443da2a8d0d17ca3794615aaa3db73b8057fa
4
+ data.tar.gz: 9fa5e789cbb425128d2cf8f35fcc321b3f06c9f8
5
5
  SHA512:
6
- metadata.gz: 20890b23d73343e1306dea19afa46a752481e0043ef22e3fabe2b3f5896c8401f84ec1780d10ec304502d0483c24a75432401eb9cce015e7afcfd3fdc8cde1ba
7
- data.tar.gz: c91d1a60513d3cbd4d9a6ff5a5f6d4bb771339316ea10b504d8cc2d1a87f40c00c31ea813030eab9fdfde5c356a2a85eb300defc3041fe4eed814acd5d099446
6
+ metadata.gz: a7212cc10b5bb3147ab2c469669ec6bdc5697a1a6d9eba871919b9696afffa02a9a1266a2bbcbc3819f776c281c4f9addfa7a052295e6ee58f377dad9a678197
7
+ data.tar.gz: 23cad7f6277fc2888fd6f46b4b32eed878d4ef53c555e861c833903204008882c2a712fc313e23174a3797f916931c69dde8f4dd82ca4d3e6de4553e3b4e0759
@@ -255,6 +255,8 @@ module Fastlane
255
255
  rescue FastlaneCore::Interface::FastlaneError => e # user_error!
256
256
  collector.did_raise_error(method_sym)
257
257
  raise e
258
+ rescue FastlaneCore::Interface::FastlaneTestFailure => e # test_failure!
259
+ raise e
258
260
  rescue Exception => e # rubocop:disable Lint/RescueException
259
261
  # high chance this is actually FastlaneCore::Interface::FastlaneCrash, but can be anything else
260
262
  # Catches all exceptions, since some plugins might use system exits to get out
@@ -14,6 +14,11 @@ module Fastlane
14
14
  elsif is_android?
15
15
  UI.message("Detected Android project in current directory...")
16
16
  platform = :android
17
+ elsif is_react_native?
18
+ UI.important("Detected react-native app. To set up fastlane, please run")
19
+ UI.command("fastlane init")
20
+ UI.important("in the sub-folder for each platform (\"ios\" or \"android\")")
21
+ UI.user_error!("Please navigate to the platform subfolder and run `fastlane init` again")
17
22
  else
18
23
  UI.important("Couldn't automatically detect the platform")
19
24
  val = UI.confirm("Is this project an iOS project?")
@@ -37,6 +42,10 @@ module Fastlane
37
42
  Dir["*.gradle"].count > 0
38
43
  end
39
44
 
45
+ def is_react_native?
46
+ SetupIos.project_uses_react_native?(path: "./ios")
47
+ end
48
+
40
49
  def show_analytics
41
50
  UI.message("fastlane will send the number of errors for each action to")
42
51
  UI.message("https://github.com/fastlane/enhancer to detect integration issues")
@@ -23,9 +23,11 @@ module Fastlane
23
23
  FastlaneCore::FastlaneFolder.create_folder! unless Helper.is_test?
24
24
  is_manual_setup = false
25
25
 
26
+ setup_project
27
+ react_native_pre_checks
28
+ ask_for_apple_id
29
+
26
30
  begin
27
- setup_project
28
- ask_for_apple_id
29
31
  if self.project.mac?
30
32
  UI.important("Generating apps on the Apple Developer Portal and iTunes Connect is not currently available for Mac apps")
31
33
  else
@@ -36,6 +38,7 @@ module Fastlane
36
38
  default_setup
37
39
  else
38
40
  is_manual_setup = true
41
+ UI.message("Falling back to manual onboarding")
39
42
  manual_setup
40
43
  end
41
44
  UI.success('Successfully finished setting up fastlane')
@@ -72,6 +75,29 @@ module Fastlane
72
75
  handle_exception(exception: ex)
73
76
  end
74
77
 
78
+ # React Native specific code
79
+ # Make it easy for people to onboard
80
+ def react_native_pre_checks
81
+ return unless self.class.project_uses_react_native?
82
+ if app_identifier.to_s.length == 0
83
+ error_message = []
84
+ error_message << "Could not detect bundle identifier of your react-native app."
85
+ error_message << "Make sure to open the Xcode project and update the bundle identifier"
86
+ error_message << "in the `General` section of your project settings."
87
+ error_message << "Restart `fastlane init` once you're done!"
88
+ UI.user_error!(error_message.join(" "))
89
+ end
90
+ end
91
+
92
+ def self.project_uses_react_native?(path: Dir.pwd)
93
+ package_json = File.join(path, "..", "package.json")
94
+ return false unless File.basename(path) == "ios"
95
+ return false unless File.exist?(package_json)
96
+ package_content = File.read(package_json)
97
+ return true if package_content.include?("react-native")
98
+ false
99
+ end
100
+
75
101
  def default_setup
76
102
  copy_existing_files
77
103
  generate_appfile(manually: false)
@@ -1,4 +1,4 @@
1
1
  module Fastlane
2
- VERSION = '2.24.0.beta.20170325010032'.freeze
2
+ VERSION = '2.24.0.beta.20170326010023'.freeze
3
3
  DESCRIPTION = "The easiest way to automate beta deployments and releases for your iOS and Android apps".freeze
4
4
  end
@@ -66,6 +66,8 @@ module Commander
66
66
  collector.did_raise_error(@program[:name])
67
67
  show_github_issues(e.message) if e.show_github_issues
68
68
  display_user_error!(e, e.message)
69
+ rescue FastlaneCore::Interface::FastlaneTestFailure => e # test_failure!
70
+ display_user_error!(e, e.to_s)
69
71
  rescue Faraday::SSLError => e # SSL issues are very common
70
72
  handle_ssl_error!(e)
71
73
  rescue Faraday::ConnectionFailed => e
@@ -126,6 +126,10 @@ module FastlaneCore
126
126
  end
127
127
  end
128
128
 
129
+ # raised from test_failure!
130
+ class FastlaneTestFailure < StandardError
131
+ end
132
+
129
133
  # Pass an exception to this method to exit the program
130
134
  # using the given exception
131
135
  # Use this method instead of user_error! if this error is
@@ -146,6 +150,15 @@ module FastlaneCore
146
150
  raise FastlaneError.new(options), error_message.to_s
147
151
  end
148
152
 
153
+ # Use this method to exit the program because of a test failure
154
+ # that's caused by the source code of the user. Example for this
155
+ # is that scan will fail when the tests fail.
156
+ # By using this method we'll get more accurate results on the
157
+ # fastlane failures on enhancer
158
+ def test_failure!(error_message)
159
+ raise FastlaneTestFailure.new, error_message
160
+ end
161
+
149
162
  #####################################################
150
163
  # @!group Helpers
151
164
  #####################################################
@@ -7,6 +7,7 @@ module Match
7
7
  from ||= ChangePassword.ask_password(message: "Old passphrase for Git Repo: ", confirm: true)
8
8
  GitHelper.clear_changes
9
9
  workspace = GitHelper.clone(params[:git_url], params[:shallow_clone], manual_password: from, skip_docs: params[:skip_docs], branch: params[:git_branch])
10
+ GitHelper.check_push_repo_permission(workspace, params[:git_branch])
10
11
  Encrypt.new.clear_password(params[:git_url])
11
12
  Encrypt.new.store_password(params[:git_url], to)
12
13
 
@@ -156,5 +156,28 @@ module Match
156
156
  end
157
157
  end
158
158
  end
159
+
160
+ # Checks push permission to git repo
161
+ def self.repo_pushable?(path, branch = "master")
162
+ Dir.chdir(path) do
163
+ command = "GIT_TERMINAL_PROMPT=0 git push origin #{branch.shellescape} --dry-run"
164
+ FastlaneCore::CommandExecutor.execute(command: command,
165
+ print_all: FastlaneCore::Globals.verbose?,
166
+ print_command: FastlaneCore::Globals.verbose?)
167
+ end
168
+ return true
169
+ rescue => ex
170
+ UI.error("No permission to push...")
171
+ UI.error(ex)
172
+ return false
173
+ end
174
+
175
+ def self.check_push_repo_permission(path, branch = "master")
176
+ unless repo_pushable?(path, branch)
177
+ UI.error("You do not have push permission to git repository provided")
178
+ UI.error("_match_ needs to create a new certificate or provisioning profile, however without push access to the git repo, the generated certificate can't be stored properly, resulting in an unused certificate")
179
+ UI.user_error!("Please grant push access for the current git user to the git repo, so that _match_ can update and create certificates for you")
180
+ end
181
+ end
159
182
  end
160
183
  end
@@ -26,6 +26,8 @@ module Match
26
26
  UI.user_error!("`fastlane match nuke` doesn't delete anything when running with --readonly enabled")
27
27
  end
28
28
 
29
+ GitHelper.check_push_repo_permission(params[:workspace], params[:git_branch])
30
+
29
31
  if (self.certs + self.profiles + self.files).count > 0
30
32
  unless params[:skip_confirmation]
31
33
  UI.error "---"
@@ -74,6 +74,7 @@ module Match
74
74
  if certs.count == 0 or keys.count == 0
75
75
  UI.important "Couldn't find a valid code signing identity in the git repo for #{cert_type}... creating one for you now"
76
76
  UI.crash!("No code signing identity found and can not create a new one because you enabled `readonly`") if params[:readonly]
77
+ GitHelper.check_push_repo_permission(params[:workspace], params[:git_branch])
77
78
  cert_path = Generator.generate_certificate(params, cert_type)
78
79
  self.changes_to_commit = true
79
80
  else
@@ -127,6 +128,8 @@ module Match
127
128
  UI.error "If you are certain that a profile should exist, double-check the recent changes to your match repository"
128
129
  UI.user_error! "No matching provisioning profiles found and can not create a new one because you enabled `readonly`. Check the output above for more information."
129
130
  end
131
+
132
+ GitHelper.check_push_repo_permission(params[:workspace], params[:git_branch])
130
133
  profile = Generator.generate_provisioning_profile(params: params,
131
134
  prov_type: prov_type,
132
135
  certificate_id: certificate_id,
@@ -83,12 +83,12 @@ module Scan
83
83
 
84
84
  report_collector.parse_raw_file(TestCommandGenerator.xcodebuild_log_path)
85
85
 
86
- unless tests_exit_status == 0
87
- UI.user_error!("Test execution failed. Exit status: #{tests_exit_status}")
86
+ if result[:failures] > 0
87
+ UI.test_failure!("Tests have failed")
88
88
  end
89
89
 
90
- unless result[:failures] == 0
91
- UI.user_error!("Tests failed")
90
+ unless tests_exit_status == 0
91
+ UI.test_failure!("Test execution failed. Exit status: #{tests_exit_status}")
92
92
  end
93
93
  end
94
94
 
@@ -59,7 +59,7 @@ module Snapshot
59
59
 
60
60
  print_results(results)
61
61
 
62
- UI.user_error!(self.collected_errors.join('; ')) if self.collected_errors.count > 0
62
+ UI.test_failure!(self.collected_errors.join('; ')) if self.collected_errors.count > 0
63
63
 
64
64
  # Generate HTML report
65
65
  ReportsGenerator.new.generate
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.24.0.beta.20170325010032
4
+ version: 2.24.0.beta.20170326010023
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -14,7 +14,7 @@ authors:
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
- date: 2017-03-25 00:00:00.000000000 Z
17
+ date: 2017-03-26 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: slack-notifier
@@ -1296,23 +1296,23 @@ metadata:
1296
1296
  post_install_message:
1297
1297
  rdoc_options: []
1298
1298
  require_paths:
1299
- - frameit/lib
1300
- - produce/lib
1301
- - sigh/lib
1299
+ - scan/lib
1302
1300
  - supply/lib
1303
- - fastlane_core/lib
1304
- - snapshot/lib
1305
- - deliver/lib
1306
- - cert/lib
1307
- - fastlane/lib
1308
- - credentials_manager/lib
1309
- - spaceship/lib
1310
1301
  - gym/lib
1302
+ - fastlane/lib
1311
1303
  - match/lib
1304
+ - deliver/lib
1312
1305
  - pilot/lib
1306
+ - produce/lib
1307
+ - credentials_manager/lib
1313
1308
  - screengrab/lib
1314
- - scan/lib
1309
+ - sigh/lib
1310
+ - spaceship/lib
1311
+ - snapshot/lib
1315
1312
  - pem/lib
1313
+ - fastlane_core/lib
1314
+ - cert/lib
1315
+ - frameit/lib
1316
1316
  required_ruby_version: !ruby/object:Gem::Requirement
1317
1317
  requirements:
1318
1318
  - - ">="