fastlane_core 0.39.1 → 0.40.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: 4efa9b788c7766701cb4923a5f85bce5b2a5e74b
4
- data.tar.gz: ac4f3ab0e5216c56762f6afe2f7abce7c608ea88
3
+ metadata.gz: aa67f5ecf00a2022c691ef679d4228b6173c45ce
4
+ data.tar.gz: 7e8e9d38e4c0dfa77229e043908fb3ad6d58d87d
5
5
  SHA512:
6
- metadata.gz: 4478acc3c847e5922272dbc46df3089d3d06213e43532171776ec077bdd1bd59fd6704f1274fc326c737353025bddcf0678647512a10ca6d3771443929d9a32e
7
- data.tar.gz: d2dd60b8585082fb7280b6a1cb0fd36d3d929d4554bd6264dabf689fcb24e9873cee872f0f95fb7cb2abe6c89e16103959a5d9b05092ea01a8e60810e7b07842
6
+ metadata.gz: f0425fc97004b7a2df9b4149e78201ea7a60ffd3eb83dd422e73ea3653e9e3f61d99be37649b087fdf32b75e77234df6a8c91e46b150e52ebc6403a450d172ba
7
+ data.tar.gz: 0aa390506ad4fad52b3f913661ba7c8fb6cbf90602cf1b49ea39d32cf877aa52d846359a51a5de72ce11e34e1d3fae103a2d0e9a00199787a5332e5f8cd7819a
@@ -2,7 +2,7 @@ module FastlaneCore
2
2
  # This class checks if a specific certificate is installed on the current mac
3
3
  class CertChecker
4
4
  def self.installed?(path)
5
- raise "Could not find file '#{path}'".red unless File.exist?(path)
5
+ UI.user_error!("Could not find file '#{path}'") unless File.exist?(path)
6
6
 
7
7
  ids = installed_identies
8
8
  finger_print = sha1_fingerprint(path)
@@ -68,8 +68,8 @@ module FastlaneCore
68
68
  result.delete!(':')
69
69
  return result
70
70
  rescue
71
- Helper.log.info result
72
- raise "Error parsing certificate '#{path}'"
71
+ UI.message(result)
72
+ UI.user_error!("Error parsing certificate '#{path}'")
73
73
  end
74
74
  end
75
75
  end
@@ -84,7 +84,7 @@ module FastlaneCore
84
84
  if error
85
85
  error.call(o, status)
86
86
  else
87
- raise "Exit status: #{status}"
87
+ UI.user_error!("Exit status: #{status}")
88
88
  end
89
89
  end
90
90
 
@@ -70,10 +70,10 @@ module FastlaneCore
70
70
  def validate_short_switch(used_switches, short_switch)
71
71
  return if short_switch.nil?
72
72
 
73
- raise "Short option #{short_switch} already taken for key #{option.key}".red if used_switches.include?(short_switch)
74
- raise "-v is already used for the version (key #{option.key})".red if short_switch == "-v"
75
- raise "-h is already used for the help screen (key #{option.key})".red if short_switch == "-h"
76
- raise "-t is already used for the trace screen (key #{option.key})".red if short_switch == "-t"
73
+ UI.user_error!("Short option #{short_switch} already taken for key #{option.key}") if used_switches.include?(short_switch)
74
+ UI.user_error!("-v is already used for the version (key #{option.key})") if short_switch == "-v"
75
+ UI.user_error!("-h is already used for the help screen (key #{option.key})") if short_switch == "-h"
76
+ UI.user_error!("-t is already used for the trace screen (key #{option.key})") if short_switch == "-t"
77
77
 
78
78
  used_switches << short_switch
79
79
  end
@@ -1,6 +1,6 @@
1
1
  module FastlaneCore
2
2
  class ConfigItem
3
- attr_accessor :key, :env_name, :description, :short_option, :default_value, :verify_block, :optional, :conflicting_options, :conflict_block
3
+ attr_accessor :key, :env_name, :description, :short_option, :default_value, :verify_block, :optional, :conflicting_options, :conflict_block, :deprecated
4
4
 
5
5
  # Creates a new option
6
6
  # @param key (Symbol) the key which is used as command paramters or key in the fastlane tools
@@ -16,26 +16,35 @@ module FastlaneCore
16
16
  # @param optional (Boolean) is false by default. If set to true, also string values will not be asked to the user
17
17
  # @param conflicting_options ([]) array of conflicting option keys(@param key). This allows to resolve conflicts intelligently
18
18
  # @param conflict_block an optional block which is called when options conflict happens
19
- def initialize(key: nil, env_name: nil, description: nil, short_option: nil, default_value: nil, verify_block: nil, is_string: true, type: nil, optional: false, conflicting_options: nil, conflict_block: nil)
20
- raise "key must be a symbol" unless key.kind_of? Symbol
21
- raise "env_name must be a String" unless (env_name || '').kind_of? String
19
+ # @param deprecated (String) Set if the option is deprecated. A deprecated option should be optional and is made optional if the parameter isn't set, and fails otherwise
20
+ def initialize(key: nil, env_name: nil, description: nil, short_option: nil, default_value: nil, verify_block: nil, is_string: true, type: nil, optional: nil, conflicting_options: nil, conflict_block: nil, deprecated: nil)
21
+ UI.user_error!("key must be a symbol") unless key.kind_of? Symbol
22
+ UI.user_error!("env_name must be a String") unless (env_name || '').kind_of? String
22
23
 
23
24
  if short_option
24
- raise "short_option must be a String of length 1" unless short_option.kind_of? String and short_option.delete('-').length == 1
25
+ UI.user_error!("short_option must be a String of length 1") unless short_option.kind_of? String and short_option.delete('-').length == 1
25
26
  end
26
27
  if description
27
- raise "Do not let descriptions end with a '.', since it's used for user inputs as well".red if description[-1] == '.'
28
+ UI.user_error!("Do not let descriptions end with a '.', since it's used for user inputs as well") if description[-1] == '.'
28
29
  end
29
30
 
30
31
  if type.to_s.length > 0 and short_option.to_s.length == 0
31
- raise "Type '#{type}' for key '#{key}' requires a short option"
32
+ UI.user_error!("Type '#{type}' for key '#{key}' requires a short option")
32
33
  end
33
34
 
34
35
  if conflicting_options
35
36
  conflicting_options.each do |conflicting_option_key|
36
- raise "Conflicting option key must be a symbol" unless conflicting_option_key.kind_of? Symbol
37
+ UI.user_error!("Conflicting option key must be a symbol") unless conflicting_option_key.kind_of? Symbol
37
38
  end
38
39
  end
40
+ if deprecated
41
+ # deprecated options are automatically optional
42
+ optional = true if optional.nil?
43
+ UI.crash!("Deprecated option must be optional") unless optional
44
+ # deprecated options are marked deprecated in their description
45
+ description = "[DEPRECATED!] #{deprecated} - #{description}"
46
+ end
47
+ optional = false if optional.nil?
39
48
 
40
49
  @key = key
41
50
  @env_name = env_name
@@ -48,6 +57,7 @@ module FastlaneCore
48
57
  @optional = optional
49
58
  @conflicting_options = conflicting_options
50
59
  @conflict_block = conflict_block
60
+ @deprecated = deprecated
51
61
  end
52
62
 
53
63
  # This will raise an exception if the value is not valid
@@ -57,6 +57,7 @@ module FastlaneCore
57
57
 
58
58
  option = option_for_key(key)
59
59
  if option
60
+ UI.deprecated("Using deprecated option: '--#{key}' (#{option.deprecated})") if option.deprecated
60
61
  option.verify!(value) # Call the verify block for it too
61
62
  else
62
63
  UI.user_error!("Could not find option '#{key}' in the list of available options: #{@available_options.collect(&:key).join(', ')}")
@@ -103,7 +104,7 @@ module FastlaneCore
103
104
  begin
104
105
  current.conflict_block.call(conflicting_option)
105
106
  rescue => ex
106
- Helper.log.fatal "Error resolving conflict between options: '#{current.key}' and '#{conflicting_option.key}'".red
107
+ UI.error("Error resolving conflict between options: '#{current.key}' and '#{conflicting_option.key}'")
107
108
  raise ex
108
109
  end
109
110
  else
@@ -123,7 +124,7 @@ module FastlaneCore
123
124
  item.verify_block.call(item.default_value)
124
125
  end
125
126
  rescue => ex
126
- Helper.log.fatal ex
127
+ UI.error(ex)
127
128
  UI.user_error!("Invalid default value for #{item.key}, doesn't match verify_block")
128
129
  end
129
130
  end
@@ -194,7 +195,7 @@ module FastlaneCore
194
195
  end
195
196
 
196
197
  while value.nil?
197
- Helper.log.info "To not be asked about this value, you can specify it using '#{option.key}'".yellow
198
+ UI.important("To not be asked about this value, you can specify it using '#{option.key}'")
198
199
  value = ask("#{option.description}: ")
199
200
  # Also store this value to use it from now on
200
201
  begin
@@ -25,7 +25,7 @@ module FastlaneCore
25
25
  # rubocop:enable Lint/Eval
26
26
  rescue SyntaxError => ex
27
27
  line = ex.to_s.match(/\(eval\):(\d+)/)[1]
28
- raise "Syntax error in your configuration file '#{path}' on line #{line}: #{ex}".red
28
+ UI.user_error!("Syntax error in your configuration file '#{path}' on line #{line}: #{ex}")
29
29
  end
30
30
  end
31
31
 
@@ -78,7 +78,7 @@ module FastlaneCore
78
78
  puts "please submit an issue on GitHub and attach the following number to it: '#{crash.id}'".yellow
79
79
  puts "The crash report has been stored locally '#{path}'".yellow
80
80
  rescue => e
81
- Helper.log.debug e # We don't want crash reporting to cause crash
81
+ UI.verbose(e) # We don't want crash reporting to cause crash
82
82
  end
83
83
  end
84
84
  end
@@ -118,8 +118,8 @@ module FastlaneCore
118
118
  output = `DEVELOPER_DIR='' "#{xcode_path}/usr/bin/xcodebuild" -version`
119
119
  @xcode_version = output.split("\n").first.split(' ')[1]
120
120
  rescue => ex
121
- Helper.log.error ex
122
- Helper.log.error "Error detecting currently used Xcode installation".red
121
+ UI.error(ex)
122
+ UI.error("Error detecting currently used Xcode installation")
123
123
  end
124
124
  @xcode_version
125
125
  end
@@ -135,7 +135,7 @@ module FastlaneCore
135
135
  result = File.join(self.xcode_path, path)
136
136
  return result if File.exist?(result)
137
137
  end
138
- raise "Could not find transporter at #{self.xcode_path}. Please make sure you set the correct path to your Xcode installation.".red
138
+ UI.user_error!("Could not find transporter at #{self.xcode_path}. Please make sure you set the correct path to your Xcode installation.")
139
139
  end
140
140
 
141
141
  def self.fastlane_enabled?
@@ -28,7 +28,7 @@ module FastlaneCore
28
28
  xml = ERB.new(File.read(xml_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system
29
29
 
30
30
  File.write(File.join(self.package_path, METADATA_FILE_NAME), xml)
31
- Helper.log.info "Wrote XML data to '#{self.package_path}'".green if $verbose
31
+ UI.success("Wrote XML data to '#{self.package_path}'") if $verbose
32
32
 
33
33
  return package_path
34
34
  end
@@ -41,7 +41,7 @@ module FastlaneCore
41
41
 
42
42
  return response['results'].first
43
43
  rescue
44
- Helper.log.error "Could not find object '#{url}' using the iTunes API"
44
+ UI.error("Could not find object '#{url}' using the iTunes API")
45
45
  nil
46
46
  end
47
47
  end
@@ -46,15 +46,15 @@ module FastlaneCore
46
46
  def download(app_id, dir = nil)
47
47
  dir ||= "/tmp"
48
48
 
49
- Helper.log.info "Going to download app metadata from iTunes Connect"
49
+ UI.message("Going to download app metadata from iTunes Connect")
50
50
  command = build_download_command(@user, @password, app_id, dir)
51
- Helper.log.debug build_download_command(@user, 'YourPassword', app_id, dir) if $verbose
51
+ UI.verbose(build_download_command(@user, 'YourPassword', app_id, dir)) if $verbose
52
52
 
53
53
  result = execute_transporter(command)
54
54
 
55
55
  itmsp_path = File.join(dir, "#{app_id}.itmsp")
56
56
  if result and File.directory? itmsp_path
57
- Helper.log.info "Successfully downloaded the latest package from iTunes Connect.".green
57
+ UI.success("Successfully downloaded the latest package from iTunes Connect.")
58
58
  else
59
59
  handle_error(@password)
60
60
  end
@@ -71,18 +71,18 @@ module FastlaneCore
71
71
  def upload(app_id, dir)
72
72
  dir = File.join(dir, "#{app_id}.itmsp")
73
73
 
74
- Helper.log.info "Going to upload updated app to iTunes Connect"
75
- Helper.log.info "This might take a few minutes, please don't interrupt the script".green
74
+ UI.message("Going to upload updated app to iTunes Connect")
75
+ UI.success("This might take a few minutes, please don't interrupt the script")
76
76
 
77
77
  command = build_upload_command(@user, @password, dir)
78
- Helper.log.debug build_upload_command(@user, 'YourPassword', dir) if $verbose
78
+ UI.verbose(build_upload_command(@user, 'YourPassword', dir)) if $verbose
79
79
 
80
80
  result = execute_transporter(command)
81
81
 
82
82
  if result
83
- Helper.log.info(("-" * 102).green)
84
- Helper.log.info("Successfully uploaded package to iTunes Connect. It might take a few minutes until it's visible online.".green)
85
- Helper.log.info(("-" * 102).green)
83
+ UI.success("-" * 102)
84
+ UI.success("Successfully uploaded package to iTunes Connect. It might take a few minutes until it's visible online.")
85
+ UI.success("-" * 102)
86
86
 
87
87
  FileUtils.rm_rf(dir) unless Helper.is_test? # we don't need the package any more, since the upload was successful
88
88
  else
@@ -97,10 +97,10 @@ module FastlaneCore
97
97
  def handle_error(password)
98
98
  # rubocop:disable Style/CaseEquality
99
99
  unless /^[0-9a-zA-Z\.\$\_]*$/ === password
100
- Helper.log.error "Password contains special characters, which may not be handled properly by iTMSTransporter. If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters."
100
+ UI.error("Password contains special characters, which may not be handled properly by iTMSTransporter. If you experience problems uploading to iTunes Connect, please consider changing your password to something with only alphanumeric characters.")
101
101
  end
102
102
  # rubocop:enable Style/CaseEquality
103
- Helper.log.fatal "Could not download/upload from iTunes Connect! It's probably related to your password or your internet connection."
103
+ UI.error("Could not download/upload from iTunes Connect! It's probably related to your password or your internet connection.")
104
104
  end
105
105
 
106
106
  def execute_transporter(command)
@@ -109,8 +109,8 @@ module FastlaneCore
109
109
 
110
110
  if defined?@hide_transporter_output
111
111
  # Show a one time message instead
112
- Helper.log.info "Waiting for iTunes Connect transporter to be finished.".green
113
- Helper.log.info "iTunes Transporter progress... this might take a few minutes...".green
112
+ UI.success("Waiting for iTunes Connect transporter to be finished.")
113
+ UI.success("iTunes Transporter progress... this might take a few minutes...")
114
114
  end
115
115
 
116
116
  begin
@@ -120,16 +120,16 @@ module FastlaneCore
120
120
  end
121
121
  end
122
122
  rescue => ex
123
- Helper.log.fatal(ex.to_s)
123
+ UI.error(ex.to_s)
124
124
  @errors << ex.to_s
125
125
  end
126
126
 
127
127
  if @warnings.count > 0
128
- Helper.log.warn(@warnings.join("\n"))
128
+ UI.important(@warnings.join("\n"))
129
129
  end
130
130
 
131
131
  if @errors.count > 0
132
- Helper.log.error(@errors.join("\n"))
132
+ UI.error(@errors.join("\n"))
133
133
  return false
134
134
  end
135
135
 
@@ -147,7 +147,7 @@ module FastlaneCore
147
147
 
148
148
  elsif line =~ ERROR_REGEX
149
149
  @errors << $1
150
- Helper.log.error "[Transporter Error Output]: #{$1}".red
150
+ UI.error("[Transporter Error Output]: #{$1}")
151
151
 
152
152
  # Check if it's a login error
153
153
  if $1.include? "Your Apple ID or password was entered incorrectly" or
@@ -155,35 +155,35 @@ module FastlaneCore
155
155
 
156
156
  unless Helper.is_test?
157
157
  CredentialsManager::AccountManager.new(user: @user).invalid_credentials
158
- Helper.log.fatal "Please run this tool again to apply the new password"
158
+ UI.error("Please run this tool again to apply the new password")
159
159
  end
160
160
  elsif $1.include? "Redundant Binary Upload. There already exists a binary upload with build"
161
- Helper.log.fatal $1
162
- Helper.log.fatal "You have to change the build number of your app to upload your ipa file"
161
+ UI.error($1)
162
+ UI.error("You have to change the build number of your app to upload your ipa file")
163
163
  end
164
164
 
165
165
  output_done = true
166
166
  elsif line =~ WARNING_REGEX
167
167
  @warnings << $1
168
- Helper.log.warn "[Transporter Warning Output]: #{$1}".yellow
168
+ UI.important("[Transporter Warning Output]: #{$1}")
169
169
  output_done = true
170
170
  end
171
171
 
172
172
  if line =~ RETURN_VALUE_REGEX
173
173
  if $1.to_i != 0
174
- Helper.log.fatal "Transporter transfer failed.".red
175
- Helper.log.warn(@warnings.join("\n").yellow)
176
- Helper.log.error(@errors.join("\n").red)
177
- raise "Return status of iTunes Transporter was #{$1}: #{@errors.join('\n')}".red
174
+ UI.error("Transporter transfer failed.")
175
+ UI.important(@warnings.join("\n"))
176
+ UI.error(@errors.join("\n"))
177
+ UI.crash!("Return status of iTunes Transporter was #{$1}: #{@errors.join('\n')}")
178
178
  else
179
- Helper.log.info "iTunes Transporter successfully finished its job".green
179
+ UI.success("iTunes Transporter successfully finished its job")
180
180
  end
181
181
  end
182
182
 
183
183
  if !defined?@hide_transporter_output and line =~ OUTPUT_REGEX
184
184
  # General logging for debug purposes
185
185
  unless output_done
186
- Helper.log.debug "[Transporter]: #{$1}"
186
+ UI.verbose("[Transporter]: #{$1}")
187
187
  end
188
188
  end
189
189
  end
@@ -30,8 +30,8 @@ module FastlaneCore
30
30
  return xml
31
31
  end
32
32
  rescue => ex
33
- Helper.log.error ex
34
- Helper.log.error "Error parsing *.pkg distribution xml #{File.join(dir, file)}".red
33
+ UI.error(ex)
34
+ UI.error("Error parsing *.pkg distribution xml #{File.join(dir, file)}")
35
35
  end
36
36
  end
37
37
 
@@ -28,7 +28,7 @@ module FastlaneCore
28
28
  xml = ERB.new(File.read(xml_path)).result(binding) # http://www.rrn.dk/rubys-erb-templating-system
29
29
 
30
30
  File.write(File.join(self.package_path, METADATA_FILE_NAME), xml)
31
- Helper.log.info "Wrote XML data to '#{self.package_path}'".green if $verbose
31
+ UI.success("Wrote XML data to '#{self.package_path}'") if $verbose
32
32
 
33
33
  package_path
34
34
  end
@@ -5,7 +5,7 @@ module FastlaneCore
5
5
  # Project discovery
6
6
  def detect_projects(config)
7
7
  if config[:workspace].to_s.length > 0 and config[:project].to_s.length > 0
8
- raise "You can only pass either a workspace or a project path, not both".red
8
+ UI.user_error!("You can only pass either a workspace or a project path, not both")
9
9
  end
10
10
 
11
11
  return if config[:project].to_s.length > 0
@@ -48,10 +48,10 @@ module FastlaneCore
48
48
  config[:project] = path
49
49
  break
50
50
  else
51
- Helper.log.error "Path must end with either .xcworkspace or .xcodeproj"
51
+ UI.error("Path must end with either .xcworkspace or .xcodeproj")
52
52
  end
53
53
  else
54
- Helper.log.error "Couldn't find project at path '#{File.expand_path(path)}'".red
54
+ UI.error("Couldn't find project at path '#{File.expand_path(path)}'")
55
55
  end
56
56
  end
57
57
  end
@@ -72,7 +72,7 @@ module FastlaneCore
72
72
  self.is_workspace = (options[:workspace].to_s.length > 0)
73
73
 
74
74
  if !path or !File.directory?(path)
75
- raise "Could not find project at path '#{path}'".red
75
+ UI.user_error!("Could not find project at path '#{path}'")
76
76
  end
77
77
  end
78
78
 
@@ -95,12 +95,11 @@ module FastlaneCore
95
95
 
96
96
  # Let the user select a scheme
97
97
  # Use a scheme containing the preferred_to_include string when multiple schemes were found
98
- # rubocop:disable Metrics/AbcSize
99
98
  def select_scheme(preferred_to_include: nil)
100
99
  if options[:scheme].to_s.length > 0
101
100
  # Verify the scheme is available
102
101
  unless schemes.include?(options[:scheme].to_s)
103
- Helper.log.error "Couldn't find specified scheme '#{options[:scheme]}'.".red
102
+ UI.error("Couldn't find specified scheme '#{options[:scheme]}'.")
104
103
  options[:scheme] = nil
105
104
  end
106
105
  end
@@ -118,24 +117,23 @@ module FastlaneCore
118
117
  if preferred_to_include and preferred.count == 1
119
118
  options[:scheme] = preferred.last
120
119
  elsif automated_scheme_selection? && schemes.include?(project_name)
121
- Helper.log.info "Using scheme matching project name (#{project_name}).".yellow
120
+ UI.important("Using scheme matching project name (#{project_name}).")
122
121
  options[:scheme] = project_name
123
122
  elsif Helper.is_ci?
124
- Helper.log.error "Multiple schemes found but you haven't specified one.".red
125
- Helper.log.error "Since this is a CI, please pass one using the `scheme` option".red
126
- raise "Multiple schemes found".red
123
+ UI.error("Multiple schemes found but you haven't specified one.")
124
+ UI.error("Since this is a CI, please pass one using the `scheme` option")
125
+ UI.user_error!("Multiple schemes found")
127
126
  else
128
127
  puts "Select Scheme: "
129
128
  options[:scheme] = choose(*schemes)
130
129
  end
131
130
  else
132
- Helper.log.error "Couldn't find any schemes in this project, make sure that the scheme is shared if you are using a workspace".red
133
- Helper.log.error "Open Xcode, click on `Manage Schemes` and check the `Shared` box for the schemes you want to use".red
131
+ UI.error("Couldn't find any schemes in this project, make sure that the scheme is shared if you are using a workspace")
132
+ UI.error("Open Xcode, click on `Manage Schemes` and check the `Shared` box for the schemes you want to use")
134
133
 
135
- raise "No Schemes found".red
134
+ UI.user_error!("No Schemes found")
136
135
  end
137
136
  end
138
- # rubocop:enable Metrics/AbcSize
139
137
 
140
138
  # Get all available configurations in an array
141
139
  def configurations
@@ -211,8 +209,8 @@ module FastlaneCore
211
209
  rescue => ex
212
210
  return nil if optional # an optional value, we really don't care if something goes wrong
213
211
 
214
- Helper.log.error caller.join("\n\t")
215
- Helper.log.error "Could not fetch #{key} from project file: #{ex}"
212
+ UI.error(caller.join("\n\t"))
213
+ UI.error("Could not fetch #{key} from project file: #{ex}")
216
214
  end
217
215
 
218
216
  nil
@@ -260,18 +258,18 @@ module FastlaneCore
260
258
 
261
259
  options = xcodebuild_parameters.delete_if { |a| a.to_s.include? "scheme" }
262
260
  command = "xcrun xcodebuild -list #{options.join(' ')}"
263
- Helper.log.info command.yellow unless silent
261
+ UI.important(command) unless silent
264
262
 
265
263
  # xcode >= 6 might hang here if the user schemes are missing
266
264
  begin
267
265
  timeout = FastlaneCore::Project.xcode_list_timeout
268
266
  @raw = FastlaneCore::Project.run_command(command, timeout: timeout)
269
267
  rescue Timeout::Error
270
- raise "xcodebuild -list timed-out after #{timeout} seconds. You might need to recreate the user schemes." \
271
- " You can override the timeout value with the environment variable FASTLANE_XCODE_LIST_TIMEOUT".red
268
+ UI.user_error!("xcodebuild -list timed-out after #{timeout} seconds. You might need to recreate the user schemes." \
269
+ " You can override the timeout value with the environment variable FASTLANE_XCODE_LIST_TIMEOUT")
272
270
  end
273
271
 
274
- raise "Error parsing xcode file using `#{command}`".red if @raw.length == 0
272
+ UI.user_error!("Error parsing xcode file using `#{command}`") if @raw.length == 0
275
273
 
276
274
  return @raw
277
275
  end
@@ -28,7 +28,7 @@ module FastlaneCore
28
28
  if (plist || []).count > 5
29
29
  plist
30
30
  else
31
- Helper.log.error("Error parsing provisioning profile at path '#{path}'".red)
31
+ UI.error("Error parsing provisioning profile at path '#{path}'")
32
32
  nil
33
33
  end
34
34
  end
@@ -50,7 +50,7 @@ module FastlaneCore
50
50
 
51
51
  # Installs a provisioning profile for Xcode to use
52
52
  def install(path)
53
- Helper.log.info "Installing provisioning profile..."
53
+ UI.message("Installing provisioning profile...")
54
54
  profile_filename = uuid(path) + ".mobileprovision"
55
55
  destination = File.join(profiles_path, profile_filename)
56
56
 
@@ -58,7 +58,7 @@ module FastlaneCore
58
58
  # copy to Xcode provisioning profile directory
59
59
  FileUtils.copy(path, destination)
60
60
  unless File.exist?(destination)
61
- raise "Failed installation of provisioning profile at location: '#{destination}'".red
61
+ UI.user_error!("Failed installation of provisioning profile at location: '#{destination}'")
62
62
  end
63
63
  end
64
64
 
@@ -8,7 +8,7 @@ module FastlaneCore
8
8
  end
9
9
 
10
10
  def all
11
- Helper.log.info "Fetching available devices" if $verbose
11
+ UI.message("Fetching available devices") if $verbose
12
12
 
13
13
  @devices = []
14
14
  os_type = 'unknown'
@@ -19,8 +19,8 @@ module FastlaneCore
19
19
  end
20
20
 
21
21
  unless output.include?("== Devices ==")
22
- Helper.log.error "xcrun simctl CLI broken, run `xcrun simctl list devices` and make sure it works".red
23
- raise "xcrun simctl not working.".red
22
+ UI.error("xcrun simctl CLI broken, run `xcrun simctl list devices` and make sure it works")
23
+ UI.user_error!("xcrun simctl not working.")
24
24
  end
25
25
 
26
26
  output.split(/\n/).each do |line|
@@ -58,7 +58,7 @@ module FastlaneCore
58
58
 
59
59
  # The code below works from Xcode 7 on
60
60
  # def all
61
- # Helper.log.info "Fetching available devices" if $verbose
61
+ # UI.message("Fetching available devices") if $verbose
62
62
 
63
63
  # @devices = []
64
64
  # output = ''
@@ -69,9 +69,9 @@ module FastlaneCore
69
69
  # begin
70
70
  # data = JSON.parse(output)
71
71
  # rescue => ex
72
- # Helper.log.error ex
73
- # Helper.log.error "xcrun simctl CLI broken, run `xcrun simctl list devices` and make sure it works".red
74
- # raise "xcrun simctl not working.".red
72
+ # UI.error(ex)
73
+ # UI.error("xcrun simctl CLI broken, run `xcrun simctl list devices` and make sure it works")
74
+ # UI.user_error!("xcrun simctl not working.")
75
75
  # end
76
76
 
77
77
  # data["devices"].each do |os_version, l|
@@ -118,7 +118,7 @@ module FastlaneCore
118
118
  end
119
119
 
120
120
  def reset
121
- Helper.log.info "Resetting #{self}"
121
+ UI.message("Resetting #{self}")
122
122
  `xcrun simctl shutdown #{self.udid}` if self.state == "Booted"
123
123
  `xcrun simctl erase #{self.udid}`
124
124
  return
@@ -45,6 +45,10 @@ module FastlaneCore
45
45
  log.info(message.to_s)
46
46
  end
47
47
 
48
+ def deprecated(message)
49
+ log.error(message.to_s.bold.blue)
50
+ end
51
+
48
52
  def command(message)
49
53
  log.info("$ #{message}".cyan.underline)
50
54
  end
@@ -63,9 +67,9 @@ module FastlaneCore
63
67
 
64
68
  def header(message)
65
69
  i = message.length + 8
66
- Helper.log.info(("-" * i).green)
67
- Helper.log.info(("--- " + message + " ---").green)
68
- Helper.log.info(("-" * i).green)
70
+ success("-" * i)
71
+ success("--- " + message + " ---")
72
+ success("-" * i)
69
73
  end
70
74
 
71
75
  #####################################################
@@ -38,6 +38,13 @@ module FastlaneCore
38
38
  not_implemented(__method__)
39
39
  end
40
40
 
41
+ # Level Deprecated: Show that a particular function is deprecated
42
+ #
43
+ # By default those messages shown in strong blue
44
+ def deprecated(_message)
45
+ not_implemented(__method__)
46
+ end
47
+
41
48
  # Level Command: Print out a terminal command that is being
42
49
  # executed.
43
50
  #
@@ -136,7 +143,7 @@ module FastlaneCore
136
143
  # @!group Helpers
137
144
  #####################################################
138
145
  def not_implemented(method_name)
139
- raise "Current UI '#{self}' doesn't support method '#{method_name}'".red
146
+ UI.user_error!("Current UI '#{self}' doesn't support method '#{method_name}'")
140
147
  end
141
148
 
142
149
  def to_s
@@ -9,7 +9,7 @@ module FastlaneCore
9
9
  def self.method_missing(method_sym, *args, &_block)
10
10
  # not using `responds` beacuse we don't care about methods like .to_s and so on
11
11
  interface_methods = Interface.instance_methods - Object.instance_methods
12
- raise "Unknown method '#{method_sym}', supported #{interface_methods}" unless interface_methods.include?(method_sym)
12
+ UI.user_error!("Unknown method '#{method_sym}', supported #{interface_methods}") unless interface_methods.include?(method_sym)
13
13
 
14
14
  self.current.send(method_sym, *args)
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module FastlaneCore
2
- VERSION = "0.39.1".freeze
2
+ VERSION = "0.40.0".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.39.1
4
+ version: 0.40.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: 2016-03-24 00:00:00.000000000 Z
11
+ date: 2016-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json