fastlane-plugin-wpmreleasetoolkit 1.0.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/bin/drawText +1 -0
  3. data/ext/drawText/drawText Tests/DigitParsingTests.swift +21 -0
  4. data/ext/drawText/drawText Tests/ExtensionsTests.swift +5 -0
  5. data/ext/drawText/drawText Tests/Info.plist +22 -0
  6. data/ext/drawText/drawText Tests/StylesheetTests.swift +31 -0
  7. data/ext/drawText/drawText Tests/Test Cases/default-stylesheet.txt +10 -0
  8. data/ext/drawText/drawText Tests/Test Cases/external-styles-sample.css +3 -0
  9. data/ext/drawText/drawText Tests/Test Cases/external-styles-test.txt +13 -0
  10. data/ext/drawText/drawText Tests/Test Cases/large-text-block.txt +1 -0
  11. data/ext/drawText/drawText Tests/Test Cases/regular-text-block.txt +2 -0
  12. data/ext/drawText/drawText Tests/Test Cases/rtl-text-block.txt +2 -0
  13. data/ext/drawText/drawText Tests/Test Cases/text-size-adjustment-test.txt +10 -0
  14. data/ext/drawText/drawText Tests/TextImageTests.swift +99 -0
  15. data/ext/drawText/drawText Tests/drawText_Tests.swift +14 -0
  16. data/ext/drawText/drawText.xcodeproj/project.pbxproj +508 -0
  17. data/ext/drawText/drawText.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  18. data/ext/drawText/drawText.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  19. data/ext/drawText/drawText.xcodeproj/xcshareddata/xcschemes/drawText Tests.xcscheme +57 -0
  20. data/ext/drawText/drawText.xcodeproj/xcshareddata/xcschemes/drawText.xcscheme +109 -0
  21. data/ext/drawText/drawText/Assets/style.css +1 -0
  22. data/ext/drawText/drawText/CoreTextStack.swift +113 -0
  23. data/ext/drawText/drawText/Helpers/CommandLineHelpers.swift +36 -0
  24. data/ext/drawText/drawText/Helpers/Extensions.swift +27 -0
  25. data/ext/drawText/drawText/Helpers/FileSystemHelper.swift +24 -0
  26. data/ext/drawText/drawText/Stylesheet.swift +48 -0
  27. data/ext/drawText/drawText/TextImage.swift +100 -0
  28. data/ext/drawText/drawText/main.swift +61 -0
  29. data/ext/drawText/extconf.rb +1 -1
  30. data/ext/drawText/makefile.example +8 -0
  31. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_update_metadata_source_action.rb +3 -3
  32. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_betabuild_prechecks.rb +22 -16
  33. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_build_prechecks.rb +15 -9
  34. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_beta.rb +26 -26
  35. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_final_release.rb +27 -24
  36. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_hotfix.rb +21 -23
  37. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_bump_version_release.rb +31 -40
  38. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_codefreeze_prechecks.rb +16 -9
  39. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_completecodefreeze_prechecks.rb +10 -4
  40. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_create_xml_release_notes.rb +2 -2
  41. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_current_branch_is_hotfix.rb +10 -2
  42. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_file_by_version.rb +1 -1
  43. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_download_translations_action.rb +2 -2
  44. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_finalize_prechecks.rb +11 -7
  45. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_alpha_version.rb +8 -2
  46. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_app_version.rb +8 -2
  47. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_get_release_version.rb +8 -2
  48. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_hotifx_prechecks.rb +5 -5
  49. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_merge_translators_strings.rb +1 -1
  50. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_tag_build.rb +11 -5
  51. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_metadata.rb +1 -1
  52. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/android/android_update_release_notes.rb +3 -3
  53. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_for_toolkit_updates_action.rb +99 -0
  54. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/check_translation_progress.rb +147 -0
  55. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/circleci_trigger_job_action.rb +1 -1
  56. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb +1 -1
  57. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_update_metadata_source.rb +6 -5
  58. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/promo_screenshots_action.rb +2 -2
  59. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/removebranchprotection_action.rb +3 -3
  60. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setbranchprotection_action.rb +3 -3
  61. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/common/setfrozentag_action.rb +1 -1
  62. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_betabuild_prechecks.rb +5 -5
  63. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_build_prechecks.rb +4 -4
  64. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_beta.rb +2 -2
  65. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_hotfix.rb +1 -1
  66. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_bump_version_release.rb +5 -5
  67. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_check_beta_deps.rb +2 -2
  68. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_clear_intermediate_tags.rb +1 -1
  69. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_codefreeze_prechecks.rb +4 -4
  70. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_completecodefreeze_prechecks.rb +5 -5
  71. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_current_branch_is_hotfix.rb +1 -1
  72. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_final_tag.rb +2 -2
  73. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_finalize_prechecks.rb +5 -5
  74. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_app_version.rb +1 -1
  75. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_build_version.rb +1 -1
  76. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_get_store_app_sizes.rb +1 -1
  77. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_hotifx_prechecks.rb +5 -5
  78. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_lint_localizations.rb +1 -1
  79. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_localize_project.rb +1 -1
  80. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_merge_translators_strings.rb +4 -4
  81. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_tag_build.rb +2 -2
  82. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_metadata.rb +1 -1
  83. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_update_release_notes.rb +3 -3
  84. data/lib/fastlane/plugin/wpmreleasetoolkit/actions/ios/ios_validate_ci_build.rb +2 -2
  85. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/an_metadata_update_helper.rb +3 -3
  86. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_git_helper.rb +14 -5
  87. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb +11 -2
  88. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_version_helper.rb +133 -55
  89. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ci_helper.rb +1 -1
  90. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/configure_helper.rb +2 -2
  91. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/encryption_helper.rb +1 -1
  92. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/github_helper.rb +4 -6
  93. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/glotpress_helper.rb +79 -0
  94. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_adc_app_sizes_helper.rb +3 -3
  95. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_l10n_helper.rb +3 -4
  96. data/lib/fastlane/plugin/wpmreleasetoolkit/helper/metadata_update_helper.rb +1 -1
  97. data/lib/fastlane/plugin/wpmreleasetoolkit/models/configuration.rb +2 -2
  98. data/lib/fastlane/plugin/wpmreleasetoolkit/version.rb +1 -1
  99. metadata +45 -15
@@ -21,7 +21,7 @@ module Fastlane
21
21
 
22
22
  UI.message("Merging in: #{strings_folder}")
23
23
 
24
- tmp_main_file = main_file + '.tmp'
24
+ tmp_main_file = "#{main_file}.tmp"
25
25
  FileUtils.cp(main_file, tmp_main_file)
26
26
 
27
27
  join_files = Dir.glob(File.join(strings_folder, 'strings-*.xml'))
@@ -2,13 +2,15 @@ module Fastlane
2
2
  module Actions
3
3
  class AndroidTagBuildAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/android/android_version_helper.rb'
6
- require_relative '../../helper/android/android_git_helper.rb'
5
+ require_relative '../../helper/android/android_version_helper'
6
+ require_relative '../../helper/android/android_git_helper'
7
7
 
8
- release_ver = Fastlane::Helper::Android::VersionHelper.get_release_version()
9
- alpha_ver = Fastlane::Helper::Android::VersionHelper.get_alpha_version() unless ENV['HAS_ALPHA_VERSION'].nil?
8
+ app = ENV['PROJECT_NAME'].nil? ? params[:app] : ENV['PROJECT_NAME']
9
+
10
+ release_ver = Fastlane::Helper::Android::VersionHelper.get_release_version(product_name: app)
11
+ alpha_ver = Fastlane::Helper::Android::VersionHelper.get_alpha_version(app)
10
12
  Fastlane::Helper::GitHelper.create_tag(release_ver[Fastlane::Helper::Android::VersionHelper::VERSION_NAME])
11
- Fastlane::Helper::GitHelper.create_tag(alpha_ver[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]) unless ENV['HAS_ALPHA_VERSION'].nil? || (params[:tag_alpha] == false)
13
+ Fastlane::Helper::GitHelper.create_tag(alpha_ver[Fastlane::Helper::Android::VersionHelper::VERSION_NAME]) unless alpha_ver.nil? || (params[:tag_alpha] == false)
12
14
  end
13
15
 
14
16
  #####################################################
@@ -30,6 +32,10 @@ module Fastlane
30
32
  description: 'True to skip tagging the alpha version',
31
33
  is_string: false,
32
34
  default_value: true),
35
+ FastlaneCore::ConfigItem.new(key: :app,
36
+ env_name: 'PROJECT_NAME',
37
+ description: 'The name of the app to get the release version for',
38
+ is_string: true), # true: verifies the input is a string, false: every kind of value
33
39
  ]
34
40
  end
35
41
 
@@ -6,7 +6,7 @@ module Fastlane
6
6
 
7
7
  class AndroidUpdateMetadataAction < Action
8
8
  def self.run(params)
9
- require_relative '../../helper/android/android_git_helper.rb'
9
+ require_relative '../../helper/android/android_git_helper'
10
10
 
11
11
  Fastlane::Helper::Android::GitHelper.update_metadata(ENV['validate_translations'])
12
12
  end
@@ -4,9 +4,9 @@ module Fastlane
4
4
  def self.run(params)
5
5
  UI.message 'Updating the release notes...'
6
6
 
7
- require_relative '../../helper/android/android_version_helper.rb'
8
- require_relative '../../helper/release_notes_helper.rb'
9
- require_relative '../../helper/git_helper.rb'
7
+ require_relative '../../helper/android/android_version_helper'
8
+ require_relative '../../helper/release_notes_helper'
9
+ require_relative '../../helper/git_helper'
10
10
 
11
11
  path = File.join(ENV['PROJECT_ROOT_FOLDER'] || '.', 'RELEASE-NOTES.txt')
12
12
  next_version = Fastlane::Helper::Android::VersionHelper.calc_next_release_short_version(params[:new_version])
@@ -0,0 +1,99 @@
1
+ require 'fastlane/action'
2
+ require 'rubygems/command_manager'
3
+
4
+ module Fastlane
5
+ module Actions
6
+ class CheckForToolkitUpdatesAction < Action
7
+ TOOLKIT_SPEC_NAME = 'fastlane-plugin-wpmreleasetoolkit'.freeze
8
+
9
+ def self.run(params)
10
+ updater = Gem::CommandManager.instance[:update]
11
+ installed_gems = updater.highest_installed_gems.select { |spec| spec == TOOLKIT_SPEC_NAME }
12
+ local_version = Gem::Version.new(installed_gems[TOOLKIT_SPEC_NAME].version)
13
+ UI.message("Currently using release toolkit version #{local_version.to_s.yellow}.")
14
+ UI.message('Checking for updates now...')
15
+ updates_needed = updater.which_to_update(installed_gems, [TOOLKIT_SPEC_NAME])
16
+
17
+ if updates_needed.empty?
18
+ UI.success('Your release toolkit is up-to-date! ✅')
19
+ return nil
20
+ end
21
+
22
+ # Return type of which_to_update differs before/after RubyGems 3.1.0, so normalize to always use Gem::NameTuple
23
+ updates_needed = Gem::NameTuple.from_list(updates_needed)
24
+ latest_version = updates_needed.find { |gem_info| gem_info.name == TOOLKIT_SPEC_NAME }.version
25
+
26
+ UI.message(['There is a newest version '.yellow, latest_version.to_s.red, ' of the release toolkit!'.yellow].join)
27
+ warn_on_breaking_update(local_version, latest_version)
28
+
29
+ return latest_version if params[:skip_update_suggestion] || !UI.confirm('Do you want to run bundle update now?')
30
+
31
+ sh('bundle', 'update', TOOLKIT_SPEC_NAME)
32
+ UI.abort_with_message! <<~UPDATE_MESSAGE
33
+ #{TOOLKIT_SPEC_NAME} have been updated. Please check and commit the changes in your Gemfile.lock file,
34
+ then restart your previous invocation of fastlane to use the new toolkit.
35
+ UPDATE_MESSAGE
36
+ end
37
+
38
+ def self.warn_on_breaking_update(current_version, latest_version)
39
+ current_semver_requirement = Gem::Requirement.new(current_version.approximate_recommendation)
40
+ compatible_update = current_semver_requirement.satisfied_by?(latest_version)
41
+ return if compatible_update
42
+
43
+ new_semver_requirement = latest_version.approximate_recommendation
44
+ UI.important <<~BREAKING_CHANGE_MESSAGE
45
+ The latest version available (#{latest_version}) introduces breaking changes compared to the #{current_version} you are currently using.
46
+
47
+ - To update to #{latest_version}, first edit your \`Pluginfile\` to use '#{new_semver_requirement}', run \`bundle update\`,
48
+ then be sure to make all the necessary changes to your \`Fastfile\` (see the toolkit's CHANGELOG)
49
+ to take those breaking changes into account.
50
+
51
+ - If you are not ready to make the major version bump, you can still try to update to the latest compatible,
52
+ non-breaking version by running \`bundle update\` now. This will not update to the latest #{latest_version}, but
53
+ might still update to a newer version compatible with '#{current_semver_requirement}' if one exists; which is still valuable
54
+ to at least get bugfixes, until you are ready to jump to the next major version later.
55
+ BREAKING_CHANGE_MESSAGE
56
+ end
57
+
58
+ def self.description
59
+ 'Check that we are on the latest version of the release toolkit, and propose to update if not'
60
+ end
61
+
62
+ def self.authors
63
+ ['Olivier Halligon']
64
+ end
65
+
66
+ def self.return_value
67
+ 'Returns the latest version of the toolkit available if your toolkit is not up-to-date, or nil if you are already up-to-date.'
68
+ end
69
+
70
+ def self.details
71
+ <<~DETAILS
72
+ Check that we are on the latest version of the release toolkit, and propose to update if not.
73
+
74
+ This action will check if you are on the *latest* version, regardless of the version requirement restriction you might have
75
+ set in your Gemfile/Pluginfile; which means that even if you agree to the prompt suggesting you to run bundle update, it might not
76
+ actually end up updating to the *latest* version automatically (esp. if the latest introduces breaking changes).
77
+
78
+ Note that if it finds an update and you then agree to the prompt and run bundle update, the action will abort your fastlane invocation
79
+ after running bundle update. This will let you check and commit the changes, before restarting the lane by re-invoking fastlane.
80
+ This is also needed to ensure fastlane loads the new toolkit version after update on second run.
81
+ DETAILS
82
+ end
83
+
84
+ def self.available_options
85
+ [
86
+ FastlaneCore::ConfigItem.new(key: :skip_update_suggestion,
87
+ env_name: 'CHECK_FOR_TOOLKIT_UPDATES_SKIP_UPDATE_SUGGESTION',
88
+ description: 'If true, will still check for new versions, but will not ask if you want to run bundle update if an update is found',
89
+ is_string: false, # Boolean
90
+ default_value: false),
91
+ ]
92
+ end
93
+
94
+ def self.is_supported?(platform)
95
+ true
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,147 @@
1
+ module Fastlane
2
+ module Actions
3
+ class CheckTranslationProgressAction < Action
4
+ def self.run(params)
5
+ require_relative '../../helper/glotpress_helper'
6
+
7
+ UI.message('Checking translations status...')
8
+
9
+ under_threshold_langs = check_translations(
10
+ glotpress_url: params[:glotpress_url],
11
+ language_codes: params[:language_codes],
12
+ abort_on_violations: params[:abort_on_violations],
13
+ threshold: params[:min_acceptable_translation_percentage]
14
+ )
15
+
16
+ unless under_threshold_langs.empty?
17
+ check_results(
18
+ under_threshold_langs: under_threshold_langs,
19
+ threshold: params[:min_acceptable_translation_percentage],
20
+ skip_confirm: params[:skip_confirm]
21
+ )
22
+ end
23
+
24
+ UI.success('Done')
25
+ end
26
+
27
+ # Check the status of the translations and returns the list of violations
28
+ #
29
+ # @param [String] URL to the GlotPress project.
30
+ # @param [String] The list of codes (in GlotPress format) of the languages to check.
31
+ # @param [Bool] Whether to abort on the first found violation or not.
32
+ # @param [Integer] The minimum acceptable percentage of translated strings.
33
+ #
34
+ # @return [Array] The list of violations (array of hashes of "language code" and "current percentage")
35
+ #
36
+ def self.check_translations(glotpress_url:, language_codes:, abort_on_violations:, threshold:)
37
+ under_threshold_langs = []
38
+
39
+ data = begin
40
+ Fastlane::Helper::GlotPressHelper.get_translation_status_data(glotpress_url: glotpress_url)
41
+ rescue StandardError
42
+ nil
43
+ end
44
+ UI.abort_with_message!("Can't retrieve data from #{glotpress_url}") if data.nil? || data.empty?
45
+
46
+ language_codes.each do |language_code|
47
+ UI.message("> Getting translation status for #{language_code}")
48
+ progress = begin
49
+ Fastlane::Helper::GlotPressHelper.get_translation_status(
50
+ data: data,
51
+ language_code: language_code
52
+ )
53
+ rescue StandardError
54
+ -1
55
+ end
56
+
57
+ if abort_on_violations
58
+ UI.abort_with_message!("Can't get data for language #{language_code}") if progress == -1
59
+ UI.abort_with_message!("#{language_code} is translated #{progress}% which is under the required #{threshold}%.") if progress < threshold
60
+ end
61
+
62
+ UI.message("Language #{language_code} is #{progress}% translated.")
63
+ under_threshold_langs.push({ lang: language_code, progress: progress }) if progress < threshold
64
+ end
65
+
66
+ under_threshold_langs
67
+ end
68
+
69
+ # Report the status of the translations and verify whether to abort or not
70
+ #
71
+ # @param [Array] The list of violations (array of hashes of "language code" and "current percentage")
72
+ # @param [Integer] The minimum acceptable percentage of translated strings.
73
+ # @param [Bool] If true, continue after the report without asking the user.
74
+ #
75
+ def self.check_results(under_threshold_langs:, threshold:, skip_confirm:)
76
+ message = "The translations for the following languages are below the #{threshold}% threshold:\n"
77
+
78
+ under_threshold_langs.each do |lang|
79
+ message << " - #{lang[:lang]} is at #{lang[:progress]}%.\n"
80
+ end
81
+
82
+ if skip_confirm
83
+ UI.important(message)
84
+ elsif UI.interactive?
85
+ UI.abort_with_message!('Aborted by user!') unless UI.confirm("#{message}Do you want to continue?")
86
+ else
87
+ UI.abort_with_message!(message)
88
+ end
89
+ end
90
+
91
+ #####################################################
92
+ # @!group Documentation
93
+ #####################################################
94
+
95
+ def self.description
96
+ 'Raises an error if the translation percentage is lower than the provided threshold'
97
+ end
98
+
99
+ def self.details
100
+ 'This actions checks the current status of the translations on GlotPress ' \
101
+ 'and raises an error if it\'s below the provided threshold'
102
+ end
103
+
104
+ def self.available_options
105
+ [
106
+ FastlaneCore::ConfigItem.new(key: :glotpress_url,
107
+ env_name: 'FL_CHECK_TRANSLATION_PROGRESS_GLOTPRESS_URL',
108
+ description: 'URL to the GlotPress project',
109
+ type: String),
110
+ FastlaneCore::ConfigItem.new(key: :language_codes,
111
+ env_name: 'FL_CHECK_TRANSLATION_PROGRESS_LANGUAGE_CODES',
112
+ description: 'The list of the codes of the languages to check',
113
+ type: Array,
114
+ optional: true,
115
+ # Default to Mag16.
116
+ default_value: 'ar de es fr he id it ja ko nl pt-br ru sv tr zh-cn zh-tw'.split()),
117
+ FastlaneCore::ConfigItem.new(key: :min_acceptable_translation_percentage,
118
+ env_name: 'FL_CHECK_TRANSLATION_PROGRESS_MIN_ACCEPTABLE_TRANSLATION_PERCENTAGE',
119
+ description: 'The threshold under which an error is raised',
120
+ type: Integer,
121
+ optional: true,
122
+ default_value: 100),
123
+ FastlaneCore::ConfigItem.new(key: :abort_on_violations,
124
+ env_name: 'FL_CHECK_TRANSLATION_ABORT_ON_VIOLATIONS',
125
+ description: 'Should we abort with a global error if any violations are found?',
126
+ optional: true,
127
+ default_value: true,
128
+ is_string: false),
129
+ FastlaneCore::ConfigItem.new(key: :skip_confirm,
130
+ env_name: 'FL_CHECK_TRANSLATION_SKIP_CONFIRM',
131
+ description: 'Move ahead without requesting confirmation if violations are found. Only works if "abort_on_violations" is disabled',
132
+ optional: true,
133
+ default_value: false,
134
+ is_string: false),
135
+ ]
136
+ end
137
+
138
+ def self.authors
139
+ ['loremattei']
140
+ end
141
+
142
+ def self.is_supported?(platform)
143
+ true
144
+ end
145
+ end
146
+ end
147
+ end
@@ -2,7 +2,7 @@ module Fastlane
2
2
  module Actions
3
3
  class CircleciTriggerJobAction < Action
4
4
  def self.run(params)
5
- require_relative '../../helper/ci_helper.rb'
5
+ require_relative '../../helper/ci_helper'
6
6
 
7
7
  UI.message "Triggering job #{params[:job_params]} on branch #{params[:branch]}"
8
8
 
@@ -1,5 +1,5 @@
1
1
  require 'fastlane/action'
2
- require_relative '../../helper/metadata_download_helper.rb'
2
+ require_relative '../../helper/metadata_download_helper'
3
3
 
4
4
  module Fastlane
5
5
  module Actions
@@ -1,5 +1,5 @@
1
1
  require 'fastlane/action'
2
- require_relative '../../helper/metadata_update_helper.rb'
2
+ require_relative '../../helper/metadata_update_helper'
3
3
 
4
4
  module Fastlane
5
5
  module Actions
@@ -23,7 +23,7 @@ module Fastlane
23
23
  # Verifies that all the source files are available
24
24
  # to this action
25
25
  def self.check_source_files(source_files)
26
- source_files.values.each do |file_path|
26
+ source_files.each_value do |file_path|
27
27
  UI.user_error!("Couldn't find file at path '#{file_path}'") unless File.exist?(file_path)
28
28
  end
29
29
  end
@@ -75,9 +75,10 @@ module Fastlane
75
75
 
76
76
  # Init special handlers
77
77
  block_files.each do |key, file_path|
78
- if key == :release_note
78
+ case key
79
+ when :release_note
79
80
  @blocks.push Fastlane::Helper::ReleaseNoteMetadataBlock.new(key, file_path, release_version)
80
- elsif key == :whats_new
81
+ when :whats_new
81
82
  @blocks.push Fastlane::Helper::WhatsNewMetadataBlock.new(key, file_path, release_version)
82
83
  else
83
84
  @blocks.push Fastlane::Helper::StandardMetadataBlock.new(key, file_path)
@@ -91,7 +92,7 @@ module Fastlane
91
92
  # Manages tags depending on the type
92
93
  def self.write_target_block(fw, line)
93
94
  if is_block_id(line)
94
- key = line.split(' ')[1].tr('\"', '')
95
+ key = line.split[1].tr('\"', '')
95
96
  @blocks.each do |block|
96
97
  @current_block = block if block.is_handler_for(key)
97
98
  end
@@ -1,7 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'fastlane/action'
3
3
  require 'active_support/all'
4
- require_relative '../../helper/promo_screenshots_helper.rb'
4
+ require_relative '../../helper/promo_screenshots_helper'
5
5
 
6
6
  module Fastlane
7
7
  module Actions
@@ -43,7 +43,7 @@ module Fastlane
43
43
 
44
44
  # Create a hash of devices, keyed by device name
45
45
  devices = config['devices']
46
- devices = Hash[devices.map { |device| device['name'] }.zip(devices)]
46
+ devices = devices.map { |device| device['name'] }.zip(devices).to_h
47
47
 
48
48
  stylesheet_path = config['stylesheet']
49
49
 
@@ -9,10 +9,10 @@ module Fastlane
9
9
  branch_name = params[:branch]
10
10
  branch_prot = {}
11
11
 
12
- branch_url = "https://api.github.com/repos/#{repository}/branches/" + branch_name
13
- branch_prot[:restrictions] = { url: branch_url + '/protection/restrictions', users_url: branch_url + '/protection/restrictions/users', teams_url: branch_url + '/protection/restrictions/teams', users: [], teams: [] }
12
+ branch_url = "https://api.github.com/repos/#{repository}/branches/#{branch_name}"
13
+ branch_prot[:restrictions] = { url: "#{branch_url}/protection/restrictions", users_url: "#{branch_url}/protection/restrictions/users", teams_url: "#{branch_url}/protection/restrictions/teams", users: [], teams: [] }
14
14
  branch_prot[:enforce_admins] = nil
15
- branch_prot[:required_pull_request_reviews] = { url: branch_url + '/protection/required_pull_request_reviews', dismiss_stale_reviews: false, require_code_owner_reviews: false }
15
+ branch_prot[:required_pull_request_reviews] = { url: "#{branch_url}/protection/required_pull_request_reviews", dismiss_stale_reviews: false, require_code_owner_reviews: false }
16
16
 
17
17
  Fastlane::Helper::GithubHelper.github_client().unprotect_branch(repository, branch_name, branch_prot)
18
18
  end
@@ -9,10 +9,10 @@ module Fastlane
9
9
  branch_name = params[:branch]
10
10
  branch_prot = {}
11
11
 
12
- branch_url = "https://api.github.com/repos/#{repository}/branches/" + branch_name
13
- branch_prot[:restrictions] = { url: branch_url + '/protection/restrictions', users_url: branch_url + '/protection/restrictions/users', teams_url: branch_url + '/protection/restrictions/teams', users: [], teams: [] }
12
+ branch_url = "https://api.github.com/repos/#{repository}/branches/#{branch_name}"
13
+ branch_prot[:restrictions] = { url: "#{branch_url}/protection/restrictions", users_url: "#{branch_url}/protection/restrictions/users", teams_url: "#{branch_url}/protection/restrictions/teams", users: [], teams: [] }
14
14
  branch_prot[:enforce_admins] = nil
15
- branch_prot[:required_pull_request_reviews] = { url: branch_url + '/protection/required_pull_request_reviews', dismiss_stale_reviews: false, require_code_owner_reviews: false }
15
+ branch_prot[:required_pull_request_reviews] = { url: "#{branch_url}/protection/required_pull_request_reviews", dismiss_stale_reviews: false, require_code_owner_reviews: false }
16
16
  Fastlane::Helper::GithubHelper.github_client().protect_branch(repository, branch_name, branch_prot)
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ module Fastlane
21
21
  return # Already frozen: nothing to do
22
22
  end
23
23
 
24
- mile_title = mile_title + ' ❄️'
24
+ mile_title = "#{mile_title} ❄️"
25
25
  else
26
26
  mile_title = milestone_title
27
27
  end
@@ -5,8 +5,8 @@ module Fastlane
5
5
  UI.message "Skip confirm: #{params[:skip_confirm]}"
6
6
  UI.message "Work on version: #{params[:base_version]}" unless params[:base_version].nil?
7
7
 
8
- require_relative '../../helper/ios/ios_version_helper.rb'
9
- require_relative '../../helper/ios/ios_git_helper.rb'
8
+ require_relative '../../helper/ios/ios_version_helper'
9
+ require_relative '../../helper/ios/ios_git_helper'
10
10
 
11
11
  # Checkout develop and update
12
12
  Fastlane::Helper::GitHelper.checkout_and_pull('develop')
@@ -25,10 +25,10 @@ module Fastlane
25
25
 
26
26
  # Verify
27
27
  message << "Updating branch to version: #{next_version}.\n"
28
- if !params[:skip_confirm]
29
- UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
30
- else
28
+ if params[:skip_confirm]
31
29
  UI.message(message)
30
+ else
31
+ UI.user_error!('Aborted by user request') unless UI.confirm("#{message}Do you want to continue?")
32
32
  end
33
33
 
34
34
  # Check local repo status