flutter/packages/flutter_tools/test
Tae Hyung Kim 5c44b1df0f
Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present or not present (#125429)
I think this is a long needed change to the `gen-l10n` command.
Essentially, the arguments to `flutter gen-l10n` can be provided by two
different methods: via command line arguments or via the `l10n.yaml`
file. The existence of a `l10n.yaml` file causes the latter approach to
take precedence.

However, currently, there's several differences in how the two
approaches are handled, and most of the default arguments are all over
the place, causing unexpected issues such as #120457 or #120023.

This PR refactors the command so that
* `LocalizationOptions` are more consistent with the actual argument
names/yaml options.
* All default values are determined in `LocalizationOptions`'s
constructor (or in `argParser.addOption(...)` in the case a boolean
value needs to be explicitly true).
* New `parseLocalizationsOptionsFromCommand` function to parse
arguments.
* Parse `LocalizationOptions` at the beginning of `runCommand()` and
pass it to `generateLocalizations`.

Fixes #120023.
2023-04-26 11:49:25 -07:00
..
commands.shard Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present or not present (#125429) 2023-04-26 11:49:25 -07:00
data Bump lower Dart SDK constraints to 3.0 & add class modifiers (#122546) 2023-03-21 20:21:58 +00:00
general.shard Refactor "gen-l10n" command to use same code path when "l10n.yaml" is present or not present (#125429) 2023-04-26 11:49:25 -07:00
host_cross_arch.shard flutter-tool: enum cleanup (#124760) 2023-04-14 01:55:05 +00:00
integration.shard [flutter_tools] make overall_experience_test resilient to extraneous pub output (#125172) 2023-04-20 17:31:58 +00:00
src Remove uses of deprecated test_api imports (#124732) 2023-04-20 20:55:28 +00:00
web.shard Add vmservice for android build options (#123034) 2023-04-18 18:16:09 +00:00