fastlane-plugin-wpmreleasetoolkit 1.4.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +19 -19
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +5 -10
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +9 -16
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +8 -15
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +6 -12
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +20 -20
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +13 -13
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +2 -8
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +1 -7
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +2 -6
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +1 -7
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +1 -7
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +1 -7
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +2 -8
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +1 -1
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/comment_on_pr.rb +89 -0
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb +3 -1
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +8 -2
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +10 -5
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +10 -4
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +115 -0
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +5 -6
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +1 -1
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +1 -1
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +33 -68
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +5 -0
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +48 -8
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb +93 -0
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  32. metadata +13 -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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module Wpmreleasetoolkit
3
- VERSION = '1.4.0'
3
+ VERSION = '2.3.0'
4
4
  end
5
5
  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: 1.4.0
4
+ version: 2.3.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-08-04 00:00:00.000000000 Z
11
+ date: 2021-12-16 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
@@ -402,6 +408,7 @@ files:
402
408
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb
403
409
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb
404
410
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/close_milestone_action.rb
411
+ - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/comment_on_pr.rb
405
412
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_new_milestone_action.rb
406
413
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/create_release_action.rb
407
414
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb
@@ -433,6 +440,7 @@ files:
433
440
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb
434
441
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb
435
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
436
444
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb
437
445
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb
438
446
  - lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb
@@ -456,6 +464,7 @@ files:
456
464
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb
457
465
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb
458
466
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb
467
+ - lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb
459
468
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb
460
469
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb
461
470
  - lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb