fastlane-plugin-wpmreleasetoolkit 9.4.0 → 10.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb +1 -1
  3. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +2 -2
  4. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_validate_lib_strings_action.rb +1 -3
  5. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +9 -24
  6. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +8 -19
  7. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_preflight.rb +2 -2
  8. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +9 -21
  9. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +9 -21
  10. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +6 -18
  11. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +8 -22
  12. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +7 -20
  13. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +5 -16
  14. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +5 -16
  15. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +2 -5
  16. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +5 -4
  17. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +5 -16
  18. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_firebase_test.rb +2 -2
  19. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +5 -16
  20. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +5 -16
  21. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +5 -16
  22. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +6 -18
  23. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +1 -3
  24. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/extract_release_notes_for_version_action.rb +4 -4
  25. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +2 -2
  26. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +5 -5
  27. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/remove_branch_protection_action.rb +0 -11
  28. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/set_branch_protection_action.rb +0 -11
  29. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/{setfrozentag_action.rb → set_milestone_frozen_marker_action.rb} +14 -18
  30. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/{update_pull_requests_milestone_action.rb → update_assigned_milestone_action.rb} +31 -31
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/upload_to_s3.rb +3 -3
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_add_files_to_copy_action.rb +1 -3
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_update_action.rb +5 -7
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/configure/configure_validate_action.rb +10 -12
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +1 -1
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +1 -1
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_preflight.rb +4 -4
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +3 -2
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +1 -1
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +1 -1
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +2 -2
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +1 -1
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +1 -1
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +1 -1
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_download_strings_files_from_glotpress.rb +1 -1
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_extract_keys_from_strings_files.rb +3 -3
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +1 -1
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_generate_strings_file_from_code.rb +1 -1
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +1 -1
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_number.rb +1 -1
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +2 -2
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotfix_prechecks.rb +1 -1
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +3 -3
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_strings_files.rb +1 -1
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_send_app_size_metrics.rb +1 -1
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +1 -1
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata_source.rb +5 -5
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +2 -4
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_emulator_helper.rb +1 -1
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +0 -3
  63. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +27 -27
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +29 -34
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +20 -21
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/filesystem_helper.rb +1 -1
  67. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/git_helper.rb +18 -8
  68. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +8 -8
  69. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +1 -1
  70. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/interactive_prompt_reminder.rb +1 -1
  71. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +7 -3
  72. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +4 -4
  73. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_linter_helper.rb +4 -4
  74. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_version_helper.rb +11 -11
  75. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_download_helper.rb +9 -5
  76. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/promo_screenshots_helper.rb +14 -16
  77. data/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +7 -7
  78. data/lib/fastlane/plugin/wpmreleasetoolkit/models/file_reference.rb +7 -7
  79. data/lib/fastlane/plugin/wpmreleasetoolkit/models/firebase_test_lab_result.rb +1 -1
  80. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  81. metadata +14 -17
  82. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +0 -72
  83. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +0 -64
  84. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/deprecated.rb +0 -66
@@ -40,13 +40,12 @@ module Fastlane
40
40
  repo_branch_name = Fastlane::Helper::ConfigureHelper.repo_branch_name
41
41
  file_branch_name = Fastlane::Helper::ConfigureHelper.configure_file_branch_name
42
42
 
43
- unless repo_branch_name == file_branch_name
43
+ return if repo_branch_name == file_branch_name
44
44
 
45
- UI.user_error!([
46
- 'The branch specified in `.configure` is not the currently checked out branch in the secrets repository.',
47
- "To fix this issue, switch back to the `#{file_branch_name}` branch in the mobile secrets repository.",
48
- ].join("\n"))
49
- end
45
+ UI.user_error!([
46
+ 'The branch specified in `.configure` is not the currently checked out branch in the secrets repository.',
47
+ "To fix this issue, switch back to the `#{file_branch_name}` branch in the mobile secrets repository.",
48
+ ].join("\n"))
50
49
  end
51
50
 
52
51
  ### Validate that the pinned hash specified in .configure matches
@@ -55,13 +54,12 @@ module Fastlane
55
54
  repo_hash = Fastlane::Helper::ConfigureHelper.repo_commit_hash
56
55
  file_hash = Fastlane::Helper::ConfigureHelper.configure_file_commit_hash
57
56
 
58
- unless repo_hash == file_hash
57
+ return if repo_hash == file_hash
59
58
 
60
- UI.user_error!([
61
- 'The pinned_hash specified in `.configure` is not the currently checked out hash in the secrets repository.',
62
- "To fix this issue, check out the `#{file_hash}` hash in the mobile secrets repository.",
63
- ].join("\n"))
64
- end
59
+ UI.user_error!([
60
+ 'The pinned_hash specified in `.configure` is not the currently checked out hash in the secrets repository.',
61
+ "To fix this issue, check out the `#{file_hash}` hash in the mobile secrets repository.",
62
+ ].join("\n"))
65
63
  end
66
64
 
67
65
  ### Validate that based on the commit hash in the .configure file, no files have changed
@@ -91,7 +91,7 @@ module Fastlane
91
91
  end
92
92
 
93
93
  def self.is_supported?(platform)
94
- [:ios, :mac].include?(platform)
94
+ %i[ios mac].include?(platform)
95
95
  end
96
96
  end
97
97
  end
@@ -67,7 +67,7 @@ module Fastlane
67
67
  end
68
68
 
69
69
  def self.is_supported?(platform)
70
- [:ios, :mac].include?(platform)
70
+ %i[ios mac].include?(platform)
71
71
  end
72
72
  end
73
73
  end
@@ -11,7 +11,7 @@ module Fastlane
11
11
  # Internal Builds use it to generate the App Icon as part of the build process
12
12
  begin
13
13
  Action.sh('which convert')
14
- rescue
14
+ rescue StandardError
15
15
  UI.user_error!("Couldn't find ImageMagick. Please install it by running `brew install imagemagick`")
16
16
  raise
17
17
  end
@@ -20,7 +20,7 @@ module Fastlane
20
20
  # Internal Builds use it to generate the App Icon as part of the build process
21
21
  begin
22
22
  Action.sh('which gs')
23
- rescue
23
+ rescue StandardError
24
24
  UI.user_error!("Couldn't find Ghostscript. Please install it by running `brew install ghostscript`")
25
25
  raise
26
26
  end
@@ -28,7 +28,7 @@ module Fastlane
28
28
  # Check gems and pods are up to date. This will exit if it fails
29
29
  begin
30
30
  Action.sh('bundle check')
31
- rescue
31
+ rescue StandardError
32
32
  UI.user_error!("You should run 'rake dependencies' to make sure gems are up to date")
33
33
  raise
34
34
  end
@@ -70,7 +70,7 @@ module Fastlane
70
70
  end
71
71
 
72
72
  def self.is_supported?(platform)
73
- [:ios, :mac].include?(platform)
73
+ %i[ios mac].include?(platform)
74
74
  end
75
75
  end
76
76
  end
@@ -7,7 +7,8 @@ module Fastlane
7
7
  require_relative '../../helper/ios/ios_git_helper'
8
8
  require_relative '../../helper/ios/ios_version_helper'
9
9
 
10
- Fastlane::Helper::GitHelper.ensure_on_branch!('release')
10
+ # Verify that the current branch is a release branch. Notice that `ensure_git_branch` expects a RegEx parameter
11
+ ensure_git_branch(branch: '^release/')
11
12
  create_config
12
13
  show_config
13
14
 
@@ -44,7 +45,7 @@ module Fastlane
44
45
  end
45
46
 
46
47
  def self.is_supported?(platform)
47
- [:ios, :mac].include?(platform)
48
+ %i[ios mac].include?(platform)
48
49
  end
49
50
 
50
51
  def self.create_config
@@ -58,7 +58,7 @@ module Fastlane
58
58
  end
59
59
 
60
60
  def self.is_supported?(platform)
61
- [:ios, :mac].include?(platform)
61
+ %i[ios mac].include?(platform)
62
62
  end
63
63
 
64
64
  def self.create_config(previous_version, new_short_version)
@@ -63,7 +63,7 @@ module Fastlane
63
63
  end
64
64
 
65
65
  def self.is_supported?(platform)
66
- [:ios, :mac].include?(platform)
66
+ %i[ios mac].include?(platform)
67
67
  end
68
68
 
69
69
  def self.create_config
@@ -10,7 +10,7 @@ module Fastlane
10
10
  beta_pods << li if li.match('^\s*\t*pod.*beta')
11
11
  end
12
12
 
13
- if beta_pods.count == 0
13
+ if beta_pods.count.zero?
14
14
  UI.message('No beta pods found. You can continue with the code freeze.')
15
15
  else
16
16
  message = "The following pods are still in beta:\n"
@@ -55,7 +55,7 @@ module Fastlane
55
55
  end
56
56
 
57
57
  def self.is_supported?(platform)
58
- [:ios, :mac].include?(platform)
58
+ %i[ios mac].include?(platform)
59
59
  end
60
60
  end
61
61
  end
@@ -69,7 +69,7 @@ module Fastlane
69
69
  end
70
70
 
71
71
  def self.is_supported?(platform)
72
- [:ios, :mac].include?(platform)
72
+ %i[ios mac].include?(platform)
73
73
  end
74
74
  end
75
75
  end
@@ -58,7 +58,7 @@ module Fastlane
58
58
  end
59
59
 
60
60
  def self.is_supported?(platform)
61
- [:ios, :mac].include?(platform)
61
+ %i[ios mac].include?(platform)
62
62
  end
63
63
  end
64
64
  end
@@ -33,7 +33,7 @@ module Fastlane
33
33
  end
34
34
 
35
35
  def self.is_supported?(platform)
36
- [:ios, :mac].include?(platform)
36
+ %i[ios mac].include?(platform)
37
37
  end
38
38
  end
39
39
  end
@@ -107,7 +107,7 @@ module Fastlane
107
107
  end
108
108
 
109
109
  def self.is_supported?(platform)
110
- [:ios, :mac].include?(platform)
110
+ %i[ios mac].include?(platform)
111
111
  end
112
112
  end
113
113
  end
@@ -59,7 +59,7 @@ module Fastlane
59
59
  # @param [String] with_lproj The new name of the `.lproj` parent folder to point to
60
60
  #
61
61
  def self.replace_lproj_in_path(path, with_lproj:)
62
- File.join(File.dirname(File.dirname(path)), with_lproj, File.basename(path))
62
+ File.join(File.dirname(path, 2), with_lproj, File.basename(path))
63
63
  end
64
64
 
65
65
  #####################################################
@@ -108,7 +108,7 @@ module Fastlane
108
108
  type: Hash,
109
109
  verify_block: proc do |values|
110
110
  UI.user_error!('`target_original_files` must contain at least one path to an original `.strings` file.') if values.empty?
111
- values.each do |path, _|
111
+ values.each_key do |path|
112
112
  UI.user_error!("Path `#{path}` (found in `target_original_files`) does not exist.") unless File.exist?(path)
113
113
  UI.user_error! "Expected `#{path}` (found in `target_original_files`) to be a path ending in a `*.lproj/*.strings`." unless File.extname(path) == '.strings' && File.extname(File.dirname(path)) == '.lproj'
114
114
  end
@@ -129,7 +129,7 @@ module Fastlane
129
129
  end
130
130
 
131
131
  def self.is_supported?(platform)
132
- [:ios, :mac].include?(platform)
132
+ %i[ios mac].include?(platform)
133
133
  end
134
134
  end
135
135
  end
@@ -59,7 +59,7 @@ module Fastlane
59
59
  end
60
60
 
61
61
  def self.is_supported?(platform)
62
- [:ios, :mac].include?(platform)
62
+ %i[ios mac].include?(platform)
63
63
  end
64
64
  end
65
65
  end
@@ -108,7 +108,7 @@ module Fastlane
108
108
  end
109
109
 
110
110
  def self.is_supported?(platform)
111
- [:ios, :mac].include?(platform)
111
+ %i[ios mac].include?(platform)
112
112
  end
113
113
  end
114
114
  end
@@ -47,7 +47,7 @@ module Fastlane
47
47
  end
48
48
 
49
49
  def self.is_supported?(platform)
50
- [:ios, :mac].include?(platform)
50
+ %i[ios mac].include?(platform)
51
51
  end
52
52
  end
53
53
  end
@@ -47,7 +47,7 @@ module Fastlane
47
47
  end
48
48
 
49
49
  def self.is_supported?(platform)
50
- [:ios, :mac].include?(platform)
50
+ %i[ios mac].include?(platform)
51
51
  end
52
52
  end
53
53
  end
@@ -53,7 +53,7 @@ module Fastlane
53
53
  end
54
54
 
55
55
  def self.is_supported?(platform)
56
- [:ios, :mac].include?(platform)
56
+ %i[ios mac].include?(platform)
57
57
  end
58
58
  end
59
59
  end
@@ -27,7 +27,7 @@ module Fastlane
27
27
  end
28
28
  end
29
29
 
30
- return app_sizes
30
+ app_sizes
31
31
  end
32
32
 
33
33
  #####################################################
@@ -114,7 +114,7 @@ module Fastlane
114
114
  end
115
115
 
116
116
  def self.is_supported?(platform)
117
- [:ios, :mac].include?(platform)
117
+ %i[ios mac].include?(platform)
118
118
  end
119
119
  end
120
120
  end
@@ -71,7 +71,7 @@ module Fastlane
71
71
  end
72
72
 
73
73
  def self.is_supported?(platform)
74
- [:ios, :mac].include?(platform)
74
+ %i[ios mac].include?(platform)
75
75
  end
76
76
  end
77
77
  end
@@ -5,7 +5,7 @@ module Fastlane
5
5
  violations = nil
6
6
 
7
7
  loop do
8
- violations = self.run_linter(params)
8
+ violations = run_linter(params)
9
9
  violations.default = [] # Set the default value for when querying a missing key
10
10
 
11
11
  if params[:check_duplicate_keys]
@@ -60,7 +60,7 @@ module Fastlane
60
60
  else
61
61
  UI.important <<~WRONG_FORMAT
62
62
  File `#{path}` is in #{file_type} format, while finding duplicate keys only make sense on files that are in ASCII-plist format.
63
- Since your files are in #{file_type} format, you should probably disable the `check_duplicate_keys` option from this `#{self.action_name}` call.
63
+ Since your files are in #{file_type} format, you should probably disable the `check_duplicate_keys` option from this `#{action_name}` call.
64
64
  WRONG_FORMAT
65
65
  end
66
66
  end
@@ -201,7 +201,7 @@ module Fastlane
201
201
  end
202
202
 
203
203
  def self.is_supported?(platform)
204
- [:ios, :mac].include?(platform)
204
+ %i[ios mac].include?(platform)
205
205
  end
206
206
  end
207
207
  end
@@ -72,7 +72,7 @@ module Fastlane
72
72
  end
73
73
 
74
74
  def self.is_supported?(platform)
75
- [:ios, :mac].include? platform
75
+ %i[ios mac].include? platform
76
76
  end
77
77
  end
78
78
  end
@@ -31,7 +31,7 @@ module Fastlane
31
31
  app_thinning_plist_path = params[:app_thinning_plist_path] || File.join(File.dirname(params[:ipa_path]), 'app-thinning.plist')
32
32
  if File.exist?(app_thinning_plist_path)
33
33
  plist = Plist.parse_xml(app_thinning_plist_path)
34
- plist['variants'].each do |_key, variant|
34
+ plist['variants'].each_value do |variant|
35
35
  variant_descriptors = variant['variantDescriptors'] || [{ 'device' => 'Universal' }]
36
36
  variant_descriptors.each do |desc|
37
37
  variant_metadata = { device: desc['device'], 'OS Version': desc['os-version'] }
@@ -37,7 +37,7 @@ module Fastlane
37
37
  end
38
38
 
39
39
  def self.is_supported?(platform)
40
- [:ios, :mac].include?(platform)
40
+ %i[ios mac].include?(platform)
41
41
  end
42
42
  end
43
43
  end
@@ -10,15 +10,15 @@ module Fastlane
10
10
  release_version: params[:release_version])
11
11
 
12
12
  Action.sh("git add #{params[:po_file_path]}")
13
- params[:source_files].each do |_key, file|
13
+ params[:source_files].each_value do |file|
14
14
  Action.sh("git add #{file}")
15
15
  end
16
16
 
17
17
  repo_status = Actions.sh('git status --porcelain')
18
18
  repo_clean = repo_status.empty?
19
- unless repo_clean
20
- Action.sh('git commit -m "Update metadata strings"')
21
- end
19
+ return if repo_clean
20
+
21
+ Action.sh('git commit -m "Update metadata strings"')
22
22
  end
23
23
 
24
24
  #####################################################
@@ -73,7 +73,7 @@ module Fastlane
73
73
  end
74
74
 
75
75
  def self.is_supported?(platform)
76
- [:ios, :mac].include?(platform)
76
+ %i[ios mac].include?(platform)
77
77
  end
78
78
  end
79
79
  end
@@ -8,8 +8,6 @@ module Fastlane
8
8
  require_relative '../../helper/release_notes_helper'
9
9
  require_relative '../../helper/git_helper'
10
10
 
11
- UI.deprecated('The `PROJECT_ROOT_FOLDER` environment variable is deprecated and will be removed in a future release. Please pass a path to the `release_notes_file_path` param instead.') unless ENV['PROJECT_ROOT_FOLDER'].nil?
12
-
13
11
  path = params[:release_notes_file_path]
14
12
  next_version = Fastlane::Helper::Ios::VersionHelper.calc_next_release_version(params[:new_version])
15
13
 
@@ -41,7 +39,7 @@ module Fastlane
41
39
  env_name: 'FL_IOS_UPDATE_RELEASE_NOTES_FILE_PATH',
42
40
  description: 'The path to the release notes file to be updated',
43
41
  type: String,
44
- default_value: File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')),
42
+ default_value: 'RELEASE-NOTES.txt'),
45
43
  ]
46
44
  end
47
45
 
@@ -56,7 +54,7 @@ module Fastlane
56
54
  end
57
55
 
58
56
  def self.is_supported?(platform)
59
- [:ios, :mac].include?(platform)
57
+ %i[ios mac].include?(platform)
60
58
  end
61
59
  end
62
60
  end
@@ -9,7 +9,7 @@ module Fastlane
9
9
  head_tags = Fastlane::Helper::GitHelper.list_tags_on_current_commit
10
10
  UI.user_error!('HEAD is not on tag. Aborting!') if head_tags.empty?
11
11
 
12
- return head_tags.include?(version) # Current commit is tagged with "version" tag
12
+ head_tags.include?(version) # Current commit is tagged with "version" tag
13
13
  end
14
14
 
15
15
  #####################################################
@@ -39,7 +39,7 @@ module Fastlane
39
39
  end
40
40
 
41
41
  def self.is_supported?(platform)
42
- [:ios, :mac].include?(platform)
42
+ %i[ios mac].include?(platform)
43
43
  end
44
44
  end
45
45
  end
@@ -161,7 +161,7 @@ module Fastlane
161
161
 
162
162
  # Wait until all emulators are killed
163
163
  retry_loop(time_between_retries: SHUTDOWN_WAIT, timeout: SHUTDOWN_TIMEOUT, description: 'waiting for devices to shutdown') do
164
- (emulators_list & running_emulators.map(&:serial)).empty?
164
+ !emulators_list.intersect?(running_emulators.map(&:serial))
165
165
  end
166
166
 
167
167
  UI.success('All emulators are now shut down.')
@@ -9,9 +9,6 @@ module Fastlane
9
9
  # This typically commits the `version.properties` inside root folder or `build.gradle` file
10
10
  # inside the project subfolder.
11
11
  #
12
- # @env PROJECT_ROOT_FOLDER The path to the git root of the project
13
- # @env PROJECT_NAME The name of the directory containing the project code (especially containing the `build.gradle` file)
14
- #
15
12
  def self.commit_version_bump(build_gradle_path:, version_properties_path:)
16
13
  if File.exist?(version_properties_path)
17
14
  git_commit(
@@ -19,7 +19,7 @@ module Fastlane
19
19
  return true
20
20
  end
21
21
 
22
- return false
22
+ false
23
23
  end
24
24
 
25
25
  # Checks if `string_name` is in the exclusion list
@@ -27,10 +27,10 @@ module Fastlane
27
27
  return false if library[:exclusions].nil?
28
28
 
29
29
  skip = library[:exclusions].include?(string_name)
30
- if skip
31
- UI.message " - Skipping #{string_name} string"
32
- return true
33
- end
30
+ return false unless skip
31
+
32
+ UI.message " - Skipping #{string_name} string"
33
+ true
34
34
  end
35
35
 
36
36
  # Adds the appropriate XML attributes to an XML `<string>` node according to library configuration
@@ -77,7 +77,7 @@ module Fastlane
77
77
  # String not found, or removed because needing update and not in the exclusion list: add to the main file
78
78
  add_xml_attributes!(lib_string_node, library)
79
79
  main_strings_xml.xpath('//string').last.add_next_sibling("\n#{' ' * 4}#{lib_string_node.to_xml.strip}")
80
- return result
80
+ result
81
81
  end
82
82
 
83
83
  # Verify a string node from a library has properly been merged into the main one
@@ -149,21 +149,21 @@ module Fastlane
149
149
  end
150
150
 
151
151
  UI.message("Done (#{added_count} added, #{updated_count} updated, #{untouched_count} untouched, #{skipped_count} skipped).")
152
- return (added_count + updated_count) != 0
152
+ (added_count + updated_count) != 0
153
153
  end
154
154
 
155
155
  def self.verify_diff(diff_string, main_strings, lib_strings, library)
156
- if diff_string.start_with?('name=')
157
- diff_string.slice!('name="')
156
+ return unless diff_string.start_with?('name=')
158
157
 
159
- end_index = diff_string.index('"')
160
- end_index ||= diff_string.length # Use the whole string if there's no '"'
158
+ diff_string.slice!('name="')
161
159
 
162
- diff_string = diff_string.slice(0..(end_index - 1))
160
+ end_index = diff_string.index('"')
161
+ end_index ||= diff_string.length # Use the whole string if there's no '"'
163
162
 
164
- lib_strings.xpath('//string').each do |string_node|
165
- res = verify_string(main_strings, library, string_node) if string_node.attr('name') == diff_string
166
- end
163
+ diff_string = diff_string.slice(0..(end_index - 1))
164
+
165
+ lib_strings.xpath('//string').each do |string_node|
166
+ verify_string(main_strings, library, string_node) if string_node.attr('name') == diff_string
167
167
  end
168
168
  end
169
169
 
@@ -290,7 +290,7 @@ module Fastlane
290
290
  rescue StandardError => e
291
291
  UI.error "Error downloading #{locale} - #{e.message}"
292
292
  retry if e.is_a?(OpenURI::HTTPError) && UI.confirm("Retry downloading `#{locale}`?")
293
- return nil
293
+ nil
294
294
  end
295
295
  end
296
296
  private_class_method :download_glotpress_export_file
@@ -331,12 +331,12 @@ module Fastlane
331
331
  tag.content = tag.content.gsub('...', '…')
332
332
 
333
333
  # Typography en-dash
334
- if tag.content.include?('-')
335
- tag.content = tag.content.gsub(/(\d+\s*)-(\s*\d+)/) do |str|
336
- match = Regexp.last_match # of type `MatchData`. match[0] == str == whole match, match[1] = 1st capture group (left part of the range), match[2] = second capture group (right part of the range)
337
- is_negative_number = match[2][0] != ' ' && match[1][-1] == ' ' # if right part of range does not start with a space (e.g. `-3`), but left part of range does end with space, it's not a range after all but more likely a list containing negative numbers in it (e.g. `2 -3`)
338
- is_negative_number ? str : "#{match[1]}\u{2013}#{match[2]}"
339
- end
334
+ return unless tag.content.include?('-')
335
+
336
+ tag.content = tag.content.gsub(/(\d+\s*)-(\s*\d+)/) do |str|
337
+ match = Regexp.last_match # of type `MatchData`. match[0] == str == whole match, match[1] = 1st capture group (left part of the range), match[2] = second capture group (right part of the range)
338
+ is_negative_number = match[2][0] != ' ' && match[1][-1] == ' ' # if right part of range does not start with a space (e.g. `-3`), but left part of range does end with space, it's not a range after all but more likely a list containing negative numbers in it (e.g. `2 -3`)
339
+ is_negative_number ? str : "#{match[1]}\u{2013}#{match[2]}"
340
340
  end
341
341
  end
342
342
  private_class_method :apply_substitutions
@@ -347,9 +347,9 @@ module Fastlane
347
347
  # @param [String] lang The language we are currently processing. Used for providing context during logging / warning message
348
348
  #
349
349
  def self.quick_lint(string_tag, lang)
350
- if string_tag['formatted'] == 'false' && string_tag.content.include?('%%')
351
- UI.important "Warning: [#{lang}] translation for '#{string_tag['name']}' has attribute formatted=false, but still contains escaped '%%' in translation."
352
- end
350
+ return unless string_tag['formatted'] == 'false' && string_tag.content.include?('%%')
351
+
352
+ UI.important "Warning: [#{lang}] translation for '#{string_tag['name']}' has attribute formatted=false, but still contains escaped '%%' in translation."
353
353
  end
354
354
  private_class_method :quick_lint
355
355
 
@@ -377,8 +377,8 @@ module Nokogiri
377
377
  oa = other.attributes
378
378
  return false unless sa.length == oa.length
379
379
 
380
- sa = sa.sort.map { |n, a| [n, a.value, a.namespace && a.namespace.href] }
381
- oa = oa.sort.map { |n, a| [n, a.value, a.namespace && a.namespace.href] }
380
+ sa = sa.sort.map { |n, a| [n, a.value, a.namespace&.href] }
381
+ oa = oa.sort.map { |n, a| [n, a.value, a.namespace&.href] }
382
382
  return false unless sa == oa
383
383
 
384
384
  skids = children