fastlane 2.178.0 → 2.182.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/LICENSE +1 -1
- data/README.md +97 -84
- data/cert/lib/cert/commands_generator.rb +2 -1
- data/cert/lib/cert/options.rb +1 -0
- data/cert/lib/cert/runner.rb +4 -0
- data/deliver/lib/deliver/commands_generator.rb +2 -1
- data/deliver/lib/deliver/download_screenshots.rb +1 -2
- data/deliver/lib/deliver/languages.rb +1 -1
- data/deliver/lib/deliver/options.rb +3 -2
- data/deliver/lib/deliver/runner.rb +4 -0
- data/deliver/lib/deliver/setup.rb +0 -1
- data/deliver/lib/deliver/upload_metadata.rb +2 -1
- data/fastlane/lib/fastlane/actions/actions_helper.rb +2 -2
- data/fastlane/lib/fastlane/actions/app_store_build_number.rb +5 -0
- data/fastlane/lib/fastlane/actions/app_store_connect_api_key.rb +3 -3
- data/fastlane/lib/fastlane/actions/backup_xcarchive.rb +1 -1
- data/fastlane/lib/fastlane/actions/build_app.rb +4 -0
- data/fastlane/lib/fastlane/actions/check_app_store_metadata.rb +4 -0
- data/fastlane/lib/fastlane/actions/clipboard.rb +3 -6
- data/fastlane/lib/fastlane/actions/docs/capture_ios_screenshots.md +1 -1
- data/fastlane/lib/fastlane/actions/docs/frame_screenshots.md +18 -1
- data/fastlane/lib/fastlane/actions/docs/upload_to_play_store.md +2 -1
- data/fastlane/lib/fastlane/actions/ensure_env_vars.rb +2 -6
- data/fastlane/lib/fastlane/actions/get_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/get_version_number.rb +17 -10
- data/fastlane/lib/fastlane/actions/git_branch.rb +4 -10
- data/fastlane/lib/fastlane/actions/git_commit.rb +3 -1
- data/fastlane/lib/fastlane/actions/git_submodule_update.rb +16 -8
- data/fastlane/lib/fastlane/actions/git_tag_exists.rb +4 -0
- data/fastlane/lib/fastlane/actions/import_from_git.rb +5 -5
- data/fastlane/lib/fastlane/actions/install_provisioning_profile.rb +4 -0
- data/fastlane/lib/fastlane/actions/jira.rb +61 -14
- data/fastlane/lib/fastlane/actions/latest_testflight_build_number.rb +1 -0
- data/fastlane/lib/fastlane/actions/match_nuke.rb +59 -0
- data/fastlane/lib/fastlane/actions/notarize.rb +98 -51
- data/fastlane/lib/fastlane/actions/slack.rb +155 -133
- data/fastlane/lib/fastlane/actions/sourcedocs.rb +164 -0
- data/fastlane/lib/fastlane/actions/spaceship_logs.rb +1 -1
- data/fastlane/lib/fastlane/actions/update_project_provisioning.rb +1 -2
- data/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +4 -2
- data/fastlane/lib/fastlane/cli_tools_distributor.rb +1 -1
- data/fastlane/lib/fastlane/commands_generator.rb +2 -1
- data/fastlane/lib/fastlane/fast_file.rb +10 -2
- data/fastlane/lib/fastlane/fastlane_require.rb +7 -1
- data/fastlane/lib/fastlane/helper/git_helper.rb +19 -7
- data/fastlane/lib/fastlane/lane_manager.rb +3 -2
- data/fastlane/lib/fastlane/notification/slack.rb +56 -0
- data/fastlane/lib/fastlane/plugins/plugin_fetcher.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_info.rb +2 -2
- data/fastlane/lib/fastlane/plugins/plugin_info_collector.rb +1 -2
- data/fastlane/lib/fastlane/plugins/plugin_manager.rb +1 -2
- data/fastlane/lib/fastlane/plugins/template/%gem_name%.gemspec.erb +7 -6
- data/fastlane/lib/fastlane/plugins/template/.rubocop.yml +30 -35
- data/fastlane/lib/fastlane/plugins/template/spec/spec_helper.rb.erb +1 -1
- data/fastlane/lib/fastlane/setup/setup.rb +23 -10
- data/fastlane/lib/fastlane/swift_fastlane_function.rb +39 -14
- data/fastlane/lib/fastlane/swift_runner_upgrader.rb +2 -0
- data/fastlane/lib/fastlane/version.rb +2 -2
- data/fastlane/swift/Deliverfile.swift +1 -1
- data/fastlane/swift/DeliverfileProtocol.swift +3 -3
- data/fastlane/swift/Fastlane.swift +6852 -3824
- data/fastlane/swift/FastlaneSwiftRunner/FastlaneSwiftRunner.xcodeproj/project.pbxproj +4 -0
- data/fastlane/swift/Gymfile.swift +1 -1
- data/fastlane/swift/GymfileProtocol.swift +1 -1
- data/fastlane/swift/LaneFileProtocol.swift +9 -3
- data/fastlane/swift/Matchfile.swift +1 -1
- data/fastlane/swift/MatchfileProtocol.swift +1 -1
- data/fastlane/swift/OptionalConfigValue.swift +131 -0
- data/fastlane/swift/Precheckfile.swift +1 -1
- data/fastlane/swift/PrecheckfileProtocol.swift +3 -3
- data/fastlane/swift/RubyCommand.swift +1 -1
- data/fastlane/swift/Scanfile.swift +1 -1
- data/fastlane/swift/ScanfileProtocol.swift +5 -1
- data/fastlane/swift/Screengrabfile.swift +1 -1
- data/fastlane/swift/ScreengrabfileProtocol.swift +1 -1
- data/fastlane/swift/Snapshotfile.swift +1 -1
- data/fastlane/swift/SnapshotfileProtocol.swift +5 -1
- data/fastlane/swift/SocketClient.swift +2 -1
- data/fastlane/swift/SocketResponse.swift +4 -2
- data/fastlane/swift/formatting/Brewfile.lock.json +18 -16
- data/fastlane/swift/upgrade_manifest.json +1 -1
- data/fastlane_core/lib/fastlane_core.rb +22 -21
- data/fastlane_core/lib/fastlane_core/build_watcher.rb +50 -9
- data/fastlane_core/lib/fastlane_core/clipboard.rb +20 -0
- data/fastlane_core/lib/fastlane_core/configuration/configuration.rb +5 -3
- data/fastlane_core/lib/fastlane_core/helper.rb +28 -5
- data/fastlane_core/lib/fastlane_core/languages.rb +2 -2
- data/fastlane_core/lib/fastlane_core/queue_worker.rb +2 -2
- data/fastlane_core/lib/fastlane_core/swag.rb +1 -1
- data/fastlane_core/lib/fastlane_core/ui/help.erb +35 -0
- data/fastlane_core/lib/fastlane_core/ui/help_formatter.rb +16 -0
- data/fastlane_core/lib/fastlane_core/ui/implementations/shell.rb +12 -1
- data/frameit/lib/frameit/commands_generator.rb +2 -1
- data/gym/lib/gym/commands_generator.rb +2 -1
- data/gym/lib/gym/generators/package_command_generator.rb +4 -0
- data/gym/lib/gym/generators/package_command_generator_xcode7.rb +13 -8
- data/gym/lib/gym/runner.rb +15 -4
- data/match/lib/match/change_password.rb +3 -3
- data/match/lib/match/commands_generator.rb +2 -1
- data/match/lib/match/encryption/interface.rb +1 -1
- data/match/lib/match/encryption/openssl.rb +2 -2
- data/match/lib/match/module.rb +1 -0
- data/pem/lib/pem/commands_generator.rb +2 -1
- data/pilot/lib/pilot/commands_generator.rb +2 -1
- data/pilot/lib/pilot/manager.rb +4 -0
- data/pilot/lib/pilot/options.rb +3 -2
- data/pilot/lib/pilot/tester_exporter.rb +0 -1
- data/pilot/lib/pilot/tester_manager.rb +0 -1
- data/precheck/lib/precheck/commands_generator.rb +2 -1
- data/precheck/lib/precheck/options.rb +1 -0
- data/precheck/lib/precheck/runner.rb +4 -0
- data/produce/lib/produce/commands_generator.rb +2 -1
- data/scan/lib/scan/commands_generator.rb +2 -1
- data/scan/lib/scan/options.rb +10 -5
- data/scan/lib/scan/runner.rb +54 -1
- data/scan/lib/scan/test_command_generator.rb +10 -8
- data/screengrab/lib/screengrab/android_environment.rb +6 -4
- data/screengrab/lib/screengrab/commands_generator.rb +2 -1
- data/screengrab/lib/screengrab/runner.rb +1 -1
- data/sigh/lib/sigh/commands_generator.rb +2 -1
- data/sigh/lib/sigh/options.rb +1 -0
- data/sigh/lib/sigh/runner.rb +4 -0
- data/snapshot/lib/assets/SnapfileTemplate +1 -1
- data/snapshot/lib/assets/SnapshotHelper.swift +1 -1
- data/snapshot/lib/snapshot/commands_generator.rb +3 -1
- data/snapshot/lib/snapshot/options.rb +5 -0
- data/snapshot/lib/snapshot/reports_generator.rb +4 -0
- data/snapshot/lib/snapshot/simulator_launchers/launcher_configuration.rb +2 -0
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher.rb +1 -1
- data/snapshot/lib/snapshot/simulator_launchers/simulator_launcher_base.rb +8 -4
- data/spaceship/README.md +2 -12
- data/spaceship/lib/spaceship/base.rb +2 -2
- data/spaceship/lib/spaceship/commands_generator.rb +4 -2
- data/spaceship/lib/spaceship/connect_api/models/app_screenshot.rb +1 -1
- data/spaceship/lib/spaceship/connect_api/models/profile.rb +6 -0
- data/spaceship/lib/spaceship/connect_api/provisioning/provisioning.rb +6 -2
- data/spaceship/lib/spaceship/connect_api/token.rb +7 -1
- data/spaceship/lib/spaceship/spaceauth_runner.rb +19 -9
- data/spaceship/lib/spaceship/tunes/members.rb +1 -1
- data/spaceship/lib/spaceship/ui.rb +2 -2
- data/supply/lib/supply/client.rb +3 -1
- data/supply/lib/supply/commands_generator.rb +2 -1
- data/supply/lib/supply/options.rb +2 -2
- data/supply/lib/supply/uploader.rb +1 -0
- metadata +53 -64
- data/gym/lib/gym/.runner.rb.swp +0 -0
- data/pilot/lib/pilot/tester_util.rb +0 -0
@@ -29,7 +29,7 @@ module Fastlane
|
|
29
29
|
key = {
|
30
30
|
key_id: key_id,
|
31
31
|
issuer_id: issuer_id,
|
32
|
-
key: key_content || File.binread(key_filepath),
|
32
|
+
key: key_content || File.binread(File.expand_path(key_filepath)),
|
33
33
|
is_key_content_base64: is_key_content_base64,
|
34
34
|
duration: duration,
|
35
35
|
in_house: in_house
|
@@ -58,7 +58,7 @@ module Fastlane
|
|
58
58
|
optional: true,
|
59
59
|
conflicting_options: [:key_content],
|
60
60
|
verify_block: proc do |value|
|
61
|
-
UI.user_error!("Couldn't find key p8 file at path '#{value}'") unless File.exist?(value)
|
61
|
+
UI.user_error!("Couldn't find key p8 file at path '#{value}'") unless File.exist?(File.expand_path(value))
|
62
62
|
end),
|
63
63
|
FastlaneCore::ConfigItem.new(key: :key_content,
|
64
64
|
env_name: "APP_STORE_CONNECT_API_KEY_KEY",
|
@@ -99,7 +99,7 @@ module Fastlane
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def self.is_supported?(platform)
|
102
|
-
|
102
|
+
[:ios, :mac, :tvos].include?(platform)
|
103
103
|
end
|
104
104
|
|
105
105
|
def self.details
|
@@ -40,7 +40,7 @@ module Fastlane
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# Create zip
|
43
|
-
Actions.sh(%(cd "#{xcarchive_folder}" && zip -r -X "#{zip_file}" "#{xcarchive_file}" > /dev/null))
|
43
|
+
Actions.sh(%(cd "#{xcarchive_folder}" && zip -r -X -y "#{zip_file}" "#{xcarchive_file}" > /dev/null))
|
44
44
|
|
45
45
|
# Moved to its final destination
|
46
46
|
FileUtils.mv(zip_file, full_destination)
|
@@ -7,10 +7,7 @@ module Fastlane
|
|
7
7
|
truncated_value = value[0..800].gsub(/\s\w+\s*$/, '...')
|
8
8
|
UI.message("Storing '#{truncated_value}' in the clipboard 🎨")
|
9
9
|
|
10
|
-
|
11
|
-
require 'open3'
|
12
|
-
Open3.popen3('pbcopy') { |input, _, _| input << value }
|
13
|
-
end
|
10
|
+
FastlaneCore::Clipboard.copy(content: value)
|
14
11
|
end
|
15
12
|
|
16
13
|
#####################################################
|
@@ -30,11 +27,11 @@ module Fastlane
|
|
30
27
|
end
|
31
28
|
|
32
29
|
def self.authors
|
33
|
-
["KrauseFx", "joshdholtz"]
|
30
|
+
["KrauseFx", "joshdholtz", "rogerluan"]
|
34
31
|
end
|
35
32
|
|
36
33
|
def self.is_supported?(platform)
|
37
|
-
|
34
|
+
FastlaneCore::Clipboard.is_supported?
|
38
35
|
end
|
39
36
|
|
40
37
|
def self.example_code
|
@@ -332,7 +332,7 @@ To get more information about language and locale codes please read [Internation
|
|
332
332
|
|
333
333
|
## Use a clean status bar
|
334
334
|
|
335
|
-
You can set `override_status_bar` to `true` to set the status bar to Tuesday January 9th at 9:41AM with full battery and reception.
|
335
|
+
You can set `override_status_bar` to `true` to set the status bar to Tuesday January 9th at 9:41AM with full battery and reception. If you need more granular customization, to set a Carrier name for example, also set `override_status_bar_arguments` to the specific arguments to be passed to the `xcrun simctl status_bar override` command. Run `xcrun simctl status_bar --help` to see the options available.
|
336
336
|
|
337
337
|
## Editing the `Snapfile`
|
338
338
|
|
@@ -332,7 +332,24 @@ Use [_deliver_](https://docs.fastlane.tools/actions/deliver/) to upload iOS scre
|
|
332
332
|
|
333
333
|
## Use a clean status bar
|
334
334
|
|
335
|
-
You can set `override_status_bar` to `true` in snapshot to set the status bar to Tuesday January 9th at 9:41AM with full battery and reception.
|
335
|
+
You can set `override_status_bar` to `true` in snapshot to set the status bar to Tuesday January 9th at 9:41AM with full battery and reception. If you need more granular customization, to set a Carrier name for example, also set `override_status_bar_arguments` to the specific arguments to be passed to the `xcrun simctl status_bar override` command. Run `xcrun simctl status_bar --help` to see the options available.
|
336
|
+
|
337
|
+
### Examples
|
338
|
+
|
339
|
+
```ruby
|
340
|
+
# Sets the time to 9:41AM with full battery and reception, with the default carrier name: Carrier
|
341
|
+
capture_ios_screenshots(
|
342
|
+
override_status_bar: true
|
343
|
+
)
|
344
|
+
```
|
345
|
+
|
346
|
+
```ruby
|
347
|
+
# Set the time to 9:41AM, battery at 75% and charging, on the TELUS LTE network
|
348
|
+
capture_ios_screenshots(
|
349
|
+
override_status_bar: true,
|
350
|
+
override_status_bar_arguments: "--time 9:41 --dataNetwork lte --cellularMode active --cellularBars 4 --batteryState charging --batteryLevel 75 --operatorName TELUS"
|
351
|
+
)
|
352
|
+
```
|
336
353
|
|
337
354
|
## Gray artifacts around text
|
338
355
|
|
@@ -138,7 +138,7 @@ Inside of a given locale directory is a folder called `images`. Here you can sup
|
|
138
138
|
- `promoGraphic`
|
139
139
|
- `tvBanner`
|
140
140
|
|
141
|
-
You can also supply screenshots by creating directories within the `images` directory with the following names, containing PNGs or JPEGs
|
141
|
+
You can also supply screenshots by creating directories within the `images` directory with the following names, containing PNGs or JPEGs:
|
142
142
|
|
143
143
|
- `phoneScreenshots/`
|
144
144
|
- `sevenInchScreenshots/` (7-inch tablets)
|
@@ -146,6 +146,7 @@ You can also supply screenshots by creating directories within the `images` dire
|
|
146
146
|
- `tvScreenshots/`
|
147
147
|
- `wearScreenshots/`
|
148
148
|
|
149
|
+
You may name images anything you like, but screenshots will appear in the Play Store in alphanumerical filename order.
|
149
150
|
Note that these will replace the current images and screenshots on the play store listing, not add to them.
|
150
151
|
|
151
152
|
## Changelogs (What's new)
|
@@ -3,15 +3,11 @@ module Fastlane
|
|
3
3
|
class EnsureEnvVarsAction < Action
|
4
4
|
def self.run(params)
|
5
5
|
variables = params[:env_vars]
|
6
|
+
missing_variables = variables.select { |variable| ENV[variable].to_s.strip.empty? }
|
6
7
|
|
7
|
-
|
8
|
-
next unless ENV[variable].to_s.strip.empty?
|
9
|
-
|
10
|
-
UI.user_error!("Missing environment variable '#{variable}'")
|
11
|
-
end
|
8
|
+
UI.user_error!("Missing environment variable(s) '#{missing_variables.join('\', \'')}'") unless missing_variables.empty?
|
12
9
|
|
13
10
|
is_one = variables.length == 1
|
14
|
-
|
15
11
|
UI.success("Environment variable#{is_one ? '' : 's'} '#{variables.join('\', \'')}' #{is_one ? 'is' : 'are'} set!")
|
16
12
|
end
|
17
13
|
|
@@ -68,6 +68,10 @@ module Fastlane
|
|
68
68
|
"The UUID of the profile sigh just fetched/generated"
|
69
69
|
end
|
70
70
|
|
71
|
+
def self.return_type
|
72
|
+
:string
|
73
|
+
end
|
74
|
+
|
71
75
|
def self.details
|
72
76
|
"**Note**: It is recommended to use [match](https://docs.fastlane.tools/actions/match/) according to the [codesigning.guide](https://codesigning.guide) for generating and maintaining your provisioning profiles. Use _sigh_ directly only if you want full control over what's going on and know more about codesigning."
|
73
77
|
end
|
@@ -8,14 +8,15 @@ module Fastlane
|
|
8
8
|
require 'shellwords'
|
9
9
|
|
10
10
|
def self.run(params)
|
11
|
-
|
11
|
+
xcodeproj_path_or_dir = params[:xcodeproj] || '.'
|
12
|
+
xcodeproj_dir = File.extname(xcodeproj_path_or_dir) == ".xcodeproj" ? File.dirname(xcodeproj_path_or_dir) : xcodeproj_path_or_dir
|
12
13
|
target_name = params[:target]
|
13
14
|
configuration = params[:configuration]
|
14
15
|
|
15
16
|
# Get version_number
|
16
|
-
project = get_project!(
|
17
|
+
project = get_project!(xcodeproj_path_or_dir)
|
17
18
|
target = get_target!(project, target_name)
|
18
|
-
plist_file = get_plist!(
|
19
|
+
plist_file = get_plist!(xcodeproj_dir, target, configuration)
|
19
20
|
version_number = get_version_number_from_plist!(plist_file)
|
20
21
|
|
21
22
|
# Get from build settings (or project settings) if needed (ex: $(MARKETING_VERSION) is default in Xcode 11)
|
@@ -39,13 +40,18 @@ module Fastlane
|
|
39
40
|
return version_number
|
40
41
|
end
|
41
42
|
|
42
|
-
def self.get_project!(
|
43
|
+
def self.get_project!(xcodeproj_path_or_dir)
|
43
44
|
require 'xcodeproj'
|
44
|
-
|
45
|
-
|
45
|
+
if File.extname(xcodeproj_path_or_dir) == ".xcodeproj"
|
46
|
+
project_path = xcodeproj_path_or_dir
|
47
|
+
else
|
48
|
+
project_path = Dir.glob("#{xcodeproj_path_or_dir}/*.xcodeproj").first
|
49
|
+
end
|
50
|
+
|
51
|
+
if project_path && File.exist?(project_path)
|
46
52
|
return Xcodeproj::Project.open(project_path)
|
47
53
|
else
|
48
|
-
UI.user_error!("Unable to find Xcode project
|
54
|
+
UI.user_error!("Unable to find Xcode project at #{project_path || xcodeproj_path_or_dir}")
|
49
55
|
end
|
50
56
|
end
|
51
57
|
|
@@ -147,11 +153,12 @@ module Fastlane
|
|
147
153
|
[
|
148
154
|
FastlaneCore::ConfigItem.new(key: :xcodeproj,
|
149
155
|
env_name: "FL_VERSION_NUMBER_PROJECT",
|
150
|
-
description: "Path to the
|
156
|
+
description: "Path to the Xcode project to read version number from, or its containing directory, optional. If ommitted, or if a directory is passed instead, it will use the first Xcode project found within the given directory, or the project root directory if none is passed",
|
151
157
|
optional: true,
|
152
158
|
verify_block: proc do |value|
|
153
|
-
UI.user_error!("Please pass the path to the project, not the workspace") if value.end_with?(".xcworkspace")
|
154
|
-
UI.user_error!("Could not find
|
159
|
+
UI.user_error!("Please pass the path to the project or its containing directory, not the workspace path") if value.end_with?(".xcworkspace")
|
160
|
+
UI.user_error!("Could not find file or directory at path '#{File.expand_path(value)}'") unless File.exist?(value)
|
161
|
+
UI.user_error!("Could not find Xcode project in directory at path '#{File.expand_path(value)}'") if File.extname(value) != ".xcodeproj" && Dir.glob("#{value}/*.xcodeproj").empty?
|
155
162
|
end),
|
156
163
|
FastlaneCore::ConfigItem.new(key: :target,
|
157
164
|
env_name: "FL_VERSION_NUMBER_TARGET",
|
@@ -1,16 +1,10 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
|
-
module SharedValues
|
4
|
-
GIT_BRANCH_ENV_VARS = %w(GIT_BRANCH BRANCH_NAME TRAVIS_BRANCH BITRISE_GIT_BRANCH CI_BUILD_REF_NAME CI_COMMIT_REF_NAME WERCKER_GIT_BRANCH BUILDKITE_BRANCH APPCENTER_BRANCH CIRCLE_BRANCH).reject do |branch|
|
5
|
-
# Removing because tests break on CircleCI
|
6
|
-
Helper.test? && branch == "CIRCLE_BRANCH"
|
7
|
-
end.freeze
|
8
|
-
end
|
9
|
-
|
10
3
|
class GitBranchAction < Action
|
11
4
|
def self.run(params)
|
12
|
-
|
13
|
-
|
5
|
+
branch = Actions.git_branch || ""
|
6
|
+
return "" if branch == "HEAD" # Backwards compatibility with the original (and documented) implementation
|
7
|
+
branch
|
14
8
|
end
|
15
9
|
|
16
10
|
#####################################################
|
@@ -22,7 +16,7 @@ module Fastlane
|
|
22
16
|
end
|
23
17
|
|
24
18
|
def self.details
|
25
|
-
"If no branch could be found, this action will return an empty string"
|
19
|
+
"If no branch could be found, this action will return an empty string. This is a wrapper for the internal action Actions.git_branch"
|
26
20
|
end
|
27
21
|
|
28
22
|
def self.available_options
|
@@ -42,11 +42,13 @@ module Fastlane
|
|
42
42
|
FastlaneCore::ConfigItem.new(key: :message,
|
43
43
|
description: "The commit message that should be used"),
|
44
44
|
FastlaneCore::ConfigItem.new(key: :skip_git_hooks,
|
45
|
-
description: "Set to true to pass
|
45
|
+
description: "Set to true to pass `--no-verify` to git",
|
46
|
+
default_value: false,
|
46
47
|
type: Boolean,
|
47
48
|
optional: true),
|
48
49
|
FastlaneCore::ConfigItem.new(key: :allow_nothing_to_commit,
|
49
50
|
description: "Set to true to allow commit without any git changes in the files you want to commit",
|
51
|
+
default_value: false,
|
50
52
|
type: Boolean,
|
51
53
|
optional: true)
|
52
54
|
]
|
@@ -13,20 +13,19 @@ module Fastlane
|
|
13
13
|
#####################################################
|
14
14
|
|
15
15
|
def self.description
|
16
|
-
"Executes a git submodule command"
|
16
|
+
"Executes a git submodule update command"
|
17
17
|
end
|
18
18
|
|
19
19
|
def self.available_options
|
20
20
|
[
|
21
21
|
FastlaneCore::ConfigItem.new(key: :recursive,
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
description: "Should the submodules be updated recursively?",
|
23
|
+
type: Boolean,
|
24
|
+
default_value: false),
|
25
25
|
FastlaneCore::ConfigItem.new(key: :init,
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
default_value: false)
|
26
|
+
description: "Should the submodules be initiated before update?",
|
27
|
+
type: Boolean,
|
28
|
+
default_value: false)
|
30
29
|
]
|
31
30
|
end
|
32
31
|
|
@@ -44,6 +43,15 @@ module Fastlane
|
|
44
43
|
return true
|
45
44
|
end
|
46
45
|
|
46
|
+
def self.example_code
|
47
|
+
[
|
48
|
+
'git_submodule_update',
|
49
|
+
'git_submodule_update(recursive: true)',
|
50
|
+
'git_submodule_update(init: true)',
|
51
|
+
'git_submodule_update(recursive: true, init: true)'
|
52
|
+
]
|
53
|
+
end
|
54
|
+
|
47
55
|
def self.category
|
48
56
|
:source_control
|
49
57
|
end
|
@@ -43,7 +43,7 @@ module Fastlane
|
|
43
43
|
is_string: false,
|
44
44
|
optional: true),
|
45
45
|
FastlaneCore::ConfigItem.new(key: :cache_path,
|
46
|
-
description: "The path to a directory where the repository should be cloned into.
|
46
|
+
description: "The path to a directory where the repository should be cloned into. Defaults to `nil`, which causes the repository to be cloned on every call, to a temporary directory",
|
47
47
|
default_value: nil,
|
48
48
|
optional: true)
|
49
49
|
]
|
@@ -61,14 +61,14 @@ module Fastlane
|
|
61
61
|
[
|
62
62
|
'import_from_git(
|
63
63
|
url: "git@github.com:fastlane/fastlane.git", # The URL of the repository to import the Fastfile from.
|
64
|
-
branch: "HEAD", # The branch to checkout on the repository
|
65
|
-
path: "fastlane/Fastfile", # The path of the Fastfile in the repository
|
64
|
+
branch: "HEAD", # The branch to checkout on the repository.
|
65
|
+
path: "fastlane/Fastfile", # The path of the Fastfile in the repository.
|
66
66
|
version: "~> 1.0.0" # The version to checkout on the repository. Optimistic match operator can be used to select the latest version within constraints.
|
67
67
|
)',
|
68
68
|
'import_from_git(
|
69
69
|
url: "git@github.com:fastlane/fastlane.git", # The URL of the repository to import the Fastfile from.
|
70
|
-
branch: "HEAD", # The branch to checkout on the repository
|
71
|
-
path: "fastlane/Fastfile", # The path of the Fastfile in the repository
|
70
|
+
branch: "HEAD", # The branch to checkout on the repository.
|
71
|
+
path: "fastlane/Fastfile", # The path of the Fastfile in the repository.
|
72
72
|
version: [">= 1.1.0", "< 2.0.0"], # The version to checkout on the repository. Multiple conditions can be used to select the latest version within constraints.
|
73
73
|
cache_path: "~/.cache/fastlane/imported" # A directory in which the repository will be added, which means that it will not be cloned again on subsequent calls.
|
74
74
|
)'
|
@@ -1,5 +1,9 @@
|
|
1
1
|
module Fastlane
|
2
2
|
module Actions
|
3
|
+
module SharedValues
|
4
|
+
JIRA_JSON = :JIRA_JSON
|
5
|
+
end
|
6
|
+
|
3
7
|
class JiraAction < Action
|
4
8
|
def self.run(params)
|
5
9
|
Actions.verify_gem!('jira-ruby')
|
@@ -21,10 +25,28 @@ module Fastlane
|
|
21
25
|
password: password
|
22
26
|
}
|
23
27
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
+
begin
|
29
|
+
client = JIRA::Client.new(options)
|
30
|
+
issue = client.Issue.find(ticket_id)
|
31
|
+
comment = issue.comments.build
|
32
|
+
comment.save({ 'body' => comment_text })
|
33
|
+
|
34
|
+
# An exact representation of the JSON returned from the JIRA API
|
35
|
+
# https://github.com/sumoheavy/jira-ruby/blob/master/lib/jira/base.rb#L67
|
36
|
+
json_response = comment.attrs
|
37
|
+
raise 'Failed to add a comment on Jira ticket' if json_response.nil?
|
38
|
+
|
39
|
+
Actions.lane_context[SharedValues::JIRA_JSON] = json_response
|
40
|
+
UI.success('Successfully added a comment on Jira ticket')
|
41
|
+
return json_response
|
42
|
+
rescue => exception
|
43
|
+
message = "Received exception when adding a Jira comment: #{exception}"
|
44
|
+
if params[:fail_on_error]
|
45
|
+
UI.user_error!(message)
|
46
|
+
else
|
47
|
+
UI.error(message)
|
48
|
+
end
|
49
|
+
end
|
28
50
|
end
|
29
51
|
|
30
52
|
#####################################################
|
@@ -32,7 +54,7 @@ module Fastlane
|
|
32
54
|
#####################################################
|
33
55
|
|
34
56
|
def self.description
|
35
|
-
"Leave a comment on
|
57
|
+
"Leave a comment on a Jira ticket"
|
36
58
|
end
|
37
59
|
|
38
60
|
def self.available_options
|
@@ -50,13 +72,13 @@ module Fastlane
|
|
50
72
|
default_value: ""),
|
51
73
|
FastlaneCore::ConfigItem.new(key: :username,
|
52
74
|
env_name: "FL_JIRA_USERNAME",
|
53
|
-
description: "Username for
|
75
|
+
description: "Username for Jira instance",
|
54
76
|
verify_block: proc do |value|
|
55
77
|
UI.user_error!("No username") if value.to_s.length == 0
|
56
78
|
end),
|
57
79
|
FastlaneCore::ConfigItem.new(key: :password,
|
58
80
|
env_name: "FL_JIRA_PASSWORD",
|
59
|
-
description: "Password for Jira",
|
81
|
+
description: "Password or API token for Jira",
|
60
82
|
sensitive: true,
|
61
83
|
verify_block: proc do |value|
|
62
84
|
UI.user_error!("No password") if value.to_s.length == 0
|
@@ -72,15 +94,35 @@ module Fastlane
|
|
72
94
|
description: "Text to add to the ticket as a comment",
|
73
95
|
verify_block: proc do |value|
|
74
96
|
UI.user_error!("No comment specified") if value.to_s.length == 0
|
75
|
-
end)
|
97
|
+
end),
|
98
|
+
FastlaneCore::ConfigItem.new(key: :fail_on_error,
|
99
|
+
env_name: "FL_JIRA_FAIL_ON_ERROR",
|
100
|
+
description: "Should an error adding the Jira comment cause a failure?",
|
101
|
+
type: Boolean,
|
102
|
+
optional: true,
|
103
|
+
default_value: true) # Default value is true for 'Backward compatibility'
|
104
|
+
]
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.output
|
108
|
+
[
|
109
|
+
['JIRA_JSON', 'The whole Jira API JSON object']
|
76
110
|
]
|
77
111
|
end
|
78
112
|
|
79
113
|
def self.return_value
|
114
|
+
[
|
115
|
+
"A hash containing all relevant information of the Jira comment",
|
116
|
+
"Access Jira comment 'id', 'author', 'body', and more"
|
117
|
+
].join("\n")
|
118
|
+
end
|
119
|
+
|
120
|
+
def self.return_type
|
121
|
+
:hash
|
80
122
|
end
|
81
123
|
|
82
124
|
def self.authors
|
83
|
-
["iAmChrisTruman"]
|
125
|
+
["iAmChrisTruman", "crazymanish"]
|
84
126
|
end
|
85
127
|
|
86
128
|
def self.is_supported?(platform)
|
@@ -92,17 +134,22 @@ module Fastlane
|
|
92
134
|
'jira(
|
93
135
|
url: "https://bugs.yourdomain.com",
|
94
136
|
username: "Your username",
|
95
|
-
password: "Your password",
|
96
|
-
ticket_id: "
|
137
|
+
password: "Your password or API token",
|
138
|
+
ticket_id: "IOS-123",
|
97
139
|
comment_text: "Text to post as a comment"
|
98
|
-
)',
|
140
|
+
)', # How to get API token: https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/#get-an-api-token
|
99
141
|
'jira(
|
100
142
|
url: "https://yourserverdomain.com",
|
101
143
|
context_path: "/jira",
|
102
144
|
username: "Your username",
|
103
|
-
password: "Your password",
|
104
|
-
ticket_id: "
|
145
|
+
password: "Your password or API token",
|
146
|
+
ticket_id: "IOS-123",
|
105
147
|
comment_text: "Text to post as a comment"
|
148
|
+
)',
|
149
|
+
'jira(
|
150
|
+
ticket_id: "IOS-123",
|
151
|
+
comment_text: "Text to post as a comment",
|
152
|
+
fail_on_error: false
|
106
153
|
)'
|
107
154
|
]
|
108
155
|
end
|