fastlane_core 0.22.3 → 0.23.0
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 +4 -4
- data/lib/fastlane_core.rb +1 -0
- data/lib/fastlane_core/crash_reporting/clean_stack_trace.rb +18 -0
- data/lib/fastlane_core/crash_reporting/crash_reporting.rb +65 -0
- data/lib/fastlane_core/version.rb +1 -1
- metadata +19 -7
- data/lib/fastlane_core/itunes_connect/itunes_connect.rb +0 -64
- data/lib/fastlane_core/itunes_connect/itunes_connect_apple_id.rb +0 -15
- data/lib/fastlane_core/itunes_connect/itunes_connect_helper.rb +0 -85
- data/lib/fastlane_core/itunes_connect/itunes_connect_login.rb +0 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1ba9d9232242ae13d67b8a32b91d12aa0d1890d
|
4
|
+
data.tar.gz: 10deb2e04b0cadacc3c5f24f1a53e99fb60be0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 055fffb2f956839bdf59129d3ea9b6ff0e36bc62f46442080a5b8db454f8c6e4e5ca671e86e63d9fa127e579e5ad22c6c5d00d64152b4e3d4fb261af8eb07ef8
|
7
|
+
data.tar.gz: 8c1132b2455d671470e2c0ff25e41d96dd000263ad2e7d0a5888651084f4e12e0d61a4f7dd432c546065157aebcc2917b43e636ff0858234f0d952ff9c9c4268
|
data/lib/fastlane_core.rb
CHANGED
@@ -14,6 +14,7 @@ require 'fastlane_core/ipa_upload_package_builder'
|
|
14
14
|
require 'fastlane_core/print_table'
|
15
15
|
require 'fastlane_core/project'
|
16
16
|
require 'fastlane_core/simulator'
|
17
|
+
require 'fastlane_core/crash_reporting/crash_reporting'
|
17
18
|
|
18
19
|
# Third Party code
|
19
20
|
require 'colored'
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Raven
|
2
|
+
# This class gets rid of the user folder, as we don't want to share the username
|
3
|
+
class Processor
|
4
|
+
class CleanStackTrace < Processor
|
5
|
+
def process(value)
|
6
|
+
if value[:exception]
|
7
|
+
value[:exception][:values].each do |single_exception|
|
8
|
+
single_exception[:stacktrace][:frames].each do |current|
|
9
|
+
current[:abs_path].gsub!(Dir.home, "~")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
return value
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
module FastlaneCore
|
2
|
+
class CrashReporting
|
3
|
+
URL = 'https://02c6a8be5bd4425389706655f3657f5c:de62aa2bffe643948ea6f81354adb8d6@app.getsentry.com/55281'
|
4
|
+
class << self
|
5
|
+
def file_path
|
6
|
+
File.expand_path(File.join('~/.fastlane_crash_reporting'))
|
7
|
+
end
|
8
|
+
|
9
|
+
def enable
|
10
|
+
File.write(file_path, "1")
|
11
|
+
puts "Successfully enabled crash reporting for future crashes".green
|
12
|
+
puts "This will only send the stack trace the installed gems to sentry".green
|
13
|
+
puts "Thanks for helping making fastlane better".green
|
14
|
+
end
|
15
|
+
|
16
|
+
def enabled?
|
17
|
+
File.exist?(file_path)
|
18
|
+
end
|
19
|
+
|
20
|
+
def show_message
|
21
|
+
puts "-------------------------------------------------------------------------------------------".yellow
|
22
|
+
puts "😨 An error occured. Please enable crash reports using `fastlane enable_crash_reporting`".yellow
|
23
|
+
puts "👍 This makes resolving issues much easier and helps improving fastlane".yellow
|
24
|
+
puts "🔒 The reports might contain personal data, but will be stored securely on getsentry.com".yellow
|
25
|
+
puts "✨ Once crash reporting is enabled, you have much cleaner output when something goes wrong".yellow
|
26
|
+
puts "-------------------------------------------------------------------------------------------".yellow
|
27
|
+
end
|
28
|
+
|
29
|
+
def handle_crash(ex)
|
30
|
+
unless enabled?
|
31
|
+
show_message
|
32
|
+
raise ex
|
33
|
+
end
|
34
|
+
|
35
|
+
raise ex if Helper.test?
|
36
|
+
|
37
|
+
send_crash(ex)
|
38
|
+
end
|
39
|
+
|
40
|
+
def send_crash(ex)
|
41
|
+
# https://github.com/getsentry/raven-ruby/wiki/Advanced-Configuration
|
42
|
+
require 'raven'
|
43
|
+
require 'json'
|
44
|
+
require 'fastlane_core/crash_reporting/clean_stack_trace'
|
45
|
+
|
46
|
+
Raven.configure do |config|
|
47
|
+
config.dsn = URL
|
48
|
+
config.logger = Logger.new('/dev/null') # we couldn't care less
|
49
|
+
config.sanitize_fields = %w(server_name)
|
50
|
+
config.processors << Raven::Processor::CleanStackTrace
|
51
|
+
end
|
52
|
+
|
53
|
+
Raven::Context.clear! # we don't want to transfer things like the host name
|
54
|
+
crash = Raven.capture_exception(ex)
|
55
|
+
path = "/tmp/sentry_#{crash.id}.json"
|
56
|
+
File.write(path, JSON.pretty_generate(crash.to_hash))
|
57
|
+
puts "Successfully submitted crash report. If this is a problem with one of the tools you want to report".yellow
|
58
|
+
puts "please submit an issue on GitHub and attach the following number to it: '#{crash.id}'".yellow
|
59
|
+
puts "Also stored the crash report locally '#{path}'".yellow
|
60
|
+
rescue => ex
|
61
|
+
Helper.log.debug ex # We don't want crash reporting to cause crash
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
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.
|
4
|
+
version: 0.23.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 1.4.5
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: sentry-raven
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.15'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.15'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: credentials_manager
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -355,13 +369,11 @@ files:
|
|
355
369
|
- lib/fastlane_core/configuration/config_item.rb
|
356
370
|
- lib/fastlane_core/configuration/configuration.rb
|
357
371
|
- lib/fastlane_core/configuration/configuration_file.rb
|
372
|
+
- lib/fastlane_core/crash_reporting/clean_stack_trace.rb
|
373
|
+
- lib/fastlane_core/crash_reporting/crash_reporting.rb
|
358
374
|
- lib/fastlane_core/helper.rb
|
359
375
|
- lib/fastlane_core/ipa_file_analyser.rb
|
360
376
|
- lib/fastlane_core/ipa_upload_package_builder.rb
|
361
|
-
- lib/fastlane_core/itunes_connect/itunes_connect.rb
|
362
|
-
- lib/fastlane_core/itunes_connect/itunes_connect_apple_id.rb
|
363
|
-
- lib/fastlane_core/itunes_connect/itunes_connect_helper.rb
|
364
|
-
- lib/fastlane_core/itunes_connect/itunes_connect_login.rb
|
365
377
|
- lib/fastlane_core/itunes_search_api.rb
|
366
378
|
- lib/fastlane_core/itunes_transporter.rb
|
367
379
|
- lib/fastlane_core/languages.rb
|
@@ -391,7 +403,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
403
|
version: '0'
|
392
404
|
requirements: []
|
393
405
|
rubyforge_project:
|
394
|
-
rubygems_version: 2.4.
|
406
|
+
rubygems_version: 2.4.6
|
395
407
|
signing_key:
|
396
408
|
specification_version: 4
|
397
409
|
summary: Contains all shared code/dependencies of the fastlane.tools
|
@@ -1,64 +0,0 @@
|
|
1
|
-
require 'capybara'
|
2
|
-
require 'capybara/poltergeist'
|
3
|
-
require 'credentials_manager/password_manager'
|
4
|
-
require 'phantomjs/poltergeist' # this will download and store phantomjs
|
5
|
-
|
6
|
-
require 'fastlane_core/itunes_connect/itunes_connect_helper.rb'
|
7
|
-
require 'fastlane_core/itunes_connect/itunes_connect_login.rb'
|
8
|
-
require 'fastlane_core/itunes_connect/itunes_connect_apple_id.rb'
|
9
|
-
|
10
|
-
module FastlaneCore
|
11
|
-
# Everything that can't be achived using the {FastlaneCore::ItunesTransporter}
|
12
|
-
# will be scripted using the iTunesConnect frontend.
|
13
|
-
#
|
14
|
-
# Every method you call here, might take a time
|
15
|
-
class ItunesConnect
|
16
|
-
# This error occurs only if there is something wrong with the given login data
|
17
|
-
class ItunesConnectLoginError < StandardError
|
18
|
-
end
|
19
|
-
|
20
|
-
# This error can occur for many reaons. It is
|
21
|
-
# usually raised when an UI element could not be found
|
22
|
-
class ItunesConnectGeneralError < StandardError
|
23
|
-
end
|
24
|
-
|
25
|
-
include Capybara::DSL
|
26
|
-
|
27
|
-
ITUNESCONNECT_URL = "https://itunesconnect.apple.com/"
|
28
|
-
APP_DETAILS_URL = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/ng/app/[[app_id]]"
|
29
|
-
|
30
|
-
BUTTON_STRING_NEW_VERSION = "New Version"
|
31
|
-
BUTTON_STRING_SUBMIT_FOR_REVIEW = "Submit for Review"
|
32
|
-
|
33
|
-
WAITING_FOR_REVIEW = "Waiting For Review"
|
34
|
-
|
35
|
-
def initialize
|
36
|
-
super
|
37
|
-
|
38
|
-
return if Helper.is_test?
|
39
|
-
|
40
|
-
Capybara.run_server = false
|
41
|
-
Capybara.default_driver = :poltergeist
|
42
|
-
Capybara.javascript_driver = :poltergeist
|
43
|
-
Capybara.current_driver = :poltergeist
|
44
|
-
Capybara.app_host = ITUNESCONNECT_URL
|
45
|
-
|
46
|
-
# Since Apple has some SSL errors, we have to configure the client properly:
|
47
|
-
# https://github.com/ariya/phantomjs/issues/11239
|
48
|
-
Capybara.register_driver :poltergeist do |a|
|
49
|
-
conf = ['--debug=no', '--ignore-ssl-errors=yes', '--ssl-protocol=TLSv1']
|
50
|
-
Capybara::Poltergeist::Driver.new(a, {
|
51
|
-
phantomjs: Phantomjs.path,
|
52
|
-
phantomjs_options: conf,
|
53
|
-
phantomjs_logger: File.open("/tmp/poltergeist_log.txt", "a"),
|
54
|
-
js_errors: false,
|
55
|
-
timeout: 90
|
56
|
-
})
|
57
|
-
end
|
58
|
-
|
59
|
-
page.driver.headers = { "Accept-Language" => "en" }
|
60
|
-
|
61
|
-
login
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
module FastlaneCore
|
2
|
-
# Find the Apple ID based on the App Identifier
|
3
|
-
class ItunesConnect
|
4
|
-
LIST_APPLE_IDS_URL = "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/manageyourapps/summary"
|
5
|
-
def find_apple_id(app_identifier)
|
6
|
-
login
|
7
|
-
|
8
|
-
apps = JSON.parse(page.evaluate_script("$.ajax({type: 'GET', url: '#{LIST_APPLE_IDS_URL}', async: false})")['responseText'])['data']
|
9
|
-
|
10
|
-
return apps['summaries'].find { |v| v['bundleId'] == app_identifier }['adamId'].to_i
|
11
|
-
rescue => ex
|
12
|
-
# Do nothing right now...
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
module FastlaneCore
|
2
|
-
class ItunesConnect
|
3
|
-
# All the private helpers
|
4
|
-
|
5
|
-
private
|
6
|
-
|
7
|
-
# Opens the app details page of the given app.
|
8
|
-
# @param app (Deliver::App) the app that should be opened
|
9
|
-
# @return (bool) true if everything worked fine
|
10
|
-
# @raise [ItunesConnectGeneralError] General error while executing
|
11
|
-
# this action
|
12
|
-
# @raise [ItunesConnectLoginError] Login data is wrong
|
13
|
-
def open_app_page(app)
|
14
|
-
verify_app(app)
|
15
|
-
|
16
|
-
Helper.log.info "Opening detail page for app #{app}"
|
17
|
-
|
18
|
-
visit APP_DETAILS_URL.gsub("[[app_id]]", app.apple_id.to_s)
|
19
|
-
|
20
|
-
wait_for_elements('.page-subnav')
|
21
|
-
sleep 5
|
22
|
-
|
23
|
-
if current_url.include? "wa/defaultError" # app could not be found
|
24
|
-
raise "Could not open app details for app '#{app}'. Make sure you're using the correct Apple ID and the correct Apple developer account (#{CredentialsManager::PasswordManager.shared_manager.username}).".red
|
25
|
-
end
|
26
|
-
|
27
|
-
true
|
28
|
-
rescue => ex
|
29
|
-
error_occured(ex)
|
30
|
-
end
|
31
|
-
|
32
|
-
def verify_app(app)
|
33
|
-
raise ItunesConnectGeneralError.new("No valid Deliver::App given") unless app.kind_of? Deliver::App
|
34
|
-
raise ItunesConnectGeneralError.new("App is missing information (apple_id not given)") unless (app.apple_id || '').to_s.length > 5
|
35
|
-
end
|
36
|
-
|
37
|
-
def error_occured(ex)
|
38
|
-
snap
|
39
|
-
raise ex # re-raise the error after saving the snapshot
|
40
|
-
end
|
41
|
-
|
42
|
-
def snap
|
43
|
-
path = File.expand_path("Error#{Time.now.to_i}.png")
|
44
|
-
# rubocop:disable Lint/Debugger
|
45
|
-
save_screenshot(path, full: true)
|
46
|
-
# rubocop:enable Lint/Debugger
|
47
|
-
system("open '#{path}'") unless ENV['SIGH_DISABLE_OPEN_ERROR']
|
48
|
-
end
|
49
|
-
|
50
|
-
# Since Apple takes for ages, after the upload is properly processed, we have to wait here
|
51
|
-
def wait_for_preprocessing
|
52
|
-
started = Time.now
|
53
|
-
|
54
|
-
# Wait, while iTunesConnect is processing the uploaded file
|
55
|
-
while page.has_content? "Uploaded"
|
56
|
-
# iTunesConnect is super slow... so we have to wait...
|
57
|
-
Helper.log.info("Sorry, we have to wait for iTunesConnect, since it's still processing the uploaded ipa file\n" \
|
58
|
-
"If this takes longer than 45 minutes, you have to re-upload the ipa file again.\n" \
|
59
|
-
"You can always open the browser page yourself: '#{current_url}'\n" \
|
60
|
-
"Passed time: ~#{((Time.now - started) / 60.0).to_i} minute(s)")
|
61
|
-
sleep 30
|
62
|
-
visit current_url
|
63
|
-
sleep 30
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def wait_for_elements(name)
|
68
|
-
counter = 0
|
69
|
-
results = all(name)
|
70
|
-
while results.count == 0
|
71
|
-
# Helper.log.debug "Waiting for #{name}"
|
72
|
-
sleep 0.2
|
73
|
-
|
74
|
-
results = all(name)
|
75
|
-
|
76
|
-
counter += 1
|
77
|
-
if counter > 100
|
78
|
-
Helper.log.debug caller
|
79
|
-
raise ItunesConnectGeneralError.new("Couldn't find element '#{name}' after waiting for quite some time")
|
80
|
-
end
|
81
|
-
end
|
82
|
-
return results
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,65 +0,0 @@
|
|
1
|
-
module FastlaneCore
|
2
|
-
# Login code
|
3
|
-
class ItunesConnect
|
4
|
-
# Loggs in a user with the given login data on the iTC Frontend.
|
5
|
-
# You don't need to pass a username and password. It will
|
6
|
-
# Automatically be fetched using the {CredentialsManager::PasswordManager}.
|
7
|
-
# This method will also automatically be called when triggering other
|
8
|
-
# actions like {#open_app_page}
|
9
|
-
# @param user (String) (optional) The username/email address
|
10
|
-
# @param password (String) (optional) The password
|
11
|
-
# @return (bool) true if everything worked fine
|
12
|
-
# @raise [ItunesConnectGeneralError] General error while executing
|
13
|
-
# this action
|
14
|
-
# @raise [ItunesConnectLoginError] Login data is wrong
|
15
|
-
def login(user = nil, password = nil)
|
16
|
-
Helper.log.info "Logging into iTunesConnect"
|
17
|
-
|
18
|
-
user ||= CredentialsManager::PasswordManager.shared_manager.username
|
19
|
-
password ||= CredentialsManager::PasswordManager.shared_manager.password
|
20
|
-
|
21
|
-
result = visit ITUNESCONNECT_URL
|
22
|
-
raise "Could not open iTunesConnect" unless result['status'] == 'success'
|
23
|
-
|
24
|
-
sleep 3
|
25
|
-
|
26
|
-
if page.has_content? "My Apps"
|
27
|
-
# Already logged in
|
28
|
-
return true
|
29
|
-
end
|
30
|
-
|
31
|
-
begin
|
32
|
-
wait_for_elements('#accountpassword')
|
33
|
-
rescue
|
34
|
-
# when the user is already logged in, this will raise an exception
|
35
|
-
end
|
36
|
-
|
37
|
-
fill_in "accountname", with: user
|
38
|
-
fill_in "accountpassword", with: password
|
39
|
-
|
40
|
-
begin
|
41
|
-
page.evaluate_script "appleConnectForm.submit()"
|
42
|
-
sleep 7
|
43
|
-
|
44
|
-
if page.has_content? "My Apps"
|
45
|
-
# Everything looks good
|
46
|
-
else
|
47
|
-
visit current_url # iTC sometimes is super buggy, try reloading the site
|
48
|
-
sleep 3
|
49
|
-
unless page.has_content? "My Apps"
|
50
|
-
raise ItunesConnectLoginError.new("Looks like your login data was correct, but you do not have access to the apps.".red)
|
51
|
-
end
|
52
|
-
end
|
53
|
-
rescue => ex
|
54
|
-
Helper.log.debug(ex)
|
55
|
-
raise ItunesConnectLoginError.new("Error logging in user #{user} with the given password. Make sure you entered them correctly.".red)
|
56
|
-
end
|
57
|
-
|
58
|
-
Helper.log.info "Successfully logged into iTunesConnect"
|
59
|
-
|
60
|
-
true
|
61
|
-
rescue => ex
|
62
|
-
error_occured(ex)
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|