fastlane 1.20.0 → 1.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fastlane +16 -16
- data/lib/assets/custom_action_template.rb +2 -2
- data/lib/fastlane.rb +1 -0
- data/lib/fastlane/action.rb +5 -6
- data/lib/fastlane/action_collector.rb +6 -6
- data/lib/fastlane/actions/actions_helper.rb +12 -74
- data/lib/fastlane/actions/add_git_tag.rb +2 -2
- data/lib/fastlane/actions/appstore.rb +2 -2
- data/lib/fastlane/actions/backup_file.rb +2 -2
- data/lib/fastlane/actions/backup_xcarchive.rb +11 -12
- data/lib/fastlane/actions/bundle_install.rb +5 -1
- data/lib/fastlane/actions/chatwork.rb +12 -12
- data/lib/fastlane/actions/clean_build_artifacts.rb +4 -6
- data/lib/fastlane/actions/clipboard.rb +1 -1
- data/lib/fastlane/actions/commit_version_bump.rb +35 -10
- data/lib/fastlane/actions/crashlytics.rb +26 -26
- data/lib/fastlane/actions/create_keychain.rb +6 -6
- data/lib/fastlane/actions/default_platform.rb +1 -1
- data/lib/fastlane/actions/delete_keychain.rb +3 -3
- data/lib/fastlane/actions/deliver.rb +3 -3
- data/lib/fastlane/actions/deploygate.rb +19 -18
- data/lib/fastlane/actions/dsym_zip.rb +7 -9
- data/lib/fastlane/actions/ensure_git_branch.rb +2 -3
- data/lib/fastlane/actions/ensure_no_debug_code.rb +8 -8
- data/lib/fastlane/actions/fastlane_version.rb +4 -2
- data/lib/fastlane/actions/frameit.rb +7 -7
- data/lib/fastlane/actions/gcovr.rb +5 -4
- data/lib/fastlane/actions/get_build_number.rb +27 -30
- data/lib/fastlane/actions/get_github_release.rb +11 -11
- data/lib/fastlane/actions/get_version_number.rb +28 -30
- data/lib/fastlane/actions/git_branch.rb +1 -2
- data/lib/fastlane/actions/gym.rb +2 -2
- data/lib/fastlane/actions/hg_commit_version_bump.rb +28 -6
- data/lib/fastlane/actions/hg_push.rb +0 -1
- data/lib/fastlane/actions/hipchat.rb +20 -20
- data/lib/fastlane/actions/hockey.rb +16 -17
- data/lib/fastlane/actions/import.rb +1 -2
- data/lib/fastlane/actions/import_certificate.rb +1 -1
- data/lib/fastlane/actions/import_from_git.rb +6 -2
- data/lib/fastlane/actions/increment_build_number.rb +25 -28
- data/lib/fastlane/actions/increment_version_number.rb +55 -57
- data/lib/fastlane/actions/install_carthage.rb +10 -11
- data/lib/fastlane/actions/install_cocoapods.rb +3 -3
- data/lib/fastlane/actions/ipa.rb +8 -6
- data/lib/fastlane/actions/is_ci.rb +37 -0
- data/lib/fastlane/actions/lane_context.rb +2 -2
- data/lib/fastlane/actions/last_git_tag.rb +1 -1
- data/lib/fastlane/actions/lcov.rb +28 -31
- data/lib/fastlane/actions/mailgun.rb +11 -42
- data/lib/fastlane/actions/oclint.rb +10 -13
- data/lib/fastlane/actions/pem.rb +2 -2
- data/lib/fastlane/actions/pilot.rb +4 -2
- data/lib/fastlane/actions/prompt.rb +6 -6
- data/lib/fastlane/actions/push_git_tags.rb +38 -0
- data/lib/fastlane/actions/push_to_git_remote.rb +4 -1
- data/lib/fastlane/actions/puts.rb +1 -1
- data/lib/fastlane/actions/register_devices.rb +4 -3
- data/lib/fastlane/actions/reset_git_repo.rb +6 -6
- data/lib/fastlane/actions/resign.rb +4 -5
- data/lib/fastlane/actions/restore_file.rb +2 -2
- data/lib/fastlane/actions/s3.rb +19 -22
- data/lib/fastlane/actions/set_build_number_repository.rb +26 -36
- data/lib/fastlane/actions/set_changelog.rb +4 -4
- data/lib/fastlane/actions/set_github_release.rb +10 -11
- data/lib/fastlane/actions/sigh.rb +1 -1
- data/lib/fastlane/actions/slack.rb +85 -74
- data/lib/fastlane/actions/snapshot.rb +2 -2
- data/lib/fastlane/actions/team_id.rb +2 -1
- data/lib/fastlane/actions/team_name.rb +2 -1
- data/lib/fastlane/actions/testflight.rb +2 -2
- data/lib/fastlane/actions/testmunk.rb +16 -16
- data/lib/fastlane/actions/typetalk.rb +14 -14
- data/lib/fastlane/actions/update_app_group_identifiers.rb +17 -17
- data/lib/fastlane/actions/update_fastlane.rb +16 -14
- data/lib/fastlane/actions/update_info_plist.rb +14 -16
- data/lib/fastlane/actions/update_project_code_signing.rb +3 -3
- data/lib/fastlane/actions/update_project_provisioning.rb +48 -36
- data/lib/fastlane/actions/xcode_select.rb +4 -3
- data/lib/fastlane/actions/xcode_server_get_assets.rb +23 -24
- data/lib/fastlane/actions/xcodebuild.rb +13 -13
- data/lib/fastlane/actions/xctool.rb +2 -2
- data/lib/fastlane/actions_list.rb +27 -29
- data/lib/fastlane/command_line_handler.rb +13 -14
- data/lib/fastlane/configuration_helper.rb +18 -20
- data/lib/fastlane/core_ext/string.rb +2 -2
- data/lib/fastlane/docs_generator.rb +33 -32
- data/lib/fastlane/erb_template_helper.rb +1 -1
- data/lib/fastlane/fast_file.rb +27 -18
- data/lib/fastlane/fastlane_folder.rb +1 -1
- data/lib/fastlane/helper/git_helper.rb +27 -0
- data/lib/fastlane/helper/sh_helper.rb +48 -0
- data/lib/fastlane/junit_generator.rb +1 -1
- data/lib/fastlane/lane.rb +6 -6
- data/lib/fastlane/lane_list.rb +12 -13
- data/lib/fastlane/lane_manager.rb +17 -11
- data/lib/fastlane/new_action.rb +1 -1
- data/lib/fastlane/runner.rb +23 -24
- data/lib/fastlane/setup.rb +16 -17
- data/lib/fastlane/supported_platforms.rb +2 -2
- data/lib/fastlane/version.rb +1 -1
- metadata +16 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3688edd276635af01ff6dbde0e3ec6786ab5536
|
4
|
+
data.tar.gz: ad234477739a849996fff29f8a193095fae7eea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99d5d48ba2a9107b87dcfcd571b3ec0a4580976685c0a45ecbed9039fde34840aaa90e13590e2fa0f619576088f350995f1f440d40b116fee916bde2bbad31d7
|
7
|
+
data.tar.gz: e0941d32fdbf8236d06098f8672fb073260e85adad502adc52a8a505260cfc38795d3e712700c3e01b5f65cc75c17f8283a54d2e8771d373d2e45138cab25ee7
|
data/bin/fastlane
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# rubocop:disable Metrics/AbcSize
|
2
3
|
|
3
4
|
$LOAD_PATH.push File.expand_path('../../lib', __FILE__)
|
4
5
|
|
@@ -22,17 +23,15 @@ class FastlaneApplication
|
|
22
23
|
program :help, 'GitHub', 'https://github.com/krausefx/fastlane'
|
23
24
|
program :help_formatter, :compact
|
24
25
|
|
25
|
-
always_trace!
|
26
|
-
|
27
26
|
command :run do |c|
|
28
27
|
c.syntax = 'fastlane run [lane]'
|
29
28
|
c.description = 'Drive the fastlane for a specific environment. Pass the lane name and optionally the platform first'
|
30
29
|
c.option '--env STRING', String, 'Add environment to use with `dotenv`'
|
31
30
|
|
32
|
-
c.action do |args,
|
31
|
+
c.action do |args, options|
|
33
32
|
if Fastlane::FastlaneFolder.path
|
34
33
|
|
35
|
-
Fastlane::CommandLineHandler.handle(args,
|
34
|
+
Fastlane::CommandLineHandler.handle(args, options)
|
36
35
|
else
|
37
36
|
create = agree('Could not find fastlane in current directory. Would you like to set it up? (y/n)'.yellow, true)
|
38
37
|
Fastlane::Setup.new.run if create
|
@@ -44,7 +43,7 @@ class FastlaneApplication
|
|
44
43
|
c.syntax = 'fastlane init'
|
45
44
|
c.description = 'Helps you setting up fastlane based on your existing tools.'
|
46
45
|
|
47
|
-
c.action do |
|
46
|
+
c.action do |args, options|
|
48
47
|
Fastlane::Setup.new.run
|
49
48
|
end
|
50
49
|
end
|
@@ -53,7 +52,7 @@ class FastlaneApplication
|
|
53
52
|
c.syntax = 'fastlane new_action'
|
54
53
|
c.description = 'Create a new custom action for fastlane.'
|
55
54
|
|
56
|
-
c.action do |
|
55
|
+
c.action do |args, options|
|
57
56
|
Fastlane::NewAction.run
|
58
57
|
end
|
59
58
|
end
|
@@ -62,7 +61,7 @@ class FastlaneApplication
|
|
62
61
|
c.syntax = 'fastlane lanes'
|
63
62
|
c.description = 'Lists all available lanes and shows their description'
|
64
63
|
|
65
|
-
c.action do |
|
64
|
+
c.action do |args, options|
|
66
65
|
require 'fastlane/lane_list'
|
67
66
|
path = File.join(Fastlane::FastlaneFolder.path || '.', 'Fastfile')
|
68
67
|
Fastlane::LaneList.output(path)
|
@@ -72,7 +71,7 @@ class FastlaneApplication
|
|
72
71
|
command :list do |c|
|
73
72
|
c.syntax = 'fastlane list'
|
74
73
|
c.description = 'Lists all available lanes without description'
|
75
|
-
c.action do |
|
74
|
+
c.action do |args, options|
|
76
75
|
ff = Fastlane::FastFile.new(File.join(Fastlane::FastlaneFolder.path || '.', 'Fastfile'))
|
77
76
|
puts "\nAvailable lanes:".green
|
78
77
|
ff.runner.available_lanes.each do |lane|
|
@@ -87,10 +86,10 @@ class FastlaneApplication
|
|
87
86
|
c.description = 'Generate a markdown based documentation based on the Fastfile'
|
88
87
|
c.option '-f', '--force', 'Overwrite the existing README.md in the ./fastlane folder'
|
89
88
|
|
90
|
-
c.action do |
|
89
|
+
c.action do |args, options|
|
91
90
|
path = File.join(Fastlane::FastlaneFolder.path || '.', 'README.md')
|
92
|
-
if File.
|
93
|
-
return unless agree('Found existing ./fastlane/README.md. Do you want to overwrite it? (y/n)', true)
|
91
|
+
if File.exist? path and !options.force
|
92
|
+
return nil unless agree('Found existing ./fastlane/README.md. Do you want to overwrite it? (y/n)', true)
|
94
93
|
end
|
95
94
|
|
96
95
|
ff = Fastlane::FastFile.new(File.join(Fastlane::FastlaneFolder.path || '.', 'Fastfile'))
|
@@ -104,18 +103,18 @@ class FastlaneApplication
|
|
104
103
|
c.syntax = 'fastlane actions'
|
105
104
|
c.description = 'Lists all available fastlane actions'
|
106
105
|
|
107
|
-
c.action do |
|
106
|
+
c.action do |args, options|
|
108
107
|
require 'fastlane/actions_list'
|
109
|
-
Fastlane::ActionsList.run(
|
108
|
+
Fastlane::ActionsList.run(args.first)
|
110
109
|
end
|
111
110
|
end
|
112
111
|
|
113
112
|
command :action do |c|
|
114
113
|
c.syntax = 'fastlane action [tool_name]'
|
115
114
|
c.description = 'Shows more information for a specific command'
|
116
|
-
c.action do |
|
115
|
+
c.action do |args, options|
|
117
116
|
require 'fastlane/actions_list'
|
118
|
-
Fastlane::ActionsList.run(
|
117
|
+
Fastlane::ActionsList.run(args.first)
|
119
118
|
end
|
120
119
|
end
|
121
120
|
|
@@ -130,4 +129,5 @@ begin
|
|
130
129
|
FastlaneApplication.new.run
|
131
130
|
ensure
|
132
131
|
FastlaneCore::UpdateChecker.show_update_status('fastlane', Fastlane::VERSION)
|
133
|
-
end
|
132
|
+
end
|
133
|
+
# rubocop:enable Metrics/AbcSize
|
@@ -44,7 +44,7 @@ module Fastlane
|
|
44
44
|
FastlaneCore::ConfigItem.new(key: :api_token,
|
45
45
|
env_name: "FL_[[NAME_UP]]_API_TOKEN", # The name of the environment variable
|
46
46
|
description: "API Token for [[NAME_CLASS]]", # a short description of this parameter
|
47
|
-
verify_block:
|
47
|
+
verify_block: proc do |value|
|
48
48
|
raise "No API token for [[NAME_CLASS]] given, pass using `api_token: 'token'`".red unless (value and not value.empty?)
|
49
49
|
end),
|
50
50
|
FastlaneCore::ConfigItem.new(key: :development,
|
@@ -75,7 +75,7 @@ module Fastlane
|
|
75
75
|
#
|
76
76
|
# platform == :ios
|
77
77
|
#
|
78
|
-
# [:ios, :mac].include?platform
|
78
|
+
# [:ios, :mac].include? platform
|
79
79
|
#
|
80
80
|
|
81
81
|
platform == :ios
|
data/lib/fastlane.rb
CHANGED
@@ -21,6 +21,7 @@ module Fastlane
|
|
21
21
|
Helper = FastlaneCore::Helper # you gotta love Ruby: Helper.* should use the Helper class contained in FastlaneCore
|
22
22
|
|
23
23
|
Fastlane::Actions.load_default_actions
|
24
|
+
Fastlane::Actions.load_helpers
|
24
25
|
|
25
26
|
if Fastlane::FastlaneFolder.path
|
26
27
|
actions_path = File.join(Fastlane::FastlaneFolder.path, 'actions')
|
data/lib/fastlane/action.rb
CHANGED
@@ -3,7 +3,6 @@ require 'fastlane/actions/actions_helper'
|
|
3
3
|
module Fastlane
|
4
4
|
class Action
|
5
5
|
def self.run(params)
|
6
|
-
|
7
6
|
end
|
8
7
|
|
9
8
|
# Implement in subclasses
|
@@ -44,11 +43,11 @@ module Fastlane
|
|
44
43
|
def self.is_supported?(platform)
|
45
44
|
# you can do things like
|
46
45
|
# true
|
47
|
-
#
|
46
|
+
#
|
48
47
|
# platform == :ios
|
49
|
-
#
|
50
|
-
# [:ios, :android].include?platform
|
51
|
-
#
|
48
|
+
#
|
49
|
+
# [:ios, :android].include? platform
|
50
|
+
#
|
52
51
|
raise "Implementing `is_supported?` for all actions is mandatory. Please update #{self}".red
|
53
52
|
end
|
54
53
|
|
@@ -68,4 +67,4 @@ module Fastlane
|
|
68
67
|
self.name.split('::').last.gsub('Action', '').fastlane_underscore
|
69
68
|
end
|
70
69
|
end
|
71
|
-
end
|
70
|
+
end
|
@@ -32,9 +32,9 @@ module Fastlane
|
|
32
32
|
require 'excon'
|
33
33
|
url = HOST_URL + '/did_launch?'
|
34
34
|
url += URI.encode_www_form(
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
steps: launches.to_json,
|
36
|
+
error: @error
|
37
|
+
)
|
38
38
|
|
39
39
|
unless Helper.is_test? # don't send test data
|
40
40
|
fork do
|
@@ -57,15 +57,15 @@ module Fastlane
|
|
57
57
|
|
58
58
|
def is_official?(name)
|
59
59
|
return true if name == :lane_switch
|
60
|
-
Actions.get_all_official_actions.include?name
|
60
|
+
Actions.get_all_official_actions.include? name
|
61
61
|
end
|
62
62
|
|
63
63
|
def did_show_message?
|
64
64
|
path = File.join(File.expand_path('~'), '.did_show_opt_info')
|
65
65
|
|
66
|
-
did_show = File.
|
66
|
+
did_show = File.exist? path
|
67
67
|
File.write(path, '1')
|
68
68
|
did_show
|
69
69
|
end
|
70
70
|
end
|
71
|
-
end
|
71
|
+
end
|
@@ -8,31 +8,6 @@ module Fastlane
|
|
8
8
|
ENVIRONMENT = :ENVIRONMENT
|
9
9
|
end
|
10
10
|
|
11
|
-
# Helper Methods
|
12
|
-
def self.git_author
|
13
|
-
s = `git log --name-status HEAD^..HEAD`
|
14
|
-
s = s.match(/Author:.*<(.*)>/)[1]
|
15
|
-
return s if s.to_s.length > 0
|
16
|
-
return nil
|
17
|
-
rescue
|
18
|
-
return nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.last_git_commit
|
22
|
-
s = `git log -1 --pretty=%B`.strip
|
23
|
-
return s if s.to_s.length > 0
|
24
|
-
nil
|
25
|
-
end
|
26
|
-
|
27
|
-
# Returns the current git branch - can be replaced using the environment variable `GIT_BRANCH`
|
28
|
-
def self.git_branch
|
29
|
-
return ENV['GIT_BRANCH'] if ENV['GIT_BRANCH'].to_s.length > 0 # set by Jenkins
|
30
|
-
s = `git rev-parse --abbrev-ref HEAD`
|
31
|
-
return s.to_s.strip if s.to_s.length > 0
|
32
|
-
nil
|
33
|
-
end
|
34
|
-
|
35
|
-
|
36
11
|
def self.executed_actions
|
37
12
|
@executed_actions ||= []
|
38
13
|
end
|
@@ -79,60 +54,24 @@ module Fastlane
|
|
79
54
|
raise exc if exc
|
80
55
|
end
|
81
56
|
|
82
|
-
# Execute a shell command
|
83
|
-
# This method will output the string and execute it
|
84
|
-
# Just an alias for sh_no_action
|
85
|
-
# @param log [boolean] should fastlane print out the executed command
|
86
|
-
def self.sh(command, log: true)
|
87
|
-
sh_no_action(command, log: log)
|
88
|
-
end
|
89
|
-
|
90
|
-
def self.sh_no_action(command, log: true)
|
91
|
-
# Set the encoding first, the user might have set it wrong
|
92
|
-
previous_encoding = [Encoding.default_external, Encoding.default_internal]
|
93
|
-
Encoding.default_external = Encoding::UTF_8
|
94
|
-
Encoding.default_internal = Encoding::UTF_8
|
95
|
-
|
96
|
-
command = command.join(' ') if command.is_a?(Array) # since it's an array of one element when running from the Fastfile
|
97
|
-
Helper.log.info ['[SHELL COMMAND]', command.yellow].join(': ') if log
|
98
|
-
|
99
|
-
result = ''
|
100
|
-
unless Helper.test?
|
101
|
-
exit_status = nil
|
102
|
-
status = IO.popen(command, err: [:child, :out]) do |io|
|
103
|
-
io.each do |line|
|
104
|
-
Helper.log.info ['[SHELL]', line.strip].join(': ')
|
105
|
-
result << line
|
106
|
-
end
|
107
|
-
io.close
|
108
|
-
exit_status = $?.exitstatus
|
109
|
-
end
|
110
|
-
|
111
|
-
if exit_status != 0
|
112
|
-
# this will also append the output to the exception
|
113
|
-
raise "Exit status of command '#{command}' was #{exit_status} instead of 0. \n#{result}"
|
114
|
-
end
|
115
|
-
else
|
116
|
-
result << command # only for the tests
|
117
|
-
end
|
118
|
-
|
119
|
-
result
|
120
|
-
rescue => ex
|
121
|
-
raise ex
|
122
|
-
ensure
|
123
|
-
Encoding.default_external = previous_encoding.first
|
124
|
-
Encoding.default_internal = previous_encoding.last
|
125
|
-
end
|
126
|
-
|
127
57
|
# returns a list of official integrations
|
58
|
+
# rubocop:disable Style/AccessorMethodName
|
128
59
|
def self.get_all_official_actions
|
129
|
-
Dir[File.expand_path
|
60
|
+
Dir[File.expand_path('*.rb', File.dirname(__FILE__))].collect do |file|
|
130
61
|
File.basename(file).gsub('.rb', '').to_sym
|
131
62
|
end
|
132
63
|
end
|
64
|
+
# rubocop:enable Style/AccessorMethodName
|
133
65
|
|
134
66
|
def self.load_default_actions
|
135
|
-
Dir[File.expand_path
|
67
|
+
Dir[File.expand_path('*.rb', File.dirname(__FILE__))].each do |file|
|
68
|
+
require file
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# Import all the helpers
|
73
|
+
def self.load_helpers
|
74
|
+
Dir[File.expand_path('../helper/*.rb', File.dirname(__FILE__))].each do |file|
|
136
75
|
require file
|
137
76
|
end
|
138
77
|
end
|
@@ -146,7 +85,6 @@ module Fastlane
|
|
146
85
|
file_name = File.basename(file).gsub('.rb', '')
|
147
86
|
|
148
87
|
class_name = file_name.fastlane_class + 'Action'
|
149
|
-
class_ref = nil
|
150
88
|
begin
|
151
89
|
class_ref = Fastlane::Actions.const_get(class_name)
|
152
90
|
|
@@ -157,7 +95,7 @@ module Fastlane
|
|
157
95
|
Helper.log.error 'For more information, check out the docs: https://github.com/KrauseFx/fastlane'
|
158
96
|
raise "Plugin '#{file_name}' is damaged!"
|
159
97
|
end
|
160
|
-
rescue NameError
|
98
|
+
rescue NameError
|
161
99
|
# Action not found
|
162
100
|
Helper.log.error "Could not find '#{class_name}' class defined.".red
|
163
101
|
Helper.log.error 'For more information, check out the docs: https://github.com/KrauseFx/fastlane'
|
@@ -3,9 +3,9 @@ module Fastlane
|
|
3
3
|
# Adds a git tag to the current commit
|
4
4
|
class AddGitTagAction < Action
|
5
5
|
def self.run(options)
|
6
|
-
lane_name = Actions.lane_context[Actions::SharedValues::LANE_NAME].
|
6
|
+
lane_name = Actions.lane_context[Actions::SharedValues::LANE_NAME].delete(' ') # no spaces allowed
|
7
7
|
|
8
|
-
tag = options[:tag] || "#{options[:grouping]}/#{lane_name}/#{options[:prefix]}#{options[:build_number]
|
8
|
+
tag = options[:tag] || "#{options[:grouping]}/#{lane_name}/#{options[:prefix]}#{options[:build_number]}"
|
9
9
|
|
10
10
|
Helper.log.info "Adding git tag '#{tag}' 🎯."
|
11
11
|
Actions.sh("git tag \"#{tag}\"")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class BackupFileAction < Action
|
4
|
-
def self.run
|
4
|
+
def self.run(params)
|
5
5
|
path = params[:path]
|
6
6
|
FileUtils.cp(path, "#{path}.back", {preserve: true})
|
7
7
|
Helper.log.info "Successfully created a backup 💾"
|
@@ -23,7 +23,7 @@ module Fastlane
|
|
23
23
|
[
|
24
24
|
FastlaneCore::ConfigItem.new(key: :path,
|
25
25
|
description: "Path to the file you want to backup",
|
26
|
-
optional: false)
|
26
|
+
optional: false)
|
27
27
|
]
|
28
28
|
end
|
29
29
|
end
|
@@ -13,7 +13,7 @@ module Fastlane
|
|
13
13
|
base_destination = params[:destination]
|
14
14
|
zipped = params[:zip]
|
15
15
|
versioned = params[:versioned]
|
16
|
-
|
16
|
+
|
17
17
|
# Prepare destionation folder
|
18
18
|
full_destination = base_destination
|
19
19
|
|
@@ -24,10 +24,10 @@ module Fastlane
|
|
24
24
|
full_destination = File.expand_path(subfolder, base_destination)
|
25
25
|
end
|
26
26
|
|
27
|
-
FileUtils.mkdir(full_destination) unless File.
|
27
|
+
FileUtils.mkdir(full_destination) unless File.exist?(full_destination)
|
28
28
|
|
29
29
|
# Save archive to destination
|
30
|
-
if zipped
|
30
|
+
if zipped
|
31
31
|
Helper.log.info "Compressing #{xcarchive}"
|
32
32
|
|
33
33
|
xcarchive_folder = File.expand_path(File.dirname(xcarchive))
|
@@ -35,7 +35,7 @@ module Fastlane
|
|
35
35
|
zip_file = File.expand_path(File.join("#{xcarchive_file}.zip"))
|
36
36
|
|
37
37
|
# Create zip
|
38
|
-
Actions.sh(%
|
38
|
+
Actions.sh(%(cd "#{xcarchive_folder}" && zip -r -X "#{zip_file}" "#{xcarchive_file}" > /dev/null))
|
39
39
|
|
40
40
|
# Moved to its final destination
|
41
41
|
FileUtils.mv(zip_file, full_destination)
|
@@ -47,7 +47,6 @@ module Fastlane
|
|
47
47
|
|
48
48
|
Actions.lane_context[SharedValues::BACKUP_XCARCHIVE_FILE] = "#{full_destination}/#{File.basename(xcarchive)}"
|
49
49
|
end
|
50
|
-
|
51
50
|
end
|
52
51
|
|
53
52
|
#####################################################
|
@@ -65,15 +64,15 @@ module Fastlane
|
|
65
64
|
default_value: Actions.lane_context[SharedValues::XCODEBUILD_ARCHIVE],
|
66
65
|
optional: false,
|
67
66
|
env_name: 'BACKUP_XCARCHIVE_ARCHIVE',
|
68
|
-
verify_block:
|
69
|
-
|
67
|
+
verify_block: proc do |value|
|
68
|
+
raise "Couldn't find xcarchive file at path '#{value}'".red if !Helper.test? && !File.exist?(value)
|
70
69
|
end),
|
71
70
|
FastlaneCore::ConfigItem.new(key: :destination,
|
72
71
|
description: 'Where your archive will be placed',
|
73
72
|
optional: false,
|
74
73
|
env_name: 'BACKUP_XCARCHIVE_DESTINATION',
|
75
|
-
verify_block:
|
76
|
-
|
74
|
+
verify_block: proc do |value|
|
75
|
+
raise "Couldn't find the destination folder at '#{value}'".red if !Helper.test? && !File.directory?(value) && !File.exist?(value)
|
77
76
|
end),
|
78
77
|
FastlaneCore::ConfigItem.new(key: :zip,
|
79
78
|
description: 'Enable compression of the archive. Default value `true`',
|
@@ -101,9 +100,9 @@ module Fastlane
|
|
101
100
|
end
|
102
101
|
|
103
102
|
def self.is_supported?(platform)
|
104
|
-
[:ios, :mac].include?platform
|
103
|
+
[:ios, :mac].include? platform
|
105
104
|
end
|
106
|
-
|
105
|
+
|
107
106
|
end
|
108
107
|
end
|
109
|
-
end
|
108
|
+
end
|
@@ -1,8 +1,10 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class BundleInstallAction < Action
|
4
|
+
# rubocop:disable Metrics/CyclomaticComplexity
|
5
|
+
# rubocop:disable Metrics/PerceivedComplexity
|
4
6
|
def self.run(params)
|
5
|
-
if File.
|
7
|
+
if File.exist?('Gemfile')
|
6
8
|
cmd = ['bundle install']
|
7
9
|
|
8
10
|
cmd << "--binstubs #{params[:binstubs]}" if params[:binstubs]
|
@@ -29,6 +31,8 @@ module Fastlane
|
|
29
31
|
Helper.log.info "No Gemfile found"
|
30
32
|
end
|
31
33
|
end
|
34
|
+
# rubocop:enable Metrics/CyclomaticComplexity
|
35
|
+
# rubocop:enable Metrics/PerceivedComplexity
|
32
36
|
|
33
37
|
def self.description
|
34
38
|
'This action runs `bundle install` if it founds the Gemfile'
|