fastlane_core 0.14.0 → 0.15.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: c2d0f44a0527c60c0e31c662fb6e949f4942c4b2
4
- data.tar.gz: 1051b6f80923c98a5f5bfa7d465738eb7a58ac83
3
+ metadata.gz: 510904849ee9c4f0deaef1e2b4a40995e72ba016
4
+ data.tar.gz: a919e913e4bbb002c78f4f97098f173e07c58707
5
5
  SHA512:
6
- metadata.gz: 871539a68657decdfb005c1eb1be865164bcba545ff88313035cfa64ac1dba093df3fd5f677dbe6fc5bfb9f938c4c0e065051d28509ea8d9e0205ea101516f35
7
- data.tar.gz: 2abceff335cebc424bd54f645ba2ce84d249426c98cf635da0db472086a7f12923a5cb97a9624fc8c0a993fbb9c60f23afd5ef8ac504571cec0fd6bbec1ca3fe
6
+ metadata.gz: 13523265f2737582ffb8c709b894f9b2d84df5a37deaffa4b64010b892f0dbae074039334367d29e95258b3118cec657d42401973865f133620352aa7d794abb
7
+ data.tar.gz: 01589418ba90bade204ef26a9c006fd2a84b317fb14979b685cbf001223a8658afdfc25981373cced2e71d305cd056b26d9c1dbbcd02c66171b37bc86fff5970
@@ -43,8 +43,7 @@ module FastlaneCore
43
43
  end
44
44
 
45
45
  # Exit status for build command, should be 0 if build succeeded
46
- # Disabled Rubocop, since $CHILD_STATUS just is not the same
47
- status = $?.exitstatus # rubocop:disable Style/SpecialGlobalVars
46
+ status = $?.exitstatus
48
47
  if status != 0
49
48
  o = output.join("\n")
50
49
  puts o # the user has the right to see the raw output
@@ -4,6 +4,7 @@ module FastlaneCore
4
4
  class CommanderGenerator
5
5
  include Commander::Methods
6
6
 
7
+ # Calls the appropriate methods for commander to show the available parameters
7
8
  def generate(options)
8
9
  short_codes = []
9
10
  options.each do |option|
@@ -14,9 +15,17 @@ module FastlaneCore
14
15
  raise "Short option #{short_option} already taken for key #{option.key}".red if short_codes.include?short_option
15
16
  raise "-v is already used for the version (key #{option.key})".red if short_option == "-v"
16
17
  raise "-h is already used for the help screen (key #{option.key})".red if short_option == "-h"
18
+ raise "-t is already used for the trace screen (key #{option.key})".red if short_option == "-t"
17
19
 
18
20
  short_codes << short_option
19
- global_option short_option, "--#{option.key} #{appendix}", type, (option.description + " (#{option.env_name})")
21
+
22
+ # Example Call
23
+ # c.option '-p', '--pattern STRING', String, 'Description'
24
+
25
+ flag = "--#{option.key} #{appendix}"
26
+ description = (option.description + " (#{option.env_name})")
27
+
28
+ global_option short_option, flag, type, description
20
29
  end
21
30
  end
22
31
  end
@@ -54,8 +54,12 @@ module FastlaneCore
54
54
  self.test?
55
55
  end
56
56
 
57
- # @return [boolean] true if building in a known CI environment
58
57
  def self.is_ci?
58
+ ci?
59
+ end
60
+
61
+ # @return [boolean] true if building in a known CI environment
62
+ def self.ci?
59
63
  # Check for Jenkins, Travis CI, ... environment variables
60
64
  ['JENKINS_URL', 'TRAVIS', 'CIRCLECI', 'CI'].each do |current|
61
65
  return true if ENV.has_key?(current)
@@ -70,8 +74,12 @@ module FastlaneCore
70
74
  `xcode-select -p`.gsub("\n", '') + "/"
71
75
  end
72
76
 
73
- # Is the currently running computer a Mac?
74
77
  def self.is_mac?
78
+ self.mac?
79
+ end
80
+
81
+ # Is the currently running computer a Mac?
82
+ def self.mac?
75
83
  (/darwin/ =~ RUBY_PLATFORM) != nil
76
84
  end
77
85
 
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.14.0"
2
+ VERSION = "0.15.0"
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.14.0
4
+ version: 0.15.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-08-13 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: 1.1.6
125
+ - !ruby/object:Gem::Dependency
126
+ name: plist
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.1'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.1'
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: credentials_manager
127
141
  requirement: !ruby/object:Gem::Requirement
@@ -292,9 +306,6 @@ files:
292
306
  - lib/fastlane_core/configuration/config_item.rb
293
307
  - lib/fastlane_core/configuration/configuration.rb
294
308
  - lib/fastlane_core/configuration/configuration_file.rb
295
- - lib/fastlane_core/developer_center/developer_center.rb
296
- - lib/fastlane_core/developer_center/developer_center_helper.rb
297
- - lib/fastlane_core/developer_center/developer_center_login.rb
298
309
  - lib/fastlane_core/helper.rb
299
310
  - lib/fastlane_core/ipa_file_analyser.rb
300
311
  - lib/fastlane_core/itunes_connect/itunes_connect.rb
@@ -327,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
327
338
  version: '0'
328
339
  requirements: []
329
340
  rubyforge_project:
330
- rubygems_version: 2.4.8
341
+ rubygems_version: 2.4.6
331
342
  signing_key:
332
343
  specification_version: 4
333
344
  summary: Contains all shared code/dependencies of the fastlane.tools
@@ -1,55 +0,0 @@
1
- require 'credentials_manager/password_manager'
2
- require 'open-uri'
3
-
4
- require 'capybara'
5
- require 'capybara/poltergeist'
6
- require 'phantomjs/poltergeist'
7
-
8
- require 'fastlane_core/developer_center/developer_center_login'
9
- require 'fastlane_core/developer_center/developer_center_helper'
10
-
11
- module FastlaneCore
12
- class DeveloperCenter
13
- # This error occurs only if there is something wrong with the given login data
14
- class DeveloperCenterLoginError < StandardError
15
- end
16
-
17
- # This error can occur for many reaons. It is
18
- # usually raised when a UI element could not be found
19
- class DeveloperCenterGeneralError < StandardError
20
- end
21
-
22
- include Capybara::DSL
23
-
24
- DEVELOPER_CENTER_URL = "https://developer.apple.com/devcenter/ios/index.action"
25
- PROFILES_URL = "https://developer.apple.com/account/ios/profile/profileList.action?type=production"
26
- TMP_FOLDER = "/tmp/fastlane_core/"
27
-
28
- def initialize
29
- FileUtils.mkdir_p TMP_FOLDER
30
-
31
- Capybara.run_server = false
32
- Capybara.default_driver = :poltergeist
33
- Capybara.javascript_driver = :poltergeist
34
- Capybara.current_driver = :poltergeist
35
- Capybara.app_host = DEVELOPER_CENTER_URL
36
-
37
- # Since Apple has some SSL errors, we have to configure the client properly:
38
- # https://github.com/ariya/phantomjs/issues/11239
39
- Capybara.register_driver :poltergeist do |a|
40
- conf = ['--debug=no', '--ignore-ssl-errors=yes', '--ssl-protocol=TLSv1']
41
- Capybara::Poltergeist::Driver.new(a, {
42
- phantomjs: Phantomjs.path,
43
- phantomjs_options: conf,
44
- phantomjs_logger: File.open("#{TMP_FOLDER}/poltergeist_log.txt", "a"),
45
- js_errors: false,
46
- timeout: 90
47
- })
48
- end
49
-
50
- page.driver.headers = { "Accept-Language" => "en" }
51
-
52
- self.login
53
- end
54
- end
55
- end
@@ -1,80 +0,0 @@
1
- require 'babosa'
2
-
3
- module FastlaneCore
4
- class DeveloperCenter
5
- # Download a file from the dev center, by using a HTTP client. This will return the content of the file
6
- def download_file(url)
7
- Helper.log.info "Downloading profile..."
8
- host = Capybara.current_session.current_host
9
- url = [host, url].join('')
10
-
11
- cookie_string = ""
12
-
13
- page.driver.cookies.each do |key, cookie|
14
- cookie_string << "#{cookie.name}=#{cookie.value};" # append all known cookies
15
- end
16
-
17
- data = open(url, {'Cookie' => cookie_string}).read
18
-
19
- raise "Something went wrong when downloading the file from the Dev Center" unless data
20
- Helper.log.info "Successfully downloaded provisioning profile"
21
- return data
22
- end
23
-
24
- def post_ajax(url, data = nil)
25
- JSON.parse(page.evaluate_script("$.ajax({type: 'POST', url: '#{url}', async: false#{data.nil? ? '' : ", data: #{data}"} })")['responseText'])
26
- end
27
-
28
- def click_next
29
- wait_for_elements('.button.small.blue.right.submit').last.click
30
- end
31
-
32
- def error_occured(ex)
33
- snap
34
- raise ex # re-raise the error after saving the snapshot
35
- end
36
-
37
- def snap
38
- path = File.expand_path("Error#{Time.now.to_i}.png")
39
- save_screenshot(path, :full => true)
40
- system("open '#{path}'") unless ENV['SIGH_DISABLE_OPEN_ERROR']
41
- end
42
-
43
- def wait_for(method, parameter, success)
44
- counter = 0
45
- result = method.call(parameter)
46
- while !success.call(result)
47
- sleep 0.2
48
-
49
- result = method.call(parameter)
50
-
51
- counter += 1
52
- if counter > 100
53
- Helper.log.debug caller
54
- raise DeveloperCenterGeneralError.new("Couldn't find '#{parameter}' after waiting for quite some time")
55
- end
56
- end
57
- return result
58
- end
59
-
60
- def wait_for_elements(name)
61
- method = Proc.new { |n| all(name) }
62
- success = Proc.new { |r| r.count > 0 }
63
- return wait_for(method, name, success)
64
- end
65
-
66
- def wait_for_variable(name)
67
- method = Proc.new { |n|
68
- retval = page.html.match(/var #{n} = "(.*)"/)
69
- retval[1] unless retval == nil
70
- }
71
- success = Proc.new { |r| r != nil }
72
- return wait_for(method, name, success)
73
- end
74
-
75
- def valid_name_for(input)
76
- latinazed = input.to_slug.transliterate.to_s # remove accents
77
- latinazed.gsub(/[^0-9A-Za-z\d\s]/, '') # remove non-valid characters
78
- end
79
- end
80
- end
@@ -1,132 +0,0 @@
1
- module FastlaneCore
2
- class DeveloperCenter
3
- # Log in a user with the given login data on the Dev Center Frontend.
4
- # You don't need to pass a username and password. It will
5
- # Automatically be fetched using the {CredentialsManager::PasswordManager}.
6
- # This method will also automatically be called when triggering other
7
- # actions like {#open_app_page}
8
- # @param user (String) (optional) The username/email address
9
- # @param password (String) (optional) The password
10
- # @return (bool) true if everything worked fine
11
- # @raise [DeveloperCenterGeneralError] General error while executing
12
- # this action
13
- # @raise [DeveloperCenterLoginError] Login data is wrong
14
- def login(user = nil, password = nil)
15
- begin
16
- Helper.log.info "Login into iOS Developer Center"
17
-
18
- user ||= CredentialsManager::PasswordManager.shared_manager.username
19
- password ||= CredentialsManager::PasswordManager.shared_manager.password
20
-
21
- result = visit PROFILES_URL
22
- raise "Could not open Developer Center" unless result['status'] == 'success'
23
-
24
- # Already logged in
25
- select_team if current_url.include?"selectTeam.action"
26
- return true if (page.has_content? "Member Center" and not current_url.include?"selectTeam.action")
27
-
28
- (wait_for_elements(".button.blue").first.click rescue nil) # maybe already logged in
29
-
30
- (wait_for_elements('#accountpassword') rescue nil) # when the user is already logged in, this will raise an exception
31
-
32
- # Already logged in
33
- select_team if current_url.include?"selectTeam.action"
34
- return true if (page.has_content? "Member Center" and not current_url.include?"selectTeam.action")
35
-
36
- fill_in "accountname", with: user
37
- fill_in "accountpassword", with: password
38
-
39
- all(".button.large.blue.signin-button").first.click
40
-
41
- begin
42
- # If the user is not on multiple teams
43
- select_team if current_url.include?"selectTeam.action"
44
- rescue => ex
45
- Helper.log.debug ex
46
- raise DeveloperCenterLoginError.new("Error loggin in user #{user}. User is on multiple teams and we were unable to correctly retrieve them.")
47
- end
48
-
49
- begin
50
- wait_for_elements('.ios.profiles.gridList')
51
- visit PROFILES_URL # again, since after the login, the dev center loses the production GET value
52
- rescue => ex
53
- if page.has_content?"Getting Started"
54
- visit PROFILES_URL # again, since after the login, the dev center loses the production GET value
55
- else
56
- Helper.log.debug ex
57
- raise DeveloperCenterLoginError.new("Error logging in user #{user} with the given password. Make sure you entered them correctly.".red)
58
- end
59
- end
60
-
61
- Helper.log.info "Login successful"
62
-
63
- true
64
- rescue => ex
65
- error_occured(ex)
66
- end
67
- end
68
-
69
-
70
- def select_team
71
- team_id = ENV["FASTLANE_TEAM_ID"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_id)
72
-
73
- team_name = ENV["FASTLANE_TEAM_NAME"] || CredentialsManager::AppfileConfig.try_fetch_value(:team_name)
74
-
75
- if team_id == nil and team_name == nil
76
- Helper.log.info "You can store your preferred team using the environment variable `FASTLANE_TEAM_ID` or `FASTLANE_TEAM_NAME`".green
77
- Helper.log.info "or in your `Appfile` using `team_id 'Q2CBPJ58CA'` or `team_name 'Felix Krause'`".green
78
- Helper.log.info "Your ID belongs to the following teams:".green
79
- end
80
-
81
- available_options = []
82
-
83
- teams = find("div.input").all('.team-value') # Grab all the teams data
84
- teams.each_with_index do |val, index|
85
- current_team_id = '"' + val.find("input").value + '"'
86
- team_text = val.find(".label-primary").text
87
- description_text = val.find(".label-secondary").text
88
- description_text = "(#{description_text})" unless description_text.empty? # Include the team description if any
89
- index_text = (index + 1).to_s + "."
90
-
91
- available_options << [index_text, current_team_id, team_text, description_text].join(" ")
92
- end
93
-
94
- if team_name
95
- # Search for name
96
- found_it = false
97
- all("label.label-primary").each do |current|
98
- if current.text.downcase.gsub(/\s+/, "") == team_name.downcase.gsub(/\s+/, "")
99
- current.click # select the team by name
100
- found_it = true
101
- end
102
- end
103
-
104
- unless found_it
105
- available_teams = all("label.label-primary").collect { |a| a.text }
106
- raise DeveloperCenterLoginError.new("Could not find Team with name '#{team_name}'. Available Teams: #{available_teams}".red)
107
- end
108
- else
109
- # Search by ID/Index
110
- unless team_id
111
- puts available_options.join("\n").green
112
- team_index = ask("Please select the team number you would like to access: ".green)
113
- team_id = teams[team_index.to_i - 1].find(".radio").value
114
- end
115
-
116
- team_button = first(:xpath, "//input[@type='radio' and @value='#{team_id}']") # Select the desired team
117
- if team_button
118
- team_button.click
119
- else
120
- Helper.log.fatal "Could not find given Team. Available options: ".red
121
- puts available_options.join("\n").yellow
122
- raise DeveloperCenterLoginError.new("Error finding given team #{team_id}.".red)
123
- end
124
- end
125
-
126
- all(".button.large.blue.submit").first.click
127
-
128
- result = visit PROFILES_URL
129
- raise "Could not open Developer Center" unless result['status'] == 'success'
130
- end
131
- end
132
- end