fastlane 1.53.0 → 1.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/lib/fastlane/actions/appaloosa.rb +1 -7
- data/lib/fastlane/actions/deliver.rb +2 -2
- data/lib/fastlane/actions/ensure_xcode_version.rb +66 -0
- data/lib/fastlane/actions/erb.rb +63 -0
- data/lib/fastlane/actions/oclint.rb +4 -0
- data/lib/fastlane/actions/rsync.rb +65 -0
- data/lib/fastlane/actions/scp.rb +95 -0
- data/lib/fastlane/actions/slather.rb +12 -7
- data/lib/fastlane/actions/ssh.rb +143 -0
- data/lib/fastlane/actions/swiftlint.rb +29 -3
- data/lib/fastlane/setup/setup_ios.rb +60 -20
- data/lib/fastlane/version.rb +1 -1
- metadata +28 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e399f18fe597e4af18b30146d6a08861b66a516f
|
4
|
+
data.tar.gz: 65b6efcc8adb04b6581c7f6132bfe038759e65f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5d83d2dff319a35675a34b716c148ba6282d92cfafd6a3557d800072a173106c52c9ad30ed94069fba1e8b9b311d3e8e9e5384d79fd282306a6aef1c4e853af
|
7
|
+
data.tar.gz: 4beedd951ea16130220fb40437db2661d5aa05641dacee5ed16e8e8947a7bd7a13498a9793be62c79388c67d687f843e94b53e89bf70482faa9d3426c3f2ee9a
|
data/README.md
CHANGED
@@ -89,7 +89,7 @@ fastlane appstore
|
|
89
89
|
:mountain_cableway: | Implement a fully working Continuous Delivery process
|
90
90
|
:ghost: | [Jenkins Integration](https://github.com/fastlane/fastlane/blob/master/docs/Jenkins.md): Show the output directly in the Jenkins test results
|
91
91
|
:book: | Automatically generate a markdown documentation of your lane config
|
92
|
-
:hatching_chick: | Over
|
92
|
+
:hatching_chick: | Over 140 built-in integrations available
|
93
93
|
:computer: | Support for both iOS and Mac OS apps
|
94
94
|
:octocat: | Full git and mercurial support
|
95
95
|
|
@@ -187,8 +187,7 @@ Please submit an issue on GitHub and provide information about your setup
|
|
187
187
|
Thanks to all [contributors](https://github.com/fastlane/fastlane/graphs/contributors) for extending and improving `fastlane`. Check out the project pages of the other tools for more sponsors and contributors.
|
188
188
|
|
189
189
|
## Code of Conduct
|
190
|
-
Help us keep fastlane open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
|
191
|
-
|
190
|
+
Help us keep `fastlane` open and inclusive. Please read and follow our [Code of Conduct](https://github.com/fastlane/code-of-conduct).
|
192
191
|
|
193
192
|
## License
|
194
193
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
@@ -241,13 +241,7 @@ module Fastlane
|
|
241
241
|
env_name: 'FL_APPALOOSA_DEVICE',
|
242
242
|
description: 'Select the device format for yours screenshots',
|
243
243
|
optional: true
|
244
|
-
)
|
245
|
-
FastlaneCore::ConfigItem.new(key: :development,
|
246
|
-
env_name: 'FL_APPALOOSA_DEVELOPMENT',
|
247
|
-
description: 'Create a development certificate instead of a distribution one',
|
248
|
-
is_string: false,
|
249
|
-
default_value: false,
|
250
|
-
optional: true)
|
244
|
+
)
|
251
245
|
]
|
252
246
|
end
|
253
247
|
|
@@ -11,8 +11,8 @@ module Fastlane
|
|
11
11
|
FastlaneCore::UpdateChecker.start_looking_for_update('deliver') unless Helper.is_test?
|
12
12
|
|
13
13
|
config.load_configuration_file("Deliverfile")
|
14
|
-
config[:screenshots_path]
|
15
|
-
config[:ipa]
|
14
|
+
config[:screenshots_path] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] if Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH]
|
15
|
+
config[:ipa] = Actions.lane_context[SharedValues::IPA_OUTPUT_PATH] if Actions.lane_context[SharedValues::IPA_OUTPUT_PATH]
|
16
16
|
|
17
17
|
return config if Helper.test?
|
18
18
|
Deliver::Runner.new(config).run
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
ENSURE_XCODE_VERSION_CUSTOM_VALUE = :ENSURE_XCODE_VERSION_CUSTOM_VALUE
|
5
|
+
end
|
6
|
+
|
7
|
+
class EnsureXcodeVersionAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
required_version = params[:version]
|
10
|
+
|
11
|
+
selected_version = sh "xcversion selected | head -1 | xargs echo -n"
|
12
|
+
|
13
|
+
versions_match = selected_version == "Xcode #{required_version}"
|
14
|
+
|
15
|
+
if versions_match
|
16
|
+
Helper.log.info("Selected Xcode version is correct: #{selected_version}".green)
|
17
|
+
else
|
18
|
+
Helper.log.info("Selected Xcode version is not correct: #{selected_version}. You expected #{required_version}.")
|
19
|
+
Helper.log.info("To correct this, use: `xcode_select(version: #{required_version})`.")
|
20
|
+
|
21
|
+
raise "Selected Xcode version doesn't match your requirement.\nExpected: Xcode #{required_version}\nActual: #{selected_version}\n"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
#####################################################
|
26
|
+
# @!group Documentation
|
27
|
+
#####################################################
|
28
|
+
|
29
|
+
def self.description
|
30
|
+
"Ensure the selected Xcode version with xcode-select matches a value"
|
31
|
+
end
|
32
|
+
|
33
|
+
def self.details
|
34
|
+
"If building your app requires a specific version of Xcode, you can invoke this command before using gym.\n
|
35
|
+
For example, to ensure that a beta version is not accidentally selected to build, which would make uploading to TestFlight fail."
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.available_options
|
39
|
+
[
|
40
|
+
FastlaneCore::ConfigItem.new(key: :version,
|
41
|
+
env_name: "FL_ENSURE_XCODE_VERSION",
|
42
|
+
description: "Xcode version to verify that is selected",
|
43
|
+
is_string: true,
|
44
|
+
default_value: false)
|
45
|
+
]
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.output
|
49
|
+
[
|
50
|
+
['FL_ENSURE_XCODE_VERSION', 'Xcode version to verify that is selected']
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.return_value
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.authors
|
58
|
+
["JaviSoto"]
|
59
|
+
end
|
60
|
+
|
61
|
+
def self.is_supported?(platform)
|
62
|
+
[:ios, :mac].include?(platform)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class ErbAction < Action
|
4
|
+
def self.run(params)
|
5
|
+
template = File.read(params[:template])
|
6
|
+
result = ERB.new(template).result(OpenStruct.new(params[:placeholders]).instance_eval { binding })
|
7
|
+
File.open(params[:destination], 'w') { |file| file.write(result) } if params[:destination]
|
8
|
+
Helper.log.info "Successfully parsed template: '#{params[:template]}' and rendered output to: #{params[:destination]}" if params[:destination]
|
9
|
+
result
|
10
|
+
end
|
11
|
+
|
12
|
+
#####################################################
|
13
|
+
# @!group Documentation
|
14
|
+
#####################################################
|
15
|
+
|
16
|
+
def self.description
|
17
|
+
"Allows to Generate output files based on ERB templates"
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.details
|
21
|
+
"Renders an ERB template with `placeholders` given as a hash via parameter, if no :destination is set, returns rendered template as string"
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.available_options
|
25
|
+
[
|
26
|
+
|
27
|
+
FastlaneCore::ConfigItem.new(key: :template,
|
28
|
+
short_option: "-T",
|
29
|
+
env_name: "FL_ERB_SRC",
|
30
|
+
description: "ERB Template File",
|
31
|
+
optional: false,
|
32
|
+
is_string: true
|
33
|
+
),
|
34
|
+
FastlaneCore::ConfigItem.new(key: :destination,
|
35
|
+
short_option: "-D",
|
36
|
+
env_name: "FL_ERB_DST",
|
37
|
+
description: "destination file",
|
38
|
+
optional: true,
|
39
|
+
is_string: true
|
40
|
+
),
|
41
|
+
FastlaneCore::ConfigItem.new(key: :placeholders,
|
42
|
+
short_option: "-p",
|
43
|
+
env_name: "FL_ERB_LOG",
|
44
|
+
description: "Log Commands",
|
45
|
+
optional: true,
|
46
|
+
default_value: true,
|
47
|
+
is_string: false,
|
48
|
+
type: Hash
|
49
|
+
)
|
50
|
+
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.authors
|
55
|
+
["hjanuschka"]
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.is_supported?(platform)
|
59
|
+
true
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -7,6 +7,10 @@ module Fastlane
|
|
7
7
|
|
8
8
|
class OclintAction < Action
|
9
9
|
def self.run(params)
|
10
|
+
if `which oclint`.to_s.length == 0 and !Helper.test?
|
11
|
+
raise "You have to install oclint. Fore more details: ".red + "http://docs.oclint.org/en/stable/intro/installation.html".yellow
|
12
|
+
end
|
13
|
+
|
10
14
|
compile_commands = params[:compile_commands]
|
11
15
|
raise "Could not find json compilation database at path '#{compile_commands}'".red unless File.exist?(compile_commands)
|
12
16
|
|
@@ -0,0 +1,65 @@
|
|
1
|
+
|
2
|
+
module Fastlane
|
3
|
+
module Actions
|
4
|
+
module SharedValues
|
5
|
+
end
|
6
|
+
|
7
|
+
class RsyncAction < Action
|
8
|
+
|
9
|
+
def self.run(params)
|
10
|
+
rsync_cmd = ["rsync"]
|
11
|
+
rsync_cmd << params[:extra]
|
12
|
+
rsync_cmd << params[:source]
|
13
|
+
rsync_cmd << params[:destination]
|
14
|
+
Actions.sh(rsync_cmd.join(" "))
|
15
|
+
end
|
16
|
+
|
17
|
+
#####################################################
|
18
|
+
# @!group Documentation
|
19
|
+
#####################################################
|
20
|
+
|
21
|
+
def self.description
|
22
|
+
"Rsync files from :source to :destination"
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.details
|
26
|
+
"A wrapper around rsync, rsync is a tool that lets you synchronize files, including permissions and so on for a more detailed information about rsync please see rsync(1) manpage."
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.available_options
|
30
|
+
[
|
31
|
+
FastlaneCore::ConfigItem.new(key: :extra,
|
32
|
+
short_option: "-X",
|
33
|
+
env_name: "FL_RSYNC_EXTRA", # The name of the environment variable
|
34
|
+
description: "Port", # a short description of this parameter
|
35
|
+
optional: true,
|
36
|
+
default_value: "-av",
|
37
|
+
is_string: true
|
38
|
+
),
|
39
|
+
FastlaneCore::ConfigItem.new(key: :source,
|
40
|
+
short_option: "-S",
|
41
|
+
env_name: "FL_RSYNC_SRC", # The name of the environment variable
|
42
|
+
description: "source file/folder", # a short description of this parameter
|
43
|
+
optional: false,
|
44
|
+
is_string: true
|
45
|
+
),
|
46
|
+
FastlaneCore::ConfigItem.new(key: :destination,
|
47
|
+
short_option: "-D",
|
48
|
+
env_name: "FL_RSYNC_DST", # The name of the environment variable
|
49
|
+
description: "destination file/folder", # a short description of this parameter
|
50
|
+
optional: false,
|
51
|
+
is_string: true
|
52
|
+
)
|
53
|
+
]
|
54
|
+
end
|
55
|
+
|
56
|
+
def self.authors
|
57
|
+
["hjanuschka"]
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.is_supported?(platform)
|
61
|
+
true
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
end
|
5
|
+
|
6
|
+
class ScpAction < Action
|
7
|
+
|
8
|
+
def self.run(params)
|
9
|
+
Actions.verify_gem!('net-scp')
|
10
|
+
require "net/scp"
|
11
|
+
ret = nil
|
12
|
+
Net::SCP.start(params[:host], params[:username], {port: params[:port].to_i, password: params[:password]}) do |scp|
|
13
|
+
if params[:upload]
|
14
|
+
scp.upload! params[:upload][:src], params[:upload][:dst], recursive: true
|
15
|
+
Helper.log.info ['[SCP COMMAND]', "Successfully Uploaded", params[:upload][:src], params[:upload][:dst]].join(': ')
|
16
|
+
end
|
17
|
+
if params[:download]
|
18
|
+
|
19
|
+
t_ret = scp.download! params[:download][:src], params[:download][:dst], recursive: true
|
20
|
+
Helper.log.info ['[SCP COMMAND]', "Successfully Downloaded", params[:upload][:src], params[:upload][:dst]].join(': ')
|
21
|
+
unless params[:download][:dst]
|
22
|
+
ret = t_ret
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
ret
|
27
|
+
end
|
28
|
+
|
29
|
+
#####################################################
|
30
|
+
# @!group Documentation
|
31
|
+
#####################################################
|
32
|
+
|
33
|
+
def self.description
|
34
|
+
"Transfer files via SCP"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.available_options
|
38
|
+
[
|
39
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
40
|
+
short_option: "-u",
|
41
|
+
env_name: "FL_SSH_USERNAME",
|
42
|
+
description: "Username",
|
43
|
+
is_string: true
|
44
|
+
),
|
45
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
46
|
+
short_option: "-p",
|
47
|
+
env_name: "FL_SSH_PASSWORD",
|
48
|
+
description: "Password",
|
49
|
+
optional: true,
|
50
|
+
is_string: true
|
51
|
+
),
|
52
|
+
FastlaneCore::ConfigItem.new(key: :host,
|
53
|
+
short_option: "-H",
|
54
|
+
env_name: "FL_SSH_HOST",
|
55
|
+
description: "Hostname",
|
56
|
+
is_string: true
|
57
|
+
),
|
58
|
+
FastlaneCore::ConfigItem.new(key: :port,
|
59
|
+
short_option: "-P",
|
60
|
+
env_name: "FL_SSH_PORT",
|
61
|
+
description: "Port",
|
62
|
+
optional: true,
|
63
|
+
default_value: "22",
|
64
|
+
is_string: true
|
65
|
+
),
|
66
|
+
FastlaneCore::ConfigItem.new(key: :upload,
|
67
|
+
short_option: "-U",
|
68
|
+
env_name: "FL_SCP_UPLOAD",
|
69
|
+
description: "Upload",
|
70
|
+
optional: true,
|
71
|
+
is_string: false,
|
72
|
+
type: Hash
|
73
|
+
),
|
74
|
+
FastlaneCore::ConfigItem.new(key: :download,
|
75
|
+
short_option: "-D",
|
76
|
+
env_name: "FL_SCP_DOWNLOAD",
|
77
|
+
description: "Download",
|
78
|
+
optional: true,
|
79
|
+
is_string: false,
|
80
|
+
type: Hash
|
81
|
+
)
|
82
|
+
|
83
|
+
]
|
84
|
+
end
|
85
|
+
|
86
|
+
def self.authors
|
87
|
+
["hjanuschka"]
|
88
|
+
end
|
89
|
+
|
90
|
+
def self.is_supported?(platform)
|
91
|
+
true
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -17,9 +17,9 @@ module Fastlane
|
|
17
17
|
command = ""
|
18
18
|
command += "bundle exec " if params[:use_bundle_exec]
|
19
19
|
command += "slather coverage "
|
20
|
-
command += " --build-directory #{params[:build_directory]}" if params[:build_directory]
|
20
|
+
command += " --build-directory #{params[:build_directory].shellescape}" if params[:build_directory]
|
21
21
|
command += " --input-format #{params[:input_format]}" if params[:input_format]
|
22
|
-
command += " --scheme #{params[:scheme]}" if params[:scheme]
|
22
|
+
command += " --scheme #{params[:scheme].shellescape}" if params[:scheme]
|
23
23
|
command += " --buildkite" if params[:buildkite]
|
24
24
|
command += " --jenkins" if params[:jenkins]
|
25
25
|
command += " --travis" if params[:travis]
|
@@ -30,10 +30,14 @@ module Fastlane
|
|
30
30
|
command += " --cobertura-xml" if params[:cobertura_xml]
|
31
31
|
command += " --html" if params[:html]
|
32
32
|
command += " --show" if params[:show]
|
33
|
-
command += " --source-directory #{params[:source_directory]}" if params[:source_directory]
|
34
|
-
command += " --output-directory #{params[:output_directory]}" if params[:output_directory]
|
35
|
-
|
36
|
-
|
33
|
+
command += " --source-directory #{params[:source_directory].shellescape}" if params[:source_directory]
|
34
|
+
command += " --output-directory #{params[:output_directory].shellescape}" if params[:output_directory]
|
35
|
+
if params[:ignore].kind_of?(String)
|
36
|
+
command += " --ignore #{params[:ignore].shellescape}"
|
37
|
+
elsif params[:ignore].kind_of?(Array)
|
38
|
+
command += " #{params[:ignore].map { |path| "--ignore #{path.shellescape}" }.join(' ')}"
|
39
|
+
end
|
40
|
+
command += " #{params[:proj].shellescape}"
|
37
41
|
sh command
|
38
42
|
end
|
39
43
|
|
@@ -135,7 +139,8 @@ Slather is available at https://github.com/venmo/slather
|
|
135
139
|
optional: true),
|
136
140
|
FastlaneCore::ConfigItem.new(key: :ignore,
|
137
141
|
env_name: "FL_SLATHER_IGNORE",
|
138
|
-
description: "Tell slather to ignore files matching a path",
|
142
|
+
description: "Tell slather to ignore files matching a path or any path from an array of paths",
|
143
|
+
is_string: false,
|
139
144
|
optional: true),
|
140
145
|
FastlaneCore::ConfigItem.new(key: :use_bundle_exec,
|
141
146
|
env_name: "FL_SLATHER_USE_BUNDLE_EXEC",
|
@@ -0,0 +1,143 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
SSH_STDOUT_VALUE = :SSH_STDOUT_VALUE
|
5
|
+
SSH_STDERR_VALUE = :SSH_STDERR_VALUE
|
6
|
+
end
|
7
|
+
|
8
|
+
class SshAction < Action
|
9
|
+
def self.ssh_exec!(ssh, command)
|
10
|
+
stdout_data = ""
|
11
|
+
stderr_data = ""
|
12
|
+
exit_code = nil
|
13
|
+
exit_signal = nil
|
14
|
+
ssh.open_channel do |channel|
|
15
|
+
channel.exec(command) do |ch, success|
|
16
|
+
unless success
|
17
|
+
abort "FAILED: couldn't execute command (ssh.channel.exec)"
|
18
|
+
end
|
19
|
+
channel.on_data do |ch1, data|
|
20
|
+
stdout_data += data
|
21
|
+
end
|
22
|
+
|
23
|
+
channel.on_extended_data do |ch2, type, data|
|
24
|
+
stderr_data += data
|
25
|
+
end
|
26
|
+
|
27
|
+
channel.on_request("exit-status") do |ch3, data|
|
28
|
+
exit_code = data.read_long
|
29
|
+
end
|
30
|
+
|
31
|
+
channel.on_request("exit-signal") do |ch4, data|
|
32
|
+
exit_signal = data.read_long
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
ssh.loop
|
37
|
+
{stdout: stdout_data, stderr: stderr_data, exit_code: exit_code, exit_signal: exit_signal}
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.run(params)
|
41
|
+
Actions.verify_gem!('net-ssh')
|
42
|
+
require "net/ssh"
|
43
|
+
|
44
|
+
Actions.lane_context[SharedValues::SSH_STDOUT_VALUE] = ""
|
45
|
+
Actions.lane_context[SharedValues::SSH_STDERR_VALUE] = ""
|
46
|
+
stdout = ""
|
47
|
+
stderr = ""
|
48
|
+
|
49
|
+
Net::SSH.start(params[:host], params[:username], {port: params[:port].to_i, password: params[:password]}) do |ssh|
|
50
|
+
params[:commands].each do |cmd|
|
51
|
+
Helper.log.info ['[SSH COMMAND]', cmd.yellow].join(': ') if params[:log]
|
52
|
+
return_value = ssh_exec!(ssh, cmd)
|
53
|
+
Helper.log.error "SSH Command failed '#{cmd}' Exit-Code: #{return_value[:exit_code]}" if return_value[:exit_code] > 0
|
54
|
+
raise "SSH Command failed" if return_value[:exit_code] > 0
|
55
|
+
|
56
|
+
stderr << return_value[:stderr]
|
57
|
+
stdout << return_value[:stdout]
|
58
|
+
end
|
59
|
+
end
|
60
|
+
Helper.log.info "Succesfully executed #{params[:commands].count} commands on host: #{params[:host]}"
|
61
|
+
Helper.log.info "\n########### \n #{stdout} \n###############".magenta if params[:log]
|
62
|
+
Actions.lane_context[SharedValues::SSH_STDOUT_VALUE] = stdout
|
63
|
+
Actions.lane_context[SharedValues::SSH_STDERR_VALUE] = stderr
|
64
|
+
return {stdout: Actions.lane_context[SharedValues::SSH_STDOUT_VALUE], stderr: Actions.lane_context[SharedValues::SSH_STDERR_VALUE]}
|
65
|
+
end
|
66
|
+
|
67
|
+
#####################################################
|
68
|
+
# @!group Documentation
|
69
|
+
#####################################################
|
70
|
+
|
71
|
+
def self.description
|
72
|
+
"Allows remote command execution using ssh"
|
73
|
+
end
|
74
|
+
|
75
|
+
def self.details
|
76
|
+
"Lets you execute remote commands via ssh using username/password or ssh-agent"
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.available_options
|
80
|
+
[
|
81
|
+
FastlaneCore::ConfigItem.new(key: :username,
|
82
|
+
short_option: "-u",
|
83
|
+
env_name: "FL_SSH_USERNAME",
|
84
|
+
description: "Username",
|
85
|
+
is_string: true
|
86
|
+
),
|
87
|
+
FastlaneCore::ConfigItem.new(key: :password,
|
88
|
+
short_option: "-p",
|
89
|
+
env_name: "FL_SSH_PASSWORD",
|
90
|
+
description: "Password",
|
91
|
+
optional: true,
|
92
|
+
is_string: true
|
93
|
+
),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :host,
|
95
|
+
short_option: "-H",
|
96
|
+
env_name: "FL_SSH_HOST",
|
97
|
+
description: "Hostname",
|
98
|
+
is_string: true
|
99
|
+
),
|
100
|
+
FastlaneCore::ConfigItem.new(key: :port,
|
101
|
+
short_option: "-P",
|
102
|
+
env_name: "FL_SSH_PORT",
|
103
|
+
description: "Port",
|
104
|
+
optional: true,
|
105
|
+
default_value: "22",
|
106
|
+
is_string: true
|
107
|
+
),
|
108
|
+
FastlaneCore::ConfigItem.new(key: :commands,
|
109
|
+
short_option: "-C",
|
110
|
+
env_name: "FL_SSH_COMMANDS",
|
111
|
+
description: "Commands",
|
112
|
+
optional: true,
|
113
|
+
is_string: false,
|
114
|
+
type: Array
|
115
|
+
),
|
116
|
+
FastlaneCore::ConfigItem.new(key: :log,
|
117
|
+
short_option: "-l",
|
118
|
+
env_name: "FL_SSH_LOG",
|
119
|
+
description: "Log Commands",
|
120
|
+
optional: true,
|
121
|
+
default_value: true,
|
122
|
+
is_string: false
|
123
|
+
)
|
124
|
+
]
|
125
|
+
end
|
126
|
+
|
127
|
+
def self.output
|
128
|
+
[
|
129
|
+
['SSH_STDOUT_VALUE', 'Holds the standard-output of all commands'],
|
130
|
+
['SSH_STDERR_VALUE', 'Holds the standard-error of all commands']
|
131
|
+
]
|
132
|
+
end
|
133
|
+
|
134
|
+
def self.authors
|
135
|
+
["hjanuschka"]
|
136
|
+
end
|
137
|
+
|
138
|
+
def self.is_supported?(platform)
|
139
|
+
true
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
@@ -6,10 +6,27 @@ module Fastlane
|
|
6
6
|
raise "You have to install swiftlint using `brew install swiftlint`".red
|
7
7
|
end
|
8
8
|
|
9
|
-
|
9
|
+
version = Gem::Version.new(Helper.test? ? '0.0.0' : `swiftlint version`.chomp)
|
10
|
+
if params[:mode] == :autocorrect and version < Gem::Version.new('0.5.0') and !Helper.test?
|
11
|
+
raise "Your version of swiftlint (#{version}) does not support autocorrect mode.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`".red
|
12
|
+
end
|
13
|
+
|
14
|
+
command = "swiftlint #{params[:mode]}"
|
10
15
|
command << " --strict" if params[:strict]
|
11
|
-
command << " --config #{params[:config_file]}" if params[:config_file]
|
12
|
-
|
16
|
+
command << " --config #{params[:config_file].shellescape}" if params[:config_file]
|
17
|
+
|
18
|
+
if params[:files]
|
19
|
+
if version < Gem::Version.new('0.5.1') and !Helper.test?
|
20
|
+
raise "Your version of swiftlint (#{version}) does not support list of files as input.\nUpdate swiftlint using `brew update && brew upgrade swiftlint`".red
|
21
|
+
end
|
22
|
+
|
23
|
+
files = params[:files].map.with_index(0) { |f, i| "SCRIPT_INPUT_FILE_#{i}=#{f.shellescape}" }.join(" ")
|
24
|
+
command = command.prepend("SCRIPT_INPUT_FILE_COUNT=#{params[:files].count} #{files} ")
|
25
|
+
command << " --use-script-input-files"
|
26
|
+
end
|
27
|
+
|
28
|
+
command << " > #{params[:output_file].shellescape}" if params[:output_file]
|
29
|
+
|
13
30
|
Actions.sh(command)
|
14
31
|
end
|
15
32
|
|
@@ -26,6 +43,11 @@ module Fastlane
|
|
26
43
|
|
27
44
|
def self.available_options
|
28
45
|
[
|
46
|
+
FastlaneCore::ConfigItem.new(key: :mode,
|
47
|
+
description: "SwiftLint mode: :lint (default) or :autocorrect; default is :lint",
|
48
|
+
is_string: false,
|
49
|
+
default_value: :lint,
|
50
|
+
optional: true),
|
29
51
|
FastlaneCore::ConfigItem.new(key: :output_file,
|
30
52
|
description: 'Path to output SwiftLint result',
|
31
53
|
optional: true),
|
@@ -36,6 +58,10 @@ module Fastlane
|
|
36
58
|
description: 'Fail on warnings? (true/false)',
|
37
59
|
default_value: false,
|
38
60
|
is_string: false,
|
61
|
+
optional: true),
|
62
|
+
FastlaneCore::ConfigItem.new(key: :files,
|
63
|
+
description: 'List of files to process',
|
64
|
+
is_string: false,
|
39
65
|
optional: true)
|
40
66
|
]
|
41
67
|
end
|
@@ -28,18 +28,11 @@ module Fastlane
|
|
28
28
|
ask_for_apple_id
|
29
29
|
detect_if_app_is_available
|
30
30
|
print_config_table
|
31
|
-
|
31
|
+
fastlane_actions_path = File.join(FastlaneFolder.path, 'actions')
|
32
32
|
if UI.confirm("Please confirm the above values")
|
33
|
-
|
34
|
-
generate_appfile
|
35
|
-
detect_installed_tools # after copying the existing files
|
36
|
-
create_app_if_necessary
|
37
|
-
enable_deliver
|
38
|
-
FileUtils.mkdir(File.join(FastlaneFolder.path, 'actions'))
|
39
|
-
generate_fastfile
|
40
|
-
show_analytics
|
33
|
+
default_setup(path: fastlane_actions_path)
|
41
34
|
else
|
42
|
-
|
35
|
+
manual_setup(path: fastlane_actions_path)
|
43
36
|
end
|
44
37
|
Helper.log.info 'Successfully finished setting up fastlane'.green
|
45
38
|
rescue => ex # this will also be caused by Ctrl + C
|
@@ -52,6 +45,43 @@ module Fastlane
|
|
52
45
|
# rubocop:enable Lint/RescueException
|
53
46
|
end
|
54
47
|
|
48
|
+
def default_setup(path: nil)
|
49
|
+
copy_existing_files
|
50
|
+
generate_appfile(manually: false)
|
51
|
+
detect_installed_tools # after copying the existing files
|
52
|
+
if self.itc_ref.nil? && self.portal_ref.nil?
|
53
|
+
create_app_if_necessary
|
54
|
+
end
|
55
|
+
enable_deliver
|
56
|
+
FileUtils.mkdir(path)
|
57
|
+
generate_fastfile(manually: false)
|
58
|
+
show_analytics
|
59
|
+
end
|
60
|
+
|
61
|
+
def manual_setup(path: nil)
|
62
|
+
copy_existing_files
|
63
|
+
generate_appfile(manually: true)
|
64
|
+
detect_installed_tools # after copying the existing files
|
65
|
+
ask_to_enable_other_tools
|
66
|
+
FileUtils.mkdir(path)
|
67
|
+
generate_fastfile(manually: true)
|
68
|
+
show_analytics
|
69
|
+
end
|
70
|
+
|
71
|
+
def ask_to_enable_other_tools
|
72
|
+
if self.itc_ref.nil? && self.portal_ref.nil?
|
73
|
+
wants_to_create_app = agree('Would you like to create your app on iTunes Connect and the Developer Portal?', true)
|
74
|
+
if wants_to_create_app
|
75
|
+
create_app_if_necessary
|
76
|
+
detect_if_app_is_available # check if the app was, in fact, created.
|
77
|
+
end
|
78
|
+
end
|
79
|
+
if self.itc_ref && self.portal_ref
|
80
|
+
wants_to_setup_deliver = agree("Do you want to setup 'deliver', which is used to upload app screenshots, app metadata and app updates to the App Store? This requires the app to be in the App Store already. (y/n)".yellow, true)
|
81
|
+
enable_deliver if wants_to_setup_deliver
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
55
85
|
def setup_project
|
56
86
|
config = {}
|
57
87
|
FastlaneCore::Project.detect_projects(config)
|
@@ -102,19 +132,28 @@ module Fastlane
|
|
102
132
|
end
|
103
133
|
|
104
134
|
def ask_for_apple_id
|
105
|
-
self.apple_id
|
135
|
+
self.apple_id ||= ask('Your Apple ID (e.g. fastlane@krausefx.com): '.yellow)
|
136
|
+
end
|
137
|
+
|
138
|
+
def ask_for_app_identifier
|
139
|
+
self.app_identifier = ask('App Identifier (com.krausefx.app): '.yellow)
|
106
140
|
end
|
107
141
|
|
108
|
-
def generate_appfile
|
142
|
+
def generate_appfile(manually: false)
|
109
143
|
template = File.read("#{Helper.gem_path('fastlane')}/lib/assets/AppfileTemplate")
|
144
|
+
if manually
|
145
|
+
ask_for_app_identifier
|
146
|
+
ask_for_apple_id
|
147
|
+
end
|
148
|
+
|
149
|
+
template.gsub!('[[DEV_PORTAL_TEAM_ID]]', self.dev_portal_team) if self.dev_portal_team
|
150
|
+
|
151
|
+
itc_team = self.itc_team ? "itc_team_id \"#{self.itc_team}\" # iTunes Connect Team ID\n" : ""
|
152
|
+
template.gsub!('[[ITC_TEAM]]', itc_team)
|
153
|
+
|
110
154
|
template.gsub!('[[APP_IDENTIFIER]]', self.app_identifier)
|
111
155
|
template.gsub!('[[APPLE_ID]]', self.apple_id)
|
112
|
-
|
113
|
-
if self.itc_team
|
114
|
-
template.gsub!('[[ITC_TEAM]]', "itc_team_id \"#{self.itc_team}\" # iTunes Connect Team ID\n")
|
115
|
-
else
|
116
|
-
template.gsub!('[[ITC_TEAM]]', "")
|
117
|
-
end
|
156
|
+
|
118
157
|
path = File.join(folder, 'Appfile')
|
119
158
|
File.write(path, template)
|
120
159
|
Helper.log.info "Created new file '#{path}'. Edit it to manage your preferred app metadata information.".green
|
@@ -175,8 +214,9 @@ module Fastlane
|
|
175
214
|
Deliver::Setup.new.run(options)
|
176
215
|
end
|
177
216
|
|
178
|
-
def generate_fastfile
|
179
|
-
scheme = self.project.schemes.first
|
217
|
+
def generate_fastfile(manually: false)
|
218
|
+
scheme = self.project.schemes.first unless manually
|
219
|
+
|
180
220
|
template = File.read("#{Helper.gem_path('fastlane')}/lib/assets/DefaultFastfileTemplate")
|
181
221
|
|
182
222
|
scheme = ask("Optional: The scheme name of your app (If you don't need one, just hit Enter): ").to_s.strip unless scheme
|
data/lib/fastlane/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.54.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-01-
|
11
|
+
date: 2016-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: krausefx-shenzhen
|
@@ -288,7 +288,7 @@ dependencies:
|
|
288
288
|
requirements:
|
289
289
|
- - ">="
|
290
290
|
- !ruby/object:Gem::Version
|
291
|
-
version: 1.2.
|
291
|
+
version: 1.2.8
|
292
292
|
- - "<"
|
293
293
|
- !ruby/object:Gem::Version
|
294
294
|
version: 2.0.0
|
@@ -298,7 +298,7 @@ dependencies:
|
|
298
298
|
requirements:
|
299
299
|
- - ">="
|
300
300
|
- !ruby/object:Gem::Version
|
301
|
-
version: 1.2.
|
301
|
+
version: 1.2.8
|
302
302
|
- - "<"
|
303
303
|
- !ruby/object:Gem::Version
|
304
304
|
version: 2.0.0
|
@@ -408,7 +408,7 @@ dependencies:
|
|
408
408
|
requirements:
|
409
409
|
- - ">="
|
410
410
|
- !ruby/object:Gem::Version
|
411
|
-
version: 0.4.
|
411
|
+
version: 0.4.2
|
412
412
|
- - "<"
|
413
413
|
- !ruby/object:Gem::Version
|
414
414
|
version: 1.0.0
|
@@ -418,7 +418,7 @@ dependencies:
|
|
418
418
|
requirements:
|
419
419
|
- - ">="
|
420
420
|
- !ruby/object:Gem::Version
|
421
|
-
version: 0.4.
|
421
|
+
version: 0.4.2
|
422
422
|
- - "<"
|
423
423
|
- !ruby/object:Gem::Version
|
424
424
|
version: 1.0.0
|
@@ -428,7 +428,7 @@ dependencies:
|
|
428
428
|
requirements:
|
429
429
|
- - ">="
|
430
430
|
- !ruby/object:Gem::Version
|
431
|
-
version: 0.2.
|
431
|
+
version: 0.2.5
|
432
432
|
- - "<"
|
433
433
|
- !ruby/object:Gem::Version
|
434
434
|
version: 1.0.0
|
@@ -438,7 +438,7 @@ dependencies:
|
|
438
438
|
requirements:
|
439
439
|
- - ">="
|
440
440
|
- !ruby/object:Gem::Version
|
441
|
-
version: 0.2.
|
441
|
+
version: 0.2.5
|
442
442
|
- - "<"
|
443
443
|
- !ruby/object:Gem::Version
|
444
444
|
version: 1.0.0
|
@@ -498,6 +498,20 @@ dependencies:
|
|
498
498
|
- - ">="
|
499
499
|
- !ruby/object:Gem::Version
|
500
500
|
version: '0'
|
501
|
+
- !ruby/object:Gem::Dependency
|
502
|
+
name: pry-byebug
|
503
|
+
requirement: !ruby/object:Gem::Requirement
|
504
|
+
requirements:
|
505
|
+
- - ">="
|
506
|
+
- !ruby/object:Gem::Version
|
507
|
+
version: '0'
|
508
|
+
type: :development
|
509
|
+
prerelease: false
|
510
|
+
version_requirements: !ruby/object:Gem::Requirement
|
511
|
+
requirements:
|
512
|
+
- - ">="
|
513
|
+
- !ruby/object:Gem::Version
|
514
|
+
version: '0'
|
501
515
|
- !ruby/object:Gem::Dependency
|
502
516
|
name: yard
|
503
517
|
requirement: !ruby/object:Gem::Requirement
|
@@ -631,6 +645,8 @@ files:
|
|
631
645
|
- lib/fastlane/actions/ensure_git_branch.rb
|
632
646
|
- lib/fastlane/actions/ensure_git_status_clean.rb
|
633
647
|
- lib/fastlane/actions/ensure_no_debug_code.rb
|
648
|
+
- lib/fastlane/actions/ensure_xcode_version.rb
|
649
|
+
- lib/fastlane/actions/erb.rb
|
634
650
|
- lib/fastlane/actions/fastlane_version.rb
|
635
651
|
- lib/fastlane/actions/frameit.rb
|
636
652
|
- lib/fastlane/actions/gcovr.rb
|
@@ -689,9 +705,11 @@ files:
|
|
689
705
|
- lib/fastlane/actions/reset_git_repo.rb
|
690
706
|
- lib/fastlane/actions/resign.rb
|
691
707
|
- lib/fastlane/actions/restore_file.rb
|
708
|
+
- lib/fastlane/actions/rsync.rb
|
692
709
|
- lib/fastlane/actions/s3.rb
|
693
710
|
- lib/fastlane/actions/say.rb
|
694
711
|
- lib/fastlane/actions/scan.rb
|
712
|
+
- lib/fastlane/actions/scp.rb
|
695
713
|
- lib/fastlane/actions/set_build_number_repository.rb
|
696
714
|
- lib/fastlane/actions/set_changelog.rb
|
697
715
|
- lib/fastlane/actions/set_github_release.rb
|
@@ -703,6 +721,7 @@ files:
|
|
703
721
|
- lib/fastlane/actions/snapshot.rb
|
704
722
|
- lib/fastlane/actions/sonar.rb
|
705
723
|
- lib/fastlane/actions/splunkmint.rb
|
724
|
+
- lib/fastlane/actions/ssh.rb
|
706
725
|
- lib/fastlane/actions/supply.rb
|
707
726
|
- lib/fastlane/actions/swiftlint.rb
|
708
727
|
- lib/fastlane/actions/team_id.rb
|
@@ -779,7 +798,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
779
798
|
version: '0'
|
780
799
|
requirements: []
|
781
800
|
rubyforge_project:
|
782
|
-
rubygems_version: 2.4.
|
801
|
+
rubygems_version: 2.4.5
|
783
802
|
signing_key:
|
784
803
|
specification_version: 4
|
785
804
|
summary: Connect all iOS deployment tools into one streamlined workflow
|