fastlane 0.1.8 → 0.1.9

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: 9a3a2a536f09df1917c15ac5eb551e903fa0815a
4
- data.tar.gz: b3ecbd749ccfd75580392fc72c840ef53e2a09a1
3
+ metadata.gz: c464e783663a94ab157e27d681407a763976b625
4
+ data.tar.gz: 36abfb852e100300bfbe2a2ef82fa569f2d10014
5
5
  SHA512:
6
- metadata.gz: 61d77640d296490e31906cfd8d45d2ed879978b3bbab42cbdb8bcda580bea2085e75b1c0e896dfd484a3b5d3e721a24d5592fb8463371b6730fd71698aff7e02
7
- data.tar.gz: e73b1d0d0c6ae17295abb670b49f9fe296312de7da4f2bfdabdd7d42a2d1a9e348ec956d94b876850facf90bbba7a7f0a1612dc491f4b0905281ac146c2b0d10
6
+ metadata.gz: 864d22e356eb44b600e903526243f07cc84a10ce064acee755607a3f8b694956cc203b824f48d4732556200610bbccbfe971e7fb4494baf77232a5a3968adf95
7
+ data.tar.gz: 248eb32876dc82f653b7371f0a2f44a862af482c50f46320306df1405870c2afbeba79b594a55948ef4d1b77d3ec4bc368374073fadd94c4f1ba613b969467a6
data/README.md CHANGED
@@ -178,11 +178,11 @@ Build your app right inside `fastlane` and the path to the resulting ipa is auto
178
178
  ipa({
179
179
  workspace: "MyApp.xcworkspace",
180
180
  configuration: "Debug",
181
- scheme: "Debug",
181
+ scheme: "MyApp",
182
182
  })
183
183
  ```
184
184
 
185
- The path to the `ipa` is automatically used by `Crashlytics`, `Hockey` and `DeployGate`. To use also use it in `deliver` update your `Deliverfile`:
185
+ The path to the `ipa` is automatically used by `Crashlytics`, `Hockey` and `DeployGate`. To also use it in `deliver` update your `Deliverfile`:
186
186
 
187
187
  ```ruby
188
188
  ipa ENV["IPA_OUTPUT_PATH"]
@@ -438,6 +438,7 @@ Actions::SharedValues::DEPLOYGATE_APP_INFO # Hash, generated by `deploygate`
438
438
  ```ruby
439
439
  before_all do
440
440
  ENV["SLACK_URL"] = "https://hooks.slack.com/services/..."
441
+ team_id "Q2CBPK58CA"
441
442
 
442
443
  increment_build_number
443
444
  cocoapods
@@ -474,6 +475,14 @@ error do |lane, exception|
474
475
  end
475
476
  ```
476
477
 
478
+ #### Set Team ID for all tools
479
+
480
+ To set a team ID for `sigh`, `PEM` and the other tools, add this code to your `before_all` block:
481
+
482
+ ```ruby
483
+ team_id "Q2CBPK58CA"
484
+ ```
485
+
477
486
  #### Snapshot
478
487
  To skip cleaning the project on every build:
479
488
  ```ruby
@@ -495,6 +504,12 @@ Keep in mind the ```before_all``` and ```after_all``` block will be executed for
495
504
  #### Hide the `fastlane` folder
496
505
  Just rename the folder to `.fastlane` in case you don't want it to be visible in the Finder.
497
506
 
507
+ #### Select Xcode version (e.g. Beta Version)
508
+ If you want to use a Beta Xcode installation, you can add this to your `before_all` block.
509
+ ```
510
+ ENV['DEVELOPER_DIR'] = '/Applications/Xcode-Beta6.3.app/Contents/Developer'
511
+ ```
512
+
498
513
  #### Load own actions from external folder
499
514
  Add this to the top of your `Fastfile` (*.* is the `fastlane` folder)
500
515
  ```ruby
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $:.push File.expand_path("../../lib", __FILE__)
3
+ $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
4
4
 
5
5
  require 'fastlane'
6
6
  require 'commander'
@@ -8,7 +8,6 @@ require 'fastlane/new_action'
8
8
 
9
9
  HighLine.track_eof = false
10
10
 
11
-
12
11
  class FastlaneApplication
13
12
  include Commander::Methods
14
13
 
@@ -26,11 +25,11 @@ class FastlaneApplication
26
25
  c.syntax = 'fastlane run [lane]'
27
26
  c.description = 'Drive the fastlane for a specific environment.'
28
27
 
29
- c.action do |args, options|
28
+ c.action do |args, _options|
30
29
  if Fastlane::FastlaneFolder.path
31
30
  Fastlane::LaneManager.cruise_lanes(args)
32
31
  else
33
- create = agree("Could not find fastlane in current directory. Would you like to set it up? (y/n)".yellow, true)
32
+ create = agree('Could not find fastlane in current directory. Would you like to set it up? (y/n)'.yellow, true)
34
33
  Fastlane::Setup.new.run if create
35
34
  end
36
35
  end
@@ -40,7 +39,7 @@ class FastlaneApplication
40
39
  c.syntax = 'fastlane init'
41
40
  c.description = 'Helps you setting up fastlane based on your existing tools.'
42
41
 
43
- c.action do |args, options|
42
+ c.action do |_args, _options|
44
43
  Fastlane::Setup.new.run
45
44
  end
46
45
  end
@@ -49,7 +48,7 @@ class FastlaneApplication
49
48
  c.syntax = 'fastlane new_action'
50
49
  c.description = 'Create a new custom action for fastlane.'
51
50
 
52
- c.action do |args, options|
51
+ c.action do |_args, _options|
53
52
  Fastlane::NewAction.run
54
53
  end
55
54
  end
@@ -10,9 +10,15 @@ before_all do
10
10
 
11
11
  # sh "./customShellScript.sh"
12
12
 
13
+ cocoapods
14
+
13
15
  # increment_build_number
14
16
 
15
- cocoapods
17
+ ipa({
18
+ workspace: "MyApp.xcworkspace",
19
+ configuration: "Debug",
20
+ scheme: "MyApp",
21
+ })
16
22
 
17
23
  xctool
18
24
  end
@@ -1,28 +1,35 @@
1
1
  require 'json'
2
2
  require 'fastlane/version'
3
3
  require 'fastlane/fast_file'
4
- require 'fastlane/helper'
5
4
  require 'fastlane/dependency_checker'
6
5
  require 'fastlane/runner'
7
6
  require 'fastlane/setup'
8
7
  require 'fastlane/fastlane_folder'
9
- require 'fastlane/update_checker'
10
8
  require 'fastlane/junit_generator'
11
9
  require 'fastlane/lane_manager'
12
10
  require 'fastlane/actions/actions_helper'
13
11
 
12
+ require 'fastlane_core'
13
+
14
14
  # Third Party code
15
15
  require 'colored'
16
16
 
17
17
  module Fastlane
18
- TMP_FOLDER = "/tmp/fastlane/"
18
+ Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
19
19
 
20
- UpdateChecker.verify_latest_version
20
+ FastlaneCore::UpdateChecker.verify_latest_version('fastlane', Fastlane::VERSION)
21
21
 
22
22
  Fastlane::Actions.load_default_actions
23
23
 
24
24
  if Fastlane::FastlaneFolder.path
25
- actions_path = File.join(Fastlane::FastlaneFolder.path, "actions")
26
- Fastlane::Actions.load_external_actions(actions_path) if File.directory?actions_path
25
+ actions_path = File.join(Fastlane::FastlaneFolder.path, 'actions')
26
+ Fastlane::Actions.load_external_actions(actions_path) if File.directory?(actions_path)
27
27
  end
28
28
  end
29
+
30
+
31
+ class String
32
+ def classify
33
+ split('_').collect!(&:capitalize).join
34
+ end
35
+ end
@@ -7,19 +7,19 @@ module Fastlane
7
7
  end
8
8
 
9
9
  def self.executed_actions
10
- @@executed_actions ||= []
10
+ @executed_actions ||= []
11
11
  end
12
12
 
13
13
  # The shared hash can be accessed by any action and contains information like the screenshots path or beta URL
14
14
  def self.lane_context
15
- @@lane_context ||= {}
15
+ @lane_context ||= {}
16
16
  end
17
17
 
18
18
  # Pass a block which should be tracked. One block = one testcase
19
19
  # @param step_name (String) the name of the currently built code (e.g. snapshot, sigh, ...)
20
20
  def self.execute_action(step_name)
21
- raise "No block given".red unless block_given?
22
-
21
+ raise 'No block given'.red unless block_given?
22
+
23
23
  start = Time.now
24
24
  error = nil
25
25
  exc = nil
@@ -34,7 +34,7 @@ module Fastlane
34
34
  # This is also called, when the block has a return statement
35
35
  duration = Time.now - start
36
36
 
37
- self.executed_actions << {
37
+ executed_actions << {
38
38
  name: step_name,
39
39
  error: error,
40
40
  time: duration
@@ -46,33 +46,34 @@ module Fastlane
46
46
  # Execute a shell command
47
47
  # This method will output the string and execute it
48
48
  def self.sh(command)
49
- return sh_no_action(command)
49
+ sh_no_action(command)
50
50
  end
51
51
 
52
52
  def self.sh_no_action(command)
53
- command = command.join(" ") if command.kind_of?Array # since it's an array of one element when running from the Fastfile
54
- Helper.log.info ["[SHELL COMMAND]", command.yellow].join(': ')
55
-
56
- result = ""
57
- unless Helper.is_test?
58
-
59
- PTY.spawn(command) do |stdin, stdout, pid|
60
- stdin.each do |line|
61
- Helper.log.info ["[SHELL OUTPUT]", line.strip].join(': ')
53
+ command = command.join(' ') if command.is_a?(Array) # since it's an array of one element when running from the Fastfile
54
+ Helper.log.info ['[SHELL COMMAND]', command.yellow].join(': ')
55
+
56
+ result = ''
57
+ unless Helper.test?
58
+ exit_status = nil
59
+ status = IO.popen(command, err: [:child, :out]) do |io|
60
+ io.each do |line|
61
+ Helper.log.info ['[SHELL OUTPUT]', line.strip].join(': ')
62
62
  result << line
63
63
  end
64
-
65
- Process.wait(pid)
64
+ io.close
65
+ exit_status = $?.to_i
66
66
  end
67
67
 
68
- if $?.exitstatus.to_i != 0
69
- raise "Exit status of command '#{command}' was #{$?.exitstatus.to_s} instead of 0. \n#{result}" # this will also append the output to the exception (for the Jenkins reports)
68
+ if exit_status != 0
69
+ # this will also append the output to the exception (for the Jenkins reports)
70
+ raise "Exit status of command '#{command}' was #{exit_status} instead of 0. \n#{result}"
70
71
  end
71
72
  else
72
73
  result << command # only for the tests
73
74
  end
74
75
 
75
- return result
76
+ result
76
77
  end
77
78
 
78
79
  def self.load_default_actions
@@ -82,14 +83,14 @@ module Fastlane
82
83
  end
83
84
 
84
85
  def self.load_external_actions(path)
85
- raise "You need to pass a valid path" unless File.exists?path
86
+ raise 'You need to pass a valid path' unless File.exist?(path)
86
87
 
87
88
  Dir[File.expand_path '*.rb', path].each do |file|
88
89
  require file
89
-
90
- file_name = File.basename(file).gsub(".rb", "")
91
90
 
92
- class_name = file_name.classify + "Action"
91
+ file_name = File.basename(file).gsub('.rb', '')
92
+
93
+ class_name = file_name.classify + 'Action'
93
94
  class_ref = nil
94
95
  begin
95
96
  class_ref = Fastlane::Actions.const_get(class_name)
@@ -98,16 +99,16 @@ module Fastlane
98
99
  Helper.log.info "Successfully loaded custom action '#{file}'.".green
99
100
  else
100
101
  Helper.log.error "Could not find method 'run' in class #{class_name}.".red
101
- Helper.log.error "For more information, check out the docs: https://github.com/KrauseFx/fastlane"
102
+ Helper.log.error 'For more information, check out the docs: https://github.com/KrauseFx/fastlane'
102
103
  raise "Plugin '#{file_name}' is damaged!"
103
104
  end
104
105
  rescue NameError => ex
105
106
  # Action not found
106
107
  Helper.log.error "Could not find '#{class_name}' class defined.".red
107
- Helper.log.error "For more information, check out the docs: https://github.com/KrauseFx/fastlane"
108
+ Helper.log.error 'For more information, check out the docs: https://github.com/KrauseFx/fastlane'
108
109
  raise "Plugin '#{file_name}' is damaged!"
109
110
  end
110
111
  end
111
112
  end
112
113
  end
113
- end
114
+ end
@@ -1,13 +1,13 @@
1
1
  # TODO: Workaround, since crashlytics.rb from shenzhen includes the code for commander.
2
- def command(param)
2
+ def command(_param)
3
3
  end
4
4
 
5
5
  module Fastlane
6
6
  module Actions
7
7
  class CrashlyticsAction
8
8
  def self.run(params)
9
- require "shenzhen"
10
- require "shenzhen/plugins/crashlytics"
9
+ require 'shenzhen'
10
+ require 'shenzhen/plugins/crashlytics'
11
11
 
12
12
  assert_params_given!(params)
13
13
 
@@ -23,19 +23,19 @@ module Fastlane
23
23
 
24
24
  assert_valid_params!(crashlytics_path, api_token, build_secret, ipa_path)
25
25
 
26
- Helper.log.info "Uploading the IPA to Crashlytics. Go for a coffee ☕️.".green
26
+ Helper.log.info 'Uploading the IPA to Crashlytics. Go for a coffee ☕️.'.green
27
27
 
28
- return if Helper.is_test?
28
+ return if Helper.test?
29
29
 
30
30
  client = Shenzhen::Plugins::Crashlytics::Client.new(crashlytics_path, api_token, build_secret)
31
31
 
32
32
  response = client.upload_build(ipa_path, file: ipa_path, notes: notes_path, emails: emails, groups: groups)
33
33
 
34
34
  if response
35
- Helper.log.info "Build successfully uploaded to Crashlytics".green
35
+ Helper.log.info 'Build successfully uploaded to Crashlytics'.green
36
36
  else
37
- Helper.log.fatal "Error uploading to Crashlytics."
38
- raise "Error when trying to upload ipa to Crashlytics".red
37
+ Helper.log.fatal 'Error uploading to Crashlytics.'
38
+ raise 'Error when trying to upload ipa to Crashlytics'.red
39
39
  end
40
40
  end
41
41
 
@@ -43,7 +43,7 @@ module Fastlane
43
43
 
44
44
  def self.assert_params_given!(params)
45
45
  return unless params.empty?
46
- raise "You have to pass Crashlytics parameters to the Crashlytics action, take a look at https://github.com/KrauseFx/fastlane#crashlytics".red
46
+ raise 'You have to pass Crashlytics parameters to the Crashlytics action, take a look at https://github.com/KrauseFx/fastlane#crashlytics'.red
47
47
  end
48
48
 
49
49
  def self.assert_valid_params!(crashlytics_path, api_token, build_secret, ipa_path)
@@ -54,7 +54,7 @@ module Fastlane
54
54
  end
55
55
 
56
56
  def self.assert_valid_crashlytics_path!(crashlytics_path)
57
- return if crashlytics_path && File.exists?(crashlytics_path)
57
+ return if crashlytics_path && File.exist?(crashlytics_path)
58
58
  raise "No Crashlytics path given or found, pass using `crashlytics_path: 'path'`".red
59
59
  end
60
60
 
@@ -69,12 +69,16 @@ module Fastlane
69
69
  end
70
70
 
71
71
  def self.assert_valid_ipa_path!(ipa_path)
72
- return if ipa_path && File.exists?(ipa_path)
72
+ return if ipa_path && File.exist?(ipa_path)
73
73
  raise "No IPA file given or found, pass using `ipa_path: 'path/app.ipa'`".red
74
74
  end
75
75
 
76
- private_class_method :assert_params_given!, :assert_valid_params!,
77
- :assert_valid_crashlytics_path!, :assert_valid_api_token!, :assert_valid_build_secret!, :assert_valid_ipa_path!
76
+ private_class_method :assert_params_given!,
77
+ :assert_valid_params!,
78
+ :assert_valid_crashlytics_path!,
79
+ :assert_valid_api_token!,
80
+ :assert_valid_build_secret!,
81
+ :assert_valid_ipa_path!
78
82
  end
79
83
  end
80
84
  end
@@ -1,28 +1,28 @@
1
1
  module Fastlane
2
2
  module Actions
3
3
  module SharedValues
4
-
5
4
  end
6
5
 
7
6
  class DeliverAction
8
7
  def self.run(params)
9
8
  require 'deliver'
10
-
11
- ENV["DELIVER_SCREENSHOTS_PATH"] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
12
-
9
+
10
+ ENV['DELIVER_SCREENSHOTS_PATH'] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
11
+
13
12
  force = params.include?(:force)
14
13
  beta = params.include?(:beta)
15
14
  skip_deploy = params.include?(:skip_deploy)
16
15
 
17
16
  Dir.chdir(FastlaneFolder.path || Dir.pwd) do
18
17
  # This should be executed in the fastlane folder
19
- Deliver::Deliverer.new(nil, force: force,
20
- is_beta_ipa: beta,
21
- skip_deploy: skip_deploy)
18
+ Deliver::Deliverer.new(nil,
19
+ force: force,
20
+ is_beta_ipa: beta,
21
+ skip_deploy: skip_deploy)
22
22
 
23
- Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = ENV["DELIVER_IPA_PATH"] # deliver will store it in the environment
23
+ Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] = ENV['DELIVER_IPA_PATH'] # deliver will store it in the environment
24
24
  end
25
25
  end
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -1,5 +1,5 @@
1
1
  # TODO: Workaround, since deploygate.rb from shenzhen includes the code for commander
2
- def command(param)
2
+ def command(_param)
3
3
  end
4
4
 
5
5
  module Fastlane
@@ -19,35 +19,34 @@ module Fastlane
19
19
 
20
20
  # Available options: https://deploygate.com/docs/api
21
21
  options = {
22
- ipa: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH],
22
+ ipa: Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
23
23
  }.merge(params.first || {})
24
24
  assert_options!(options)
25
25
 
26
- Helper.log.info "Starting with ipa upload to DeployGate... this could take some time ⏳".green
26
+ Helper.log.info 'Starting with ipa upload to DeployGate... this could take some time ⏳'.green
27
27
  client = Shenzhen::Plugins::DeployGate::Client.new(
28
28
  options.delete(:api_token),
29
29
  options.delete(:user)
30
30
  )
31
31
 
32
- return if Helper.is_test?
32
+ return if Helper.test?
33
33
 
34
34
  response = client.upload_build(options.delete(:ipa), options)
35
35
  if parse_response(response)
36
36
  Helper.log.info "DeployGate URL: #{Actions.lane_context[SharedValues::DEPLOYGATE_URL]}"
37
37
  Helper.log.info "Build successfully uploaded to DeployGate as revision \##{Actions.lane_context[SharedValues::DEPLOYGATE_REVISION]}!".green
38
38
  else
39
- raise "Error when trying to upload ipa to DeployGate".red
39
+ raise 'Error when trying to upload ipa to DeployGate'.red
40
40
  end
41
41
  end
42
42
 
43
- private
44
-
45
43
  def self.assert_options!(options)
46
44
  raise "No API Token for DeployGate given, pass using `api_token: 'token'`".red unless options[:api_token].to_s.length > 0
47
45
  raise "No User for app given, pass using `user: 'user'`".red unless options[:user].to_s.length > 0
48
46
  raise "No IPA file given or found, pass using `ipa: 'path.ipa'`".red unless options[:ipa]
49
- raise "IPA file on path '#{File.expand_path(options[:ipa])}' not found".red unless File.exists?(options[:ipa])
47
+ raise "IPA file on path '#{File.expand_path(options[:ipa])}' not found".red unless File.exist?(options[:ipa])
50
48
  end
49
+ private_class_method :assert_options!
51
50
 
52
51
  def self.parse_response(response)
53
52
  if response.body && response.body.key?('error')
@@ -69,19 +68,21 @@ module Fastlane
69
68
  end
70
69
  true
71
70
  end
71
+ private_class_method :parse_response
72
72
 
73
73
  def self.help_message(response)
74
74
  message =
75
75
  case response.body['message']
76
76
  when 'you are not authenticated'
77
- "Invalid API Token specified."
77
+ 'Invalid API Token specified.'
78
78
  when 'application create error: permit'
79
- "Access denied: May be trying to upload to wrong user or updating app you join as a tester?"
79
+ 'Access denied: May be trying to upload to wrong user or updating app you join as a tester?'
80
80
  when 'application create error: limit'
81
- "Plan limit: You have reached to the limit of current plan or your plan was expired."
81
+ 'Plan limit: You have reached to the limit of current plan or your plan was expired.'
82
82
  end
83
83
  Helper.log.error message.red if message
84
84
  end
85
+ private_class_method :help_message
85
86
  end
86
87
  end
87
- end
88
+ end