fastlane-plugin-wpmreleasetoolkit 1.3.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +11 -17
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +5 -10
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +9 -16
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +8 -15
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +13 -22
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +11 -18
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +4 -10
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +2 -8
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +2 -6
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +1 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +1 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +1 -7
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb +4 -4
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +2 -8
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/comment_on_pr.rb +89 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +3 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +30 -15
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +115 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +5 -6
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +1 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +33 -68
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb +3 -1
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +48 -8
- data/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb +93 -0
- data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
- metadata +27 -4
@@ -0,0 +1,93 @@
|
|
1
|
+
require 'fastlane_core'
|
2
|
+
|
3
|
+
# The features in this file are controlled by the following ENV vars:
|
4
|
+
#
|
5
|
+
# @env `FASTLANE_PROMPT_REMINDER_DISABLE_AUTO_PATCH`
|
6
|
+
# If this variable is set, it will disable the auto-application of the monkey patch. In such case,
|
7
|
+
# `UI.input`, `UI.confirm`, `UI.select` and `UI.password` methods won't be automatically patched
|
8
|
+
# unless you explicitly call `monkey_patch_interactive_prompts_with_reminder` yourself.
|
9
|
+
#
|
10
|
+
# @env `FASTLANE_PROMPT_REMINDER_MESSAGE`
|
11
|
+
# - If not set, then while auto-patching the `UI.…` methods, it will NOT make the patched methods
|
12
|
+
# speak any vocal message – and instead will only emit a beep and make your Terminal icon jump in the Dock.
|
13
|
+
# - If set to `default`, `true`, `yes` or `1`, then while auto-patching the `UI.…` methods, it will
|
14
|
+
# make the patched methods announce the default message.
|
15
|
+
# - If set to any other string, it will make the patched methods use that string as the message to announce
|
16
|
+
# during the reminders
|
17
|
+
# - NOTE: This env var only has an effect if the other `FASTLANE_PROMPT_REMINDER_DISABLE_AUTO_PATCH` env var
|
18
|
+
# is _not_ set (and thus the `UI.…` methods _are_ auto-patched), because it only affects how auto-patching is done.
|
19
|
+
#
|
20
|
+
# @env `FASTLANE_PROMPT_REMINDER_DELAYS`
|
21
|
+
# The delays (in seconds) to use when monkey-patching the `UI.…` methods to wrap them around `with_reminder`,
|
22
|
+
# separated by a comma (e.g. `60,300,900`). If unset, will use the default delays of `30,180,600`.
|
23
|
+
|
24
|
+
module FastlaneCore
|
25
|
+
# NOTE: FastlaneCore::UI delegates to the FastlaneCore::Shell implementation when output is the terminal
|
26
|
+
class Shell
|
27
|
+
DEFAULT_PROMPT_REMINDER_MESSAGE = 'An interactive prompt is waiting for you in the Terminal!'.freeze
|
28
|
+
DEFAULT_PROMPT_REMINDER_DELAYS = [30, 180, 600].freeze
|
29
|
+
|
30
|
+
# Calls the block given and remind the user with a vocal message if the block does not return after specific delays.
|
31
|
+
#
|
32
|
+
# Especially useful when using a block which calls methods that are interactive, in order to remind the user
|
33
|
+
# to answer the interactive prompt if they forgot about it after some delays.
|
34
|
+
#
|
35
|
+
# Example usage:
|
36
|
+
#
|
37
|
+
# text = with_reminder do
|
38
|
+
# puts "Enter some text:"
|
39
|
+
# $stdout.getch
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# @param [Double,Array<Double>] after
|
43
|
+
# Delay or list of delays to wait for before pronouncing the reminder message.
|
44
|
+
# If an array of values is passed, the message will be pronounced multiple times, after having waited for the subsequent delays in turn.
|
45
|
+
# Defaults to reminding after 30s, then 3mn, then 10mn.
|
46
|
+
# @param [String] message
|
47
|
+
# The message to pronounce out loud after the delay has passed, if the block hasn't returned beforehand.
|
48
|
+
# @return The same value that the blocks might return
|
49
|
+
#
|
50
|
+
def self.with_reminder(after: DEFAULT_PROMPT_REMINDER_DELAYS, message: DEFAULT_PROMPT_REMINDER_MESSAGE)
|
51
|
+
delays_list = Array(after.dup)
|
52
|
+
thread = Thread.new do
|
53
|
+
until delays_list.empty?
|
54
|
+
sleep(delays_list.shift)
|
55
|
+
$stdout.beep
|
56
|
+
system('say', message) unless message.nil?
|
57
|
+
end
|
58
|
+
end
|
59
|
+
# execute the interactive code
|
60
|
+
res = yield
|
61
|
+
# if we replied before the timeout, kill the thread so message won't be triggered
|
62
|
+
thread.kill
|
63
|
+
# If the block given returned a value, pass it
|
64
|
+
return res
|
65
|
+
end
|
66
|
+
|
67
|
+
# Monkey-Patch fastlane's `UI.input`, `UI.confirm`, `UI.select` and `UI.password` interactive methods
|
68
|
+
# (which delegate to `FastlaneCore::Shell` when output is the terminal)
|
69
|
+
#
|
70
|
+
# Once you call this method, any invocation of `UI.input`, `UI.confirm`, `UI.select` or `UI.password`
|
71
|
+
# anywhere in Fastlane (by your Fastfile, an action, …) will be wrapped in a call to with_reminder automatically.
|
72
|
+
#
|
73
|
+
def self.monkey_patch_interactive_prompts_with_reminder(after: DEFAULT_PROMPT_REMINDER_DELAYS, message: DEFAULT_PROMPT_REMINDER_MESSAGE)
|
74
|
+
%i[input confirm select password].each do |method_name|
|
75
|
+
old_method = instance_method(method_name)
|
76
|
+
|
77
|
+
define_method(method_name) do |*args|
|
78
|
+
FastlaneCore::Shell.with_reminder(after: after, message: message) { old_method.bind(self).call(*args) }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Apply Monkey patch
|
86
|
+
unless ENV['FASTLANE_PROMPT_REMINDER_DISABLE_AUTO_PATCH']
|
87
|
+
message = ENV['FASTLANE_PROMPT_REMINDER_MESSAGE']
|
88
|
+
message = FastlaneCore::Shell::DEFAULT_PROMPT_REMINDER_MESSAGE if %w[default true yes 1].include?(message&.downcase)
|
89
|
+
delays = ENV['FASTLANE_PROMPT_REMINDER_DELAYS']&.split(',')&.map(&:to_i) || FastlaneCore::Shell::DEFAULT_PROMPT_REMINDER_DELAYS
|
90
|
+
|
91
|
+
FastlaneCore::UI.verbose("Monkey-patching the UI interactive methods to add a reminder (#{delays.inspect}, #{message.inspect})")
|
92
|
+
FastlaneCore::Shell.monkey_patch_interactive_prompts_with_reminder(after: delays, message: message)
|
93
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-wpmreleasetoolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorenzo Mattei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diffy
|
@@ -84,16 +84,22 @@ dependencies:
|
|
84
84
|
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '12.3'
|
90
|
+
- - "<"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: '14.0'
|
90
93
|
type: :runtime
|
91
94
|
prerelease: false
|
92
95
|
version_requirements: !ruby/object:Gem::Requirement
|
93
96
|
requirements:
|
94
|
-
- - "
|
97
|
+
- - ">="
|
95
98
|
- !ruby/object:Gem::Version
|
96
99
|
version: '12.3'
|
100
|
+
- - "<"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '14.0'
|
97
103
|
- !ruby/object:Gem::Dependency
|
98
104
|
name: rake-compiler
|
99
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -318,6 +324,20 @@ dependencies:
|
|
318
324
|
- - "~>"
|
319
325
|
- !ruby/object:Gem::Version
|
320
326
|
version: '4.1'
|
327
|
+
- !ruby/object:Gem::Dependency
|
328
|
+
name: cocoapods
|
329
|
+
requirement: !ruby/object:Gem::Requirement
|
330
|
+
requirements:
|
331
|
+
- - "~>"
|
332
|
+
- !ruby/object:Gem::Version
|
333
|
+
version: '1.10'
|
334
|
+
type: :development
|
335
|
+
prerelease: false
|
336
|
+
version_requirements: !ruby/object:Gem::Requirement
|
337
|
+
requirements:
|
338
|
+
- - "~>"
|
339
|
+
- !ruby/object:Gem::Version
|
340
|
+
version: '1.10'
|
321
341
|
description:
|
322
342
|
email: lore.mattei@gmail.com
|
323
343
|
executables:
|
@@ -388,6 +408,7 @@ files:
|
|
388
408
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb
|
389
409
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb
|
390
410
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb
|
411
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/comment_on_pr.rb
|
391
412
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb
|
392
413
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb
|
393
414
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb
|
@@ -419,6 +440,7 @@ files:
|
|
419
440
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb
|
420
441
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb
|
421
442
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb
|
443
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb
|
422
444
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb
|
423
445
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb
|
424
446
|
- lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb
|
@@ -442,6 +464,7 @@ files:
|
|
442
464
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb
|
443
465
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb
|
444
466
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb
|
467
|
+
- lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb
|
445
468
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb
|
446
469
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb
|
447
470
|
- lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb
|