fastlane 1.0.2 → 1.1.0
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 +4 -4
- data/README.md +7 -1
- data/bin/fastlane +2 -2
- data/lib/assets/custom_action_template.rb +29 -8
- data/lib/fastlane/action.rb +1 -1
- data/lib/fastlane/actions/actions_helper.rb +17 -1
- data/lib/fastlane/actions/clean_build_artifacts.rb +22 -3
- data/lib/fastlane/actions/commit_version_bump.rb +8 -3
- data/lib/fastlane/actions/deliver.rb +7 -0
- data/lib/fastlane/actions/frameit.rb +33 -8
- data/lib/fastlane/actions/hockey.rb +1 -0
- data/lib/fastlane/actions/mailgun.rb +108 -0
- data/lib/fastlane/actions/oclint.rb +117 -0
- data/lib/fastlane/actions/s3.rb +15 -0
- data/lib/fastlane/actions/set_build_number_repository.rb +84 -0
- data/lib/fastlane/actions/slack.rb +5 -19
- data/lib/fastlane/actions/snapshot.rb +2 -0
- data/lib/fastlane/setup.rb +9 -1
- data/lib/fastlane/version.rb +1 -1
- metadata +13 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cebfea716260d2cb57c35933a33328e4e84108b7
|
4
|
+
data.tar.gz: 63f7321329f5a086a730e92025badcf405e50530
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c25ba42dc222a5e47646f0b5c764b5d4fa8664a7d0e1d69c015c6b2b35061d279f87bafd7e6181307eb195ddb8c003509787e07a259065b441dbc75a029f630
|
7
|
+
data.tar.gz: 5ca184b2aa8a5edcd0a59766562531af2e31c6fb593c5a555074209dbf31141eeb859a150842758a82b42110a4d21fdd3615047b03f71dd169fe00964675abf8
|
data/README.md
CHANGED
@@ -101,7 +101,7 @@ Make sure, you have the latest version of the Xcode command line tools installed
|
|
101
101
|
|
102
102
|
xcode-select --install
|
103
103
|
|
104
|
-
If you want to take a look at a project, already using `fastlane`, check out the [fastlane-
|
104
|
+
If you want to take a look at a project, already using `fastlane`, check out the [fastlane-examples](https://github.com/fastlane/examples) with `fastlane` setups by Wikipedia, Product Hunt, MindNode and more.
|
105
105
|
|
106
106
|
## Quick Start
|
107
107
|
|
@@ -141,6 +141,12 @@ Usually you'll use fastlane by triggering individual lanes:
|
|
141
141
|
- [`cert`](https://github.com/KrauseFx/cert): Automatically create and maintain iOS code signing certificates
|
142
142
|
- [`codes`](https://github.com/KrauseFx/codes): Create promo codes for iOS Apps using the command line
|
143
143
|
|
144
|
+
## Statistics
|
145
|
+
|
146
|
+
`fastlane` tracks the number of errors for each action to detect integration issues. The data will be sent to [fastlane-enhancer](https://github.com/fastlane/enhancer) and is available publicly.
|
147
|
+
|
148
|
+
You can easily opt-out by adding `opt_out_usage` to your `Fastfile` or by setting the environment variable `FASTLANE_OPT_OUT_USAGE`.
|
149
|
+
|
144
150
|
## Credentials
|
145
151
|
A detailed description about how ```fastlane``` stores your credentials is available on a [separate repo](https://github.com/KrauseFx/CredentialsManager).
|
146
152
|
|
data/bin/fastlane
CHANGED
@@ -82,12 +82,12 @@ class FastlaneApplication
|
|
82
82
|
c.option '-f', '--force', 'Overwrite the existing README.md in the ./fastlane folder'
|
83
83
|
|
84
84
|
c.action do |_args, _options|
|
85
|
-
path = File.join(Fastlane::FastlaneFolder.path, 'README.md')
|
85
|
+
path = File.join(Fastlane::FastlaneFolder.path || '.', 'README.md')
|
86
86
|
if File.exists?path and not _options.force
|
87
87
|
return unless agree('Found existing ./fastlane/README.md. Do you want to overwrite it? (y/n)', true)
|
88
88
|
end
|
89
89
|
|
90
|
-
ff = Fastlane::FastFile.new(File.join(Fastlane::FastlaneFolder.path, 'Fastfile'))
|
90
|
+
ff = Fastlane::FastFile.new(File.join(Fastlane::FastlaneFolder.path || '.', 'Fastfile'))
|
91
91
|
|
92
92
|
require 'fastlane/docs_generator'
|
93
93
|
Fastlane::DocsGenerator.run(path, ff)
|
@@ -6,10 +6,9 @@ module Fastlane
|
|
6
6
|
|
7
7
|
class [[NAME_CLASS]] < Action
|
8
8
|
def self.run(params)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
# Helper.log.info "Parameter Path: #{params[:first]}"
|
9
|
+
# fastlane will take care of reading in the parameter and fetching the environment variable:
|
10
|
+
Helper.log.info "Parameter API Token: #{params[:api_token]}"
|
11
|
+
|
13
12
|
# sh "shellcommand ./path"
|
14
13
|
|
15
14
|
# Actions.lane_context[SharedValues::[[NAME_UP]]_CUSTOM_VALUE] = "my_val"
|
@@ -27,11 +26,20 @@ module Fastlane
|
|
27
26
|
|
28
27
|
def self.available_options
|
29
28
|
# Define all options your action supports.
|
30
|
-
|
31
|
-
#
|
29
|
+
|
30
|
+
# Below a few examples
|
32
31
|
[
|
33
|
-
|
34
|
-
|
32
|
+
FastlaneCore::ConfigItem.new(key: :api_token,
|
33
|
+
env_name: "FL_[[NAME_UP]]_API_TOKEN", # The name of the environment variable
|
34
|
+
description: "API Token for [[NAME_CLASS]]", # a short description of this parameter
|
35
|
+
verify_block: Proc.new do |value|
|
36
|
+
raise "No API token for [[NAME_CLASS]] given, pass using `api_token: 'token'`".red unless (value and not value.empty?)
|
37
|
+
end),
|
38
|
+
FastlaneCore::ConfigItem.new(key: :development,
|
39
|
+
env_name: "FL_[[NAME_UP]]_DEVELOPMENT",
|
40
|
+
description: "Create a development certificate instead of a distribution one",
|
41
|
+
is_string: false, # true: verifies the input is a string, false: every kind of value
|
42
|
+
default_value: false) # the default value if the user didn't provide one
|
35
43
|
]
|
36
44
|
end
|
37
45
|
|
@@ -47,6 +55,19 @@ module Fastlane
|
|
47
55
|
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
|
48
56
|
'[Your GitHub Name]'
|
49
57
|
end
|
58
|
+
|
59
|
+
def self.is_supported?(platform)
|
60
|
+
# you can do things like
|
61
|
+
#
|
62
|
+
# true
|
63
|
+
#
|
64
|
+
# platform == :ios
|
65
|
+
#
|
66
|
+
# [:ios, :mac].include?platform
|
67
|
+
#
|
68
|
+
|
69
|
+
platform == :ios
|
70
|
+
end
|
50
71
|
end
|
51
72
|
end
|
52
73
|
end
|
data/lib/fastlane/action.rb
CHANGED
@@ -12,6 +12,22 @@ module Fastlane
|
|
12
12
|
@executed_actions ||= []
|
13
13
|
end
|
14
14
|
|
15
|
+
def self.git_author
|
16
|
+
s = `git log --name-status HEAD^..HEAD`
|
17
|
+
s = s.match(/Author:.*<(.*)>/)[1]
|
18
|
+
return s if s.to_s.length > 0
|
19
|
+
return nil
|
20
|
+
rescue
|
21
|
+
return nil
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.last_git_commit
|
25
|
+
s = `git log -1 --pretty=%B`.strip
|
26
|
+
return s if s.to_s.length > 0
|
27
|
+
nil
|
28
|
+
end
|
29
|
+
|
30
|
+
|
15
31
|
# The shared hash can be accessed by any action and contains information like the screenshots path or beta URL
|
16
32
|
def self.lane_context
|
17
33
|
@lane_context ||= {}
|
@@ -65,7 +81,7 @@ module Fastlane
|
|
65
81
|
exit_status = nil
|
66
82
|
status = IO.popen(command, err: [:child, :out]) do |io|
|
67
83
|
io.each do |line|
|
68
|
-
Helper.log.info ['[SHELL
|
84
|
+
Helper.log.info ['[SHELL]', line.strip].join(': ')
|
69
85
|
result << line
|
70
86
|
end
|
71
87
|
io.close
|
@@ -1,16 +1,35 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class CleanBuildArtifactsAction < Action
|
4
|
-
def self.run(
|
4
|
+
def self.run(options)
|
5
5
|
[
|
6
6
|
Actions.lane_context[Actions::SharedValues::IPA_OUTPUT_PATH],
|
7
7
|
Actions.lane_context[Actions::SharedValues::SIGH_PROFILE_PATH],
|
8
8
|
Actions.lane_context[Actions::SharedValues::DSYM_OUTPUT_PATH],
|
9
|
-
].reject { |file| file.nil? || !File.exist?(file) }.each
|
9
|
+
].reject { |file| file.nil? || !File.exist?(file) }.each do |file|
|
10
|
+
|
11
|
+
if options[:exclude_pattern]
|
12
|
+
next if file.match(options[:exclude_pattern])
|
13
|
+
end
|
14
|
+
|
15
|
+
Helper.log.debug "Cleaning up '#{file}'".yellow
|
16
|
+
File.delete(file)
|
17
|
+
|
18
|
+
end
|
10
19
|
|
11
20
|
Helper.log.info 'Cleaned up build artifacts 🐙'.green
|
12
21
|
end
|
13
22
|
|
23
|
+
def self.available_options
|
24
|
+
[
|
25
|
+
FastlaneCore::ConfigItem.new(key: :exclude_pattern,
|
26
|
+
env_name: "FL_CLEAN_BUILD_ARTIFACTS_EXCLUDE_PATTERN",
|
27
|
+
description: "Exclude all files from clearing that match the given pattern: e.g. '.*\.mobileprovision'",
|
28
|
+
default_value: nil,
|
29
|
+
optional: true)
|
30
|
+
]
|
31
|
+
end
|
32
|
+
|
14
33
|
def self.description
|
15
34
|
"Deletes files created as result of running ipa or sigh"
|
16
35
|
end
|
@@ -20,7 +39,7 @@ module Fastlane
|
|
20
39
|
end
|
21
40
|
|
22
41
|
def self.is_supported?(platform)
|
23
|
-
|
42
|
+
[:ios, :mac].include?platform
|
24
43
|
end
|
25
44
|
end
|
26
45
|
end
|
@@ -63,13 +63,18 @@ module Fastlane
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# get the absolute paths to the files
|
66
|
-
git_add_paths =
|
66
|
+
git_add_paths = expected_changed_files.map { |path| File.expand_path(File.join(repo_pathname, path)) }
|
67
67
|
|
68
68
|
# then create a commit with a message
|
69
69
|
Actions.sh("git add #{git_add_paths.map(&:shellescape).join(' ')}")
|
70
|
-
Actions.sh("git commit -m '#{params[:message]}'")
|
71
70
|
|
72
|
-
|
71
|
+
begin
|
72
|
+
Actions.sh("git commit -m '#{params[:message]}'")
|
73
|
+
|
74
|
+
Helper.log.info "Committed \"#{params[:message]}\" 💾.".green
|
75
|
+
rescue => ex
|
76
|
+
Helper.log.info "Didn't commit any changes.".yellow
|
77
|
+
end
|
73
78
|
end
|
74
79
|
|
75
80
|
def self.description
|
@@ -11,6 +11,7 @@ module Fastlane
|
|
11
11
|
|
12
12
|
begin
|
13
13
|
ENV['DELIVER_SCREENSHOTS_PATH'] = Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] # use snapshot's screenshots if there
|
14
|
+
ENV['DELIVER_SKIP_BINARY'] = "1" if config[:metadata_only]
|
14
15
|
|
15
16
|
Dir.chdir(config[:deliver_file_path] || FastlaneFolder.path || Dir.pwd) do
|
16
17
|
# This should be executed in the fastlane folder
|
@@ -56,6 +57,12 @@ module Fastlane
|
|
56
57
|
optional: true,
|
57
58
|
default_value: false,
|
58
59
|
is_string: false),
|
60
|
+
FastlaneCore::ConfigItem.new(key: :metadata_only,
|
61
|
+
env_name: "DELIVER_SKIP_BINARY",
|
62
|
+
description: "Skip the binary upload and upload app metadata only",
|
63
|
+
optional: true,
|
64
|
+
default_value: false,
|
65
|
+
is_string: false),
|
59
66
|
FastlaneCore::ConfigItem.new(key: :deliver_file_path,
|
60
67
|
env_name: "FL_DELIVER_CONFIG_PATH",
|
61
68
|
description: "Specify a path to the directory containing the Deliverfile",
|
@@ -1,21 +1,22 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class FrameitAction < Action
|
4
|
-
def self.run(
|
4
|
+
def self.run(config)
|
5
5
|
return if Helper.test?
|
6
6
|
|
7
7
|
require 'frameit'
|
8
8
|
|
9
9
|
begin
|
10
10
|
FastlaneCore::UpdateChecker.start_looking_for_update('frameit') unless Helper.is_test?
|
11
|
-
color = Frameit::
|
12
|
-
color = Frameit::
|
11
|
+
color = Frameit::Color::BLACK
|
12
|
+
color = Frameit::Color::SILVER if (config[:white] or config[:silver])
|
13
13
|
|
14
|
-
|
15
|
-
screenshots_folder ||= FastlaneFolder.path
|
14
|
+
Helper.log.info "Framing screenshots at path #{config[:path]}"
|
16
15
|
|
17
|
-
Dir.chdir(
|
18
|
-
|
16
|
+
Dir.chdir(config[:path]) do
|
17
|
+
ENV["FRAMEIT_FORCE_DEVICE_TYPE"] = config[:force_device_type] if config[:force_device_type]
|
18
|
+
Frameit::Runner.new.run('.', color)
|
19
|
+
ENV.delete("FRAMEIT_FORCE_DEVICE_TYPE") if config[:force_device_type]
|
19
20
|
end
|
20
21
|
ensure
|
21
22
|
FastlaneCore::UpdateChecker.show_update_status('frameit', Frameit::VERSION)
|
@@ -26,12 +27,36 @@ module Fastlane
|
|
26
27
|
"Adds device frames around the screenshots using frameit"
|
27
28
|
end
|
28
29
|
|
30
|
+
def self.available_options
|
31
|
+
[
|
32
|
+
FastlaneCore::ConfigItem.new(key: :white,
|
33
|
+
env_name: "FRAMEIT_WHITE_FRAME",
|
34
|
+
description: "Use white device frames",
|
35
|
+
optional: true,
|
36
|
+
is_string: false),
|
37
|
+
FastlaneCore::ConfigItem.new(key: :silver,
|
38
|
+
env_name: "",
|
39
|
+
description: "Use white device frames. Alias for :white",
|
40
|
+
optional: true,
|
41
|
+
is_string: false),
|
42
|
+
FastlaneCore::ConfigItem.new(key: :path,
|
43
|
+
env_name: "FRAMEIT_SCREENSHOTS_PATH",
|
44
|
+
description: "The path to the directory containing the screenshots",
|
45
|
+
default_value: Actions.lane_context[SharedValues::SNAPSHOT_SCREENSHOTS_PATH] || FastlaneFolder.path),
|
46
|
+
FastlaneCore::ConfigItem.new(key: :force_device_type,
|
47
|
+
env_name: "FRAMEIT_FORCE_DEVICE_TYPE",
|
48
|
+
description: "Forces a given device type, useful for Mac screenshots, as their sizes vary",
|
49
|
+
default_value: '',
|
50
|
+
optional: true)
|
51
|
+
]
|
52
|
+
end
|
53
|
+
|
29
54
|
def self.author
|
30
55
|
"KrauseFx"
|
31
56
|
end
|
32
57
|
|
33
58
|
def self.is_supported?(platform)
|
34
|
-
|
59
|
+
[:ios, :mac].include?platform
|
35
60
|
end
|
36
61
|
end
|
37
62
|
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
class MailgunAction < Action
|
4
|
+
|
5
|
+
def self.is_supported?(platform)
|
6
|
+
true
|
7
|
+
end
|
8
|
+
|
9
|
+
def self.run(options)
|
10
|
+
require 'rest_client'
|
11
|
+
|
12
|
+
handle_exceptions(options)
|
13
|
+
|
14
|
+
mailgunit(options[:mailgun_apikey],
|
15
|
+
options[:mailgun_sandbox_domain],
|
16
|
+
options[:mailgun_sandbox_postmaster],
|
17
|
+
options[:to],
|
18
|
+
options[:subject],
|
19
|
+
compose_mail(options[:message],options[:success]))
|
20
|
+
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.description
|
24
|
+
"Send a success/error message to an email group"
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.available_options
|
28
|
+
[
|
29
|
+
FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_domain,
|
30
|
+
env_name: "MAILGUN_SANDBOX_DOMAIN",
|
31
|
+
description: "Mailgun sandbox domain for your mail"),
|
32
|
+
FastlaneCore::ConfigItem.new(key: :mailgun_sandbox_postmaster,
|
33
|
+
env_name: "MAILGUN_SANDBOX_POSTMASTER",
|
34
|
+
description: "Mailgun sandbox domain postmaster for your mail"),
|
35
|
+
FastlaneCore::ConfigItem.new(key: :mailgun_apikey,
|
36
|
+
env_name: "MAILGUN_APIKEY",
|
37
|
+
description: "Mailgun apikey for your mail"),
|
38
|
+
FastlaneCore::ConfigItem.new(key: :to,
|
39
|
+
env_name: "MAILGUN_TO",
|
40
|
+
description: "Destination of your mail"),
|
41
|
+
FastlaneCore::ConfigItem.new(key: :message,
|
42
|
+
env_name: "MAILGUN_MESSAGE",
|
43
|
+
description: "Message of your mail"),
|
44
|
+
FastlaneCore::ConfigItem.new(key: :subject,
|
45
|
+
env_name: "MAILGUN_SUBJECT",
|
46
|
+
description: "Subject of your mail",
|
47
|
+
optional: true,
|
48
|
+
is_string: true,
|
49
|
+
default_value: "fastlane build"),
|
50
|
+
FastlaneCore::ConfigItem.new(key: :success,
|
51
|
+
env_name: "MAILGUN_SUCCESS",
|
52
|
+
description: "Was this build successful? (true/false)",
|
53
|
+
optional: true,
|
54
|
+
default_value: true,
|
55
|
+
is_string: false)
|
56
|
+
|
57
|
+
]
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.author
|
61
|
+
"thiagolioy"
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
def self.compose_mail(text,success)
|
66
|
+
text << "\n Git Author: #{Actions.git_author}"
|
67
|
+
text << "\n Last Commit: #{Actions.last_git_commit}"
|
68
|
+
text << "\n Success: #{success}"
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.handle_exceptions(options)
|
72
|
+
unless (options[:mailgun_apikey] rescue nil)
|
73
|
+
Helper.log.fatal "Please add 'ENV[\"MAILGUN_APIKEY\"] = \"a_valid_mailgun_apikey\"' to your Fastfile's `before_all` section.".red
|
74
|
+
raise 'No MAILGUN_APIKEY given.'.red
|
75
|
+
end
|
76
|
+
|
77
|
+
unless (options[:mailgun_sandbox_domain] rescue nil)
|
78
|
+
Helper.log.fatal "Please add 'ENV[\"MAILGUN_SANDBOX_DOMAIN\"] = \"a_valid_mailgun_sandbox_domain\"' to your Fastfile's `before_all` section.".red
|
79
|
+
raise 'No MAILGUN_SANDBOX_DOMAIN given.'.red
|
80
|
+
end
|
81
|
+
|
82
|
+
unless (options[:mailgun_sandbox_postmaster] rescue nil)
|
83
|
+
Helper.log.fatal "Please add 'ENV[\"MAILGUN_SANDBOX_POSTMASTER\"] = \"a_valid_mailgun_sandbox_postmaster\"' to your Fastfile's `before_all` section.".red
|
84
|
+
raise 'No MAILGUN_SANDBOX_POSTMASTER given.'.red
|
85
|
+
end
|
86
|
+
|
87
|
+
unless (options[:to] rescue nil)
|
88
|
+
Helper.log.fatal "Please provide a valid :to = \"a_valid_mailgun_to\"".red
|
89
|
+
raise 'No MAILGUN_TO given.'.red
|
90
|
+
end
|
91
|
+
|
92
|
+
unless (options[:message] rescue nil)
|
93
|
+
Helper.log.fatal "Please provide a valid :message = \"a_valid_mailgun_text\"".red
|
94
|
+
raise 'No MAILGUN_MESSAGE given.'.red
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.mailgunit(api_key,sandbox_domain,sandbox_postmaster,to,subject,text)
|
99
|
+
RestClient.post "https://api:#{api_key}@api.mailgun.net/v3/#{sandbox_domain}/messages",
|
100
|
+
:from => "Mailgun Sandbox<#{sandbox_postmaster}>",
|
101
|
+
:to => "#{to}",
|
102
|
+
:subject => subject,
|
103
|
+
:text => text
|
104
|
+
end
|
105
|
+
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
FL_OCLINT_REPORT_PATH = :FL_OCLINT_REPORT_PATH
|
5
|
+
end
|
6
|
+
|
7
|
+
class OclintAction < Action
|
8
|
+
def self.run(params)
|
9
|
+
|
10
|
+
select_reqex = params[:select_reqex]
|
11
|
+
|
12
|
+
compile_commands = params[:compile_commands]
|
13
|
+
raise "Could not find json compilation database at path '#{compile_commands}'".red unless File.exists?(compile_commands)
|
14
|
+
|
15
|
+
files = JSON.parse(File.read(compile_commands)).map { |compile_command| compile_command['file'] }
|
16
|
+
files.uniq!
|
17
|
+
files.select! do |file|
|
18
|
+
file_ruby = file.gsub('\ ', ' ')
|
19
|
+
File.exists?(file_ruby) and (!select_reqex or file_ruby =~ select_reqex)
|
20
|
+
end
|
21
|
+
|
22
|
+
command_prefix = [
|
23
|
+
'cd',
|
24
|
+
File.expand_path('.').shellescape,
|
25
|
+
'&&'
|
26
|
+
].join(' ')
|
27
|
+
|
28
|
+
report_type = params[:report_type]
|
29
|
+
report_path = params[:report_path] ? params[:report_path] : 'oclint_report.' + report_type
|
30
|
+
|
31
|
+
oclint_args = ["-report-type=#{report_type}", "-o=#{report_path}"]
|
32
|
+
oclint_args << "-rc=#{params[:rc]}" if params[:rc]
|
33
|
+
oclint_args << "-max-priority-1=#{params[:max_priority_1]}" if params[:max_priority_1]
|
34
|
+
oclint_args << "-max-priority-2=#{params[:max_priority_2]}" if params[:max_priority_2]
|
35
|
+
oclint_args << "-max-priority-3=#{params[:max_priority_3]}" if params[:max_priority_3]
|
36
|
+
|
37
|
+
command = [
|
38
|
+
command_prefix,
|
39
|
+
'oclint',
|
40
|
+
oclint_args,
|
41
|
+
'"' + files.join('" "') + '"'
|
42
|
+
].join(' ')
|
43
|
+
|
44
|
+
Action.sh command
|
45
|
+
|
46
|
+
Actions.lane_context[SharedValues::FL_OCLINT_REPORT_PATH] = File.expand_path(report_path)
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
#####################################################
|
52
|
+
# @!group Documentation
|
53
|
+
#####################################################
|
54
|
+
|
55
|
+
def self.description
|
56
|
+
"Lints implementation files with OCLint"
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.available_options
|
60
|
+
[
|
61
|
+
FastlaneCore::ConfigItem.new(key: :compile_commands,
|
62
|
+
env_name: 'FL_OCLINT_COMPILE_COMMANDS',
|
63
|
+
description: 'The json compilation database, use xctool reporter \'json-compilation-database\'',
|
64
|
+
default_value: 'compile_commands.json',
|
65
|
+
optional: true),
|
66
|
+
FastlaneCore::ConfigItem.new(key: :select_reqex,
|
67
|
+
env_name: 'FL_OCLINT_SELECT_REQEX',
|
68
|
+
description: 'Select all files matching this reqex',
|
69
|
+
is_string: false,
|
70
|
+
optional: true),
|
71
|
+
FastlaneCore::ConfigItem.new(key: :report_type,
|
72
|
+
env_name: 'FL_OCLINT_REPORT_TYPE',
|
73
|
+
description: 'The type of the report (default: html)',
|
74
|
+
default_value: 'html',
|
75
|
+
optional: true),
|
76
|
+
FastlaneCore::ConfigItem.new(key: :report_path,
|
77
|
+
env_name: 'FL_OCLINT_REPORT_PATH',
|
78
|
+
description: 'The reports file path',
|
79
|
+
optional: true),
|
80
|
+
FastlaneCore::ConfigItem.new(key: :rc,
|
81
|
+
env_name: 'FL_OCLINT_RC',
|
82
|
+
description: 'Override the default behavior of rules',
|
83
|
+
optional: true),
|
84
|
+
FastlaneCore::ConfigItem.new(key: :max_priority_1,
|
85
|
+
env_name: 'FL_OCLINT_MAX_PRIOTITY_1',
|
86
|
+
description: 'The max allowed number of priority 1 violations',
|
87
|
+
is_string: false,
|
88
|
+
optional: true),
|
89
|
+
FastlaneCore::ConfigItem.new(key: :max_priority_2,
|
90
|
+
env_name: 'FL_OCLINT_MAX_PRIOTITY_2',
|
91
|
+
description: 'The max allowed number of priority 2 violations',
|
92
|
+
is_string: false,
|
93
|
+
optional: true),
|
94
|
+
FastlaneCore::ConfigItem.new(key: :max_priority_3,
|
95
|
+
env_name: 'FL_OCLINT_MAX_PRIOTITY_3',
|
96
|
+
description: 'The max allowed number of priority 3 violations',
|
97
|
+
is_string: false,
|
98
|
+
optional: true)
|
99
|
+
]
|
100
|
+
end
|
101
|
+
|
102
|
+
def self.output
|
103
|
+
[
|
104
|
+
['FL_OCLINT_REPORT_PATH', 'The reports file path']
|
105
|
+
]
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.author
|
109
|
+
'HeEAaD'
|
110
|
+
end
|
111
|
+
|
112
|
+
def self.is_supported?(platform)
|
113
|
+
true
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
data/lib/fastlane/actions/s3.rb
CHANGED
@@ -38,6 +38,9 @@ module Fastlane
|
|
38
38
|
params[:acl] = config[:acl]
|
39
39
|
params[:source] = config[:source]
|
40
40
|
params[:path] = config[:path]
|
41
|
+
params[:plist_template_path] = config[:plist_template_path]
|
42
|
+
params[:html_template_path] = config[:html_template_path]
|
43
|
+
params[:html_file_name] = config[:html_file_name]
|
41
44
|
|
42
45
|
# Maps nice developer build parameters to Shenzhen args
|
43
46
|
build_args = params_to_build_args(params)
|
@@ -241,6 +244,18 @@ module Fastlane
|
|
241
244
|
description: "zipped .dsym package for the build ",
|
242
245
|
optional: true,
|
243
246
|
default_value: Actions.lane_context[SharedValues::DSYM_OUTPUT_PATH]),
|
247
|
+
FastlaneCore::ConfigItem.new(key: :plist_template_path,
|
248
|
+
env_name: "",
|
249
|
+
description: "plist template path",
|
250
|
+
optional: true),
|
251
|
+
FastlaneCore::ConfigItem.new(key: :html_template_path,
|
252
|
+
env_name: "",
|
253
|
+
description: "html erb template path",
|
254
|
+
optional: true),
|
255
|
+
FastlaneCore::ConfigItem.new(key: :html_file_name,
|
256
|
+
env_name: "",
|
257
|
+
description: "uploaded html filename",
|
258
|
+
optional: true),
|
244
259
|
FastlaneCore::ConfigItem.new(key: :access_key,
|
245
260
|
env_name: "S3_ACCESS_KEY",
|
246
261
|
description: "AWS Access Key ID ",
|
@@ -0,0 +1,84 @@
|
|
1
|
+
module Fastlane
|
2
|
+
module Actions
|
3
|
+
module SharedValues
|
4
|
+
end
|
5
|
+
|
6
|
+
class SetBuildNumberRepositoryAction < Action
|
7
|
+
def self.is_supported?(platform)
|
8
|
+
platform == :ios
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.is_svn?
|
12
|
+
begin
|
13
|
+
Actions.sh 'svn info'
|
14
|
+
return true
|
15
|
+
rescue
|
16
|
+
return false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.is_git?
|
21
|
+
begin
|
22
|
+
Actions.sh 'git rev-parse HEAD'
|
23
|
+
return true
|
24
|
+
rescue
|
25
|
+
return false
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.is_git_svn?
|
30
|
+
begin
|
31
|
+
Actions.sh 'git svn info'
|
32
|
+
return true
|
33
|
+
rescue
|
34
|
+
return false
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.run(params)
|
39
|
+
begin
|
40
|
+
|
41
|
+
if is_svn?
|
42
|
+
Helper.log.info "Detected repo: svn"
|
43
|
+
command = 'svn info | grep Revision | egrep -o "[0-9]+"'
|
44
|
+
elsif is_git_svn?
|
45
|
+
Helper.log.info "Detected repo: git-svn"
|
46
|
+
command = 'git svn info | grep Revision | egrep -o "[0-9]+"'
|
47
|
+
elsif is_git?
|
48
|
+
Helper.log.info "Detected repo: git"
|
49
|
+
command = 'git rev-parse --short HEAD'
|
50
|
+
else
|
51
|
+
raise "No repository detected"
|
52
|
+
end
|
53
|
+
|
54
|
+
build_number = Actions.sh command
|
55
|
+
|
56
|
+
Fastlane::Actions::IncrementBuildNumberAction.run(build_number:build_number)
|
57
|
+
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
#####################################################
|
62
|
+
# @!group Documentation
|
63
|
+
#####################################################
|
64
|
+
|
65
|
+
def self.description
|
66
|
+
"Set the build number from the current repository"
|
67
|
+
end
|
68
|
+
|
69
|
+
def self.available_options
|
70
|
+
[
|
71
|
+
]
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.output
|
75
|
+
[
|
76
|
+
]
|
77
|
+
end
|
78
|
+
|
79
|
+
def self.author
|
80
|
+
'pbrooks'
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
@@ -1,26 +1,12 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
3
|
class SlackAction < Action
|
4
|
-
def self.git_author
|
5
|
-
s = `git log --name-status HEAD^..HEAD`
|
6
|
-
s = s.match(/Author:.*<(.*)>/)[1]
|
7
|
-
return s if s.to_s.length > 0
|
8
|
-
return nil
|
9
|
-
rescue
|
10
|
-
return nil
|
11
|
-
end
|
12
|
-
|
13
|
-
def self.last_git_commit
|
14
|
-
s = `git log -1 --pretty=%B`.strip
|
15
|
-
return s if s.to_s.length > 0
|
16
|
-
nil
|
17
|
-
end
|
18
4
|
|
19
5
|
def self.is_supported?(platform)
|
20
6
|
true
|
21
7
|
end
|
22
8
|
|
23
|
-
# As there is a text limit in the notifications, we are
|
9
|
+
# As there is a text limit in the notifications, we are
|
24
10
|
# usually interested in the last part of the message
|
25
11
|
# e.g. for tests
|
26
12
|
def self.trim_message(message)
|
@@ -158,23 +144,23 @@ module Fastlane
|
|
158
144
|
end
|
159
145
|
|
160
146
|
# git_author
|
161
|
-
if git_author && should_add_payload[:git_author]
|
147
|
+
if Actions.git_author && should_add_payload[:git_author]
|
162
148
|
if ENV['FASTLANE_SLACK_HIDE_AUTHOR_ON_SUCCESS'] && options[:success]
|
163
149
|
# We only show the git author if the build failed
|
164
150
|
else
|
165
151
|
slack_attachment[:fields] << {
|
166
152
|
title: 'Git Author',
|
167
|
-
value: git_author,
|
153
|
+
value: Actions.git_author,
|
168
154
|
short: true
|
169
155
|
}
|
170
156
|
end
|
171
157
|
end
|
172
158
|
|
173
159
|
# last_git_commit
|
174
|
-
if last_git_commit && should_add_payload[:last_git_commit]
|
160
|
+
if Actions.last_git_commit && should_add_payload[:last_git_commit]
|
175
161
|
slack_attachment[:fields] << {
|
176
162
|
title: 'Git Commit',
|
177
|
-
value: last_git_commit,
|
163
|
+
value: Actions.last_git_commit,
|
178
164
|
short: false
|
179
165
|
}
|
180
166
|
end
|
@@ -18,6 +18,8 @@ module Fastlane
|
|
18
18
|
|
19
19
|
FastlaneCore::UpdateChecker.start_looking_for_update('snapshot') unless Helper.is_test?
|
20
20
|
|
21
|
+
ENV['SNAPSHOT_SKIP_OPEN_SUMMARY'] = "1" # it doesn't make sense to show the HTML page here
|
22
|
+
|
21
23
|
begin
|
22
24
|
Dir.chdir(FastlaneFolder.path) do
|
23
25
|
Snapshot::SnapshotConfig.shared_instance
|
data/lib/fastlane/setup.rb
CHANGED
@@ -19,6 +19,7 @@ module Fastlane
|
|
19
19
|
ask_to_enable_other_tools
|
20
20
|
FileUtils.mkdir(File.join(folder, 'actions'))
|
21
21
|
generate_fastfile
|
22
|
+
show_analytics
|
22
23
|
Helper.log.info 'Successfully finished setting up fastlane'.green
|
23
24
|
rescue Exception => ex # this will also be caused by Ctrl + C
|
24
25
|
# Something went wrong with the setup, clear the folder again
|
@@ -33,10 +34,17 @@ module Fastlane
|
|
33
34
|
Helper.log.info 'This setup will help you get up and running in no time.'.green
|
34
35
|
Helper.log.info 'First, it will move the config files from `deliver` and `snapshot`'.green
|
35
36
|
Helper.log.info "into the subfolder `fastlane`.\n".green
|
36
|
-
Helper.log.info "
|
37
|
+
Helper.log.info "fastlane will check what tools you're already using and set up".green
|
37
38
|
Helper.log.info 'the tool automatically for you. Have fun! '.green
|
38
39
|
end
|
39
40
|
|
41
|
+
def show_analytics
|
42
|
+
Helper.log.info "fastlane will send the number of errors for each action to"
|
43
|
+
Helper.log.info "https://github.com/fastlane/enhancer to detect integration issues"
|
44
|
+
Helper.log.info "No sensitive/private information will be uploaded"
|
45
|
+
Helper.log.info("You can disable this by adding `opt_out_usage` to your Fastfile")
|
46
|
+
end
|
47
|
+
|
40
48
|
def files_to_copy
|
41
49
|
['Deliverfile', 'Snapfile', 'deliver', 'snapshot.js', 'snapshot-iPad.js', 'SnapshotHelper.js', 'screenshots']
|
42
50
|
end
|
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.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Krause
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -142,56 +142,56 @@ dependencies:
|
|
142
142
|
requirements:
|
143
143
|
- - '>='
|
144
144
|
- !ruby/object:Gem::Version
|
145
|
-
version: 0.7.
|
145
|
+
version: 0.7.3
|
146
146
|
type: :runtime
|
147
147
|
prerelease: false
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
149
149
|
requirements:
|
150
150
|
- - '>='
|
151
151
|
- !ruby/object:Gem::Version
|
152
|
-
version: 0.7.
|
152
|
+
version: 0.7.3
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
154
|
name: deliver
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
157
|
- - '>='
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
159
|
+
version: 0.11.0
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
164
|
- - '>='
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
166
|
+
version: 0.11.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: snapshot
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
171
|
- - '>='
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version: 0.
|
173
|
+
version: 0.9.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
178
|
- - '>='
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version: 0.
|
180
|
+
version: 0.9.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
182
|
name: frameit
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - '>='
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 2.0.0
|
188
188
|
type: :runtime
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - '>='
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 2.0.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: pem
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -402,7 +402,9 @@ files:
|
|
402
402
|
- lib/fastlane/actions/install_carthage.rb
|
403
403
|
- lib/fastlane/actions/install_cocapods.rb
|
404
404
|
- lib/fastlane/actions/ipa.rb
|
405
|
+
- lib/fastlane/actions/mailgun.rb
|
405
406
|
- lib/fastlane/actions/notify.rb
|
407
|
+
- lib/fastlane/actions/oclint.rb
|
406
408
|
- lib/fastlane/actions/opt_out_usage.rb
|
407
409
|
- lib/fastlane/actions/pem.rb
|
408
410
|
- lib/fastlane/actions/produce.rb
|
@@ -412,6 +414,7 @@ files:
|
|
412
414
|
- lib/fastlane/actions/resign.rb
|
413
415
|
- lib/fastlane/actions/s3.rb
|
414
416
|
- lib/fastlane/actions/say.rb
|
417
|
+
- lib/fastlane/actions/set_build_number_repository.rb
|
415
418
|
- lib/fastlane/actions/sigh.rb
|
416
419
|
- lib/fastlane/actions/slack.rb
|
417
420
|
- lib/fastlane/actions/snapshot.rb
|