flutter/packages/flutter_tools/test/general.shard/build_system
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
..
targets 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
build_system_test.dart Enable avoid_redundant_argument_values lint (#91409) (#91462) 2021-10-08 09:25:14 -07:00
depfile_test.dart Fix typos (#121171) 2023-02-23 19:43:21 +00:00
exceptions_test.dart Remove globals_null_migrated.dart, move into globals.dart (#92861) 2021-11-01 17:18:03 -07:00
file_store_test.dart Cast config values to dynamic values instead of Object (#80011) 2021-04-08 15:18:28 -07:00
hash_test.dart Convert some general.shard base tests to null safety (#79985) 2021-04-08 14:55:19 -07:00
invalidated_reason_test.dart Migrate some flutter_tools tests to null safety (#88850) 2021-08-25 16:21:04 -07:00
source_test.dart [flutter_tools] migrate more unit tests to null safety (#106153) 2022-06-17 21:34:27 -07:00