fastlane_core 0.41.2 → 0.41.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc7a618468b31d828fe31bccc19aba85306c5c17
4
- data.tar.gz: 9e3a24d90de9e34ed39cbfc822f5562a7f974357
3
+ metadata.gz: 3501dde8a99eaa2d37c5f5052a5835ff93a09384
4
+ data.tar.gz: 9802e017e03259a343f54976ff928b936bdb482c
5
5
  SHA512:
6
- metadata.gz: 6ad82711a64a3bddd7737e0c04724e4a22cdcbce13d192804efe52dce48016f068ff3a188bb4a0f2a649f4db60d9dfc64ce9dba818c3567ecee5c9541ac218f3
7
- data.tar.gz: 75f974ac1727bb8c7c778f6f350f4f5e79ffe2e80fa13931991267072284549f7659a5f9929fd19b9f67400057f45f5f73d4c1725e9f9073aef0bd17d10f5441
6
+ metadata.gz: 3da7e12d5a745ad709035348a8b2dd1d5b9d1b8e2b1bb76634283f891bd1f12a042a28ec0d75aaa6ec8126eca4e4a565b93a370fb2ee01bf9d98c72f46c42159
7
+ data.tar.gz: b7b51581a819640271b43f15599ebb7121c7b10de4d1f8ffd13b8bffb2f5e2207d5eb7adaa365a2a69be72dc9d1497e60c523b41fbcaa287e37e3aa956b07412
@@ -48,7 +48,8 @@ module FastlaneCore
48
48
 
49
49
  def self.wwdr_certificate_installed?
50
50
  certificate_name = "Apple Worldwide Developer Relations Certification Authority"
51
- response = Helper.backticks("security find-certificate -c '#{certificate_name}'", print: $verbose)
51
+ keychain = wwdr_keychain
52
+ response = Helper.backticks("security find-certificate -c '#{certificate_name}' #{keychain}", print: $verbose)
52
53
  return response.include?("attributes:")
53
54
  end
54
55
 
@@ -56,11 +57,28 @@ module FastlaneCore
56
57
  Dir.chdir('/tmp') do
57
58
  url = 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer'
58
59
  filename = File.basename(url)
59
- `curl -O #{url} && security import #{filename} -k login.keychain`
60
+ keychain = wwdr_keychain
61
+ keychain.prepend("-k ") unless keychain.empty?
62
+ `curl -O #{url} && security import #{filename} #{keychain}`
60
63
  UI.user_error!("Could not install WWDR certificate") unless $?.success?
61
64
  end
62
65
  end
63
66
 
67
+ def self.wwdr_keychain
68
+ priority = [
69
+ "security list-keychains -d user",
70
+ "security default-keychain -d user"
71
+ ]
72
+ priority.each do |command|
73
+ keychains = Helper.backticks(command, print: $verbose).split("\n")
74
+ unless keychains.empty?
75
+ # Select first keychain name from returned keychains list
76
+ return keychains[0].strip.tr('"', '').split(File::SEPARATOR)[-1]
77
+ end
78
+ end
79
+ return ""
80
+ end
81
+
64
82
  def self.sha1_fingerprint(path)
65
83
  result = `openssl x509 -in "#{path}" -inform der -noout -sha1 -fingerprint`
66
84
  begin
@@ -151,6 +151,7 @@ module FastlaneCore
151
151
 
152
152
  # @return the full path to the iTMSTransporter executable
153
153
  def self.itms_path
154
+ return ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"] if ENV["FASTLANE_ITUNES_TRANSPORTER_PATH"]
154
155
  return '' unless self.is_mac? # so tests work on Linx too
155
156
 
156
157
  [
@@ -37,25 +37,35 @@ module FastlaneCore
37
37
 
38
38
  begin
39
39
  PTY.spawn(command) do |stdin, stdout, pid|
40
- stdin.each do |line|
41
- parse_line(line, hide_output) # this is where the parsing happens
40
+ begin
41
+ stdin.each do |line|
42
+ parse_line(line, hide_output) # this is where the parsing happens
43
+ end
44
+ rescue Errno::EIO
45
+ # Exception ignored intentionally.
46
+ # https://stackoverflow.com/questions/10238298/ruby-on-linux-pty-goes-away-without-eof-raises-errnoeio
47
+ ensure
48
+ Process.wait(pid)
42
49
  end
43
50
  end
44
51
  rescue => ex
45
- UI.error(ex.to_s)
46
52
  @errors << ex.to_s
47
53
  end
48
54
 
55
+ exit_status = $?.exitstatus
56
+ unless exit_status.zero?
57
+ @errors << "The call to the iTMSTransporter completed with a non-zero exit status: #{exit_status}. This indicates a failure."
58
+ end
59
+
49
60
  if @warnings.count > 0
50
61
  UI.important(@warnings.join("\n"))
51
62
  end
52
63
 
53
64
  if @errors.count > 0
54
65
  UI.error(@errors.join("\n"))
55
- return false
56
66
  end
57
67
 
58
- true
68
+ @errors.count.zero?
59
69
  end
60
70
 
61
71
  private
@@ -139,6 +149,18 @@ module FastlaneCore
139
149
  ].join(' ')
140
150
  end
141
151
 
152
+ def handle_error(password)
153
+ # rubocop:disable Style/CaseEquality
154
+ unless /^[0-9a-zA-Z\.\$\_]*$/ === password
155
+ UI.error([
156
+ "Password contains special characters, which may not be handled properly by iTMSTransporter.",
157
+ "If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters."
158
+ ].join(' '))
159
+ end
160
+ # rubocop:enable Style/CaseEquality
161
+ UI.error("Could not download/upload from iTunes Connect! It's probably related to your password or your internet connection.")
162
+ end
163
+
142
164
  private
143
165
 
144
166
  def shell_escaped_password(password)
@@ -204,6 +226,14 @@ module FastlaneCore
204
226
  ].join(' ')
205
227
  end
206
228
 
229
+ def handle_error(password)
230
+ unless File.exist?(Helper.transporter_java_jar_path)
231
+ UI.error("The iTMSTransporter Java app was not found at '#{Helper.transporter_java_jar_path}'.")
232
+ UI.error("If you're using Xcode 6, please select the shell script executor by setting the environment variable "\
233
+ "FASTLANE_ITUNES_TRANSPORTER_USE_SHELL_SCRIPT=1")
234
+ end
235
+ end
236
+
207
237
  def execute(command, hide_output)
208
238
  # The Java command needs to be run starting in a working directory in the iTMSTransporter
209
239
  # file area. The shell script takes care of changing directories over to there, but we'll
@@ -301,15 +331,7 @@ module FastlaneCore
301
331
  private
302
332
 
303
333
  def handle_error(password)
304
- # rubocop:disable Style/CaseEquality
305
- unless /^[0-9a-zA-Z\.\$\_]*$/ === password
306
- UI.error([
307
- "Password contains special characters, which may not be handled properly by iTMSTransporter.",
308
- "If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters."
309
- ].join(' '))
310
- end
311
- # rubocop:enable Style/CaseEquality
312
- UI.error("Could not download/upload from iTunes Connect! It's probably related to your password or your internet connection.")
334
+ @transporter_executor.handle_error(password)
313
335
  end
314
336
  end
315
337
  end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.41.2".freeze
2
+ VERSION = "0.41.3".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.41.2
4
+ version: 0.41.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-04 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json