Skip to content

Commit 9c2d45b

Browse files
authored
Merge pull request #327 from wordpress-mobile/yard/misc-doc
Comment some functions a bit more #trivial
2 parents 6cde866 + 575ee61 commit 9c2d45b

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

lib/fastlane/plugin/wpmreleasetoolkit/actions/android/an_localize_libs_action.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,17 @@ def self.available_options
3636
FastlaneCore::ConfigItem.new(key: :app_strings_path,
3737
description: 'The path of the main strings file',
3838
optional: false,
39-
is_string: true),
39+
type: String),
40+
# The name of this parameter is a bit misleading due to legacy. In practice it's expected to be an Array of Hashes, each describing a library to merge.
41+
# See `Fastlane::Helper::Android::LocalizeHelper.merge_lib`'s YARD doc for more details on the keys expected for each Hash.
4042
FastlaneCore::ConfigItem.new(key: :libs_strings_path,
4143
env_name: 'LOCALIZE_LIBS_STRINGS_PATH',
42-
description: 'The list of libs to merge',
44+
description: 'The list of libs to merge. ' \
45+
+ 'Each item in the provided array must be a Hash with the keys `:library` (The library display name),' \
46+
+ '`:strings_path` (The path to the `strings.xml` file of the library) and ' \
47+
+ '`:exclusions` (Array of string keys to exclude from merging)',
4348
optional: false,
44-
is_string: false),
49+
type: Array),
4550
]
4651
end
4752

lib/fastlane/plugin/wpmreleasetoolkit/actions/common/gp_downloadmetadata_action.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def self.available_options
5858
is_string: false),
5959
FastlaneCore::ConfigItem.new(key: :locales,
6060
env_name: 'FL_DOWNLOAD_METADATA_LOCALES',
61-
description: 'The hash with the GLotPress locale and the project locale association',
61+
description: 'The hash with the GlotPress locale and the project locale association',
6262
is_string: false),
6363
FastlaneCore::ConfigItem.new(key: :source_locale,
6464
env_name: 'FL_DOWNLOAD_METADATA_SOURCE_LOCALE',

lib/fastlane/plugin/wpmreleasetoolkit/helper/android/android_localize_helper.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ def self.verify_string(main_strings, library, string_line)
9292
UI.user_error!("String #{string_name} [#{string_content}] was found in library #{library[:library]} but not in the main file.")
9393
end
9494

95+
# Merge strings from a library into the strings.xml of the main app
96+
#
97+
# @param [String] main Path to the main strings.xml file (something like `…/res/values/strings.xml`)
98+
# @param [Hash] library Hash describing the library to merge. The Hash should contain the following keys:
99+
# - `:library`: The human readable name of the library, used to display in console messages
100+
# - `:strings_path`: The path to the strings.xml file of the library to merge into the main one
101+
# - `:exclusions`: An array of strings keys to exclude during merge. Any of those keys from the library's `strings.xml` will be skipped and won't be merged into the main one.
102+
# @return [Boolean] True if at least one string from the library has been added to (or has updated) the main strings file.
95103
def self.merge_lib(main, library)
96104
UI.message("Merging #{library[:library]} strings into #{main}")
97105
main_strings = File.open(main) { |f| Nokogiri::XML(f, nil, Encoding::UTF_8.to_s) }

lib/fastlane/plugin/wpmreleasetoolkit/helper/ios/ios_git_helper.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ def self.commit_version_bump(include_deliverfile: true, include_metadata: true)
3535
# @env PROJECT_ROOT_FOLDER The path to the git root of the project
3636
# @env PROJECT_NAME The name of the directory containing the project code (especially containing the `build.gradle` file)
3737
#
38-
# @todo Migrate the scripts, currently in each host repo and called by this method, to be helpers and actions
39-
# in the release-toolkit instead, and move this code away from `ios_git_helper`.
38+
# @deprecated This method is only used by the `ios_localize_project` action, which is itself deprecated
39+
# in favor of the new `ios_generate_strings_file_from_code` action
40+
# @todo [Next Major] Remove this method once we fully remove `ios_localize_project`
4041
#
4142
def self.localize_project
4243
Action.sh("cd #{get_from_env!(key: 'PROJECT_ROOT_FOLDER')} && ./Scripts/localize.py")

0 commit comments

Comments
 (0)