Commit Graph

20 Commits

Author SHA1 Message Date
Alex Li
f2db93df01
🐛 Treat empty ARB content as empty map when decoding (#131242)
Fixes #128932.
2023-08-01 01:27:54 +00:00
Tae Hyung Kim
d75735eea6
Use platform specific line separator in gen-l10n (#130090)
Currently files are not generated with `\r\n` in windows. This PR should
fix the issue.

Fixes https://github.com/flutter/flutter/issues/109761.
2023-07-12 12:50:53 -07:00
Tae Hyung Kim
dabd7b3bb5
Throw error on unexpected positional arguments (#130274)
This PR fixes ignoring when random positional arguments added to the
`flutter gen-l10n`.

So we are no longer able to call `flutter gen-l10n hello world` or
`flutter gen-l10n --format false`.

Fixes https://github.com/flutter/flutter/issues/118203
2023-07-10 12:12:23 -07:00
Tae Hyung Kim
5596a0cdab
Fix gen-l10n format: true so that it applies to when it gets called via build target (#127886) 2023-05-31 15:25:54 -07:00
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
Tae Hyung Kim
b6c7df447d
l10n.yaml's nullable-getter option should default to true (#124353)
Currently, nullable-getter defaults to false when l10n.yaml is not present, which is not the same behavior as when an l10n.yaml file is present and nullable-getter is not set.

Fixes #120457.
2023-04-18 18:42:07 +00:00
Alex Li
4ae2d3b6df
🔥 Do not format the messages file for gen-l10n (#119596)
* 🔥 Do not format the messages file

*  Add test

*  Add the link to the test

*  Respect the path separator from the file system

*  Add the untranslated messages file existence test
2023-02-01 23:45:38 +00:00
Jackson Gardner
db1c3e208d
Platform binaries reland (#115502)
You can now specify a --local-web-sdk flag to point to a wasm_release folder. This will make it so that only artifacts that pertain to the web sdk are overridden to point to the wasm_release folder. Other artifacts (such as impellerc) will pull from the cache, or from the --local-engine path if that is specified.

This also uses precompiled platform kernel files for both ddc and dart2js
2022-12-02 14:13:40 -08:00
Liam Appelbe
22cef4898a
Null safety migration of packages/flutter_tools/test/commands.shard/hermetic, part 2/3 (#110708)
* Migrate packages/flutter_tools/test/commands.shard/hermetic, part 2/3

* Fix tests

* Fix analysis

* Chris's comments
2022-09-06 10:39:18 -07:00
Tae Hyung Kim
646666f8e7
[gen_l10n] Add option to format generated localizations files (#109171)
* init

* fix

* fix 2

* fix 3

* tests

* fix tests

* clarify help text

* fix all tests

* fix formatting?

* add second test

* unused import

* remove print

* trailing spaces

* artifacts is never null

* fix
2022-08-19 14:03:42 -07:00
Taha Tesser
d6d3283c8d
Fix flutter gen-l10n help message (#98147) 2022-02-11 01:40:14 -08:00
Jonah Williams
def601ac17
[flutter_tools] re-enable all tests on windows (#85384) 2021-06-27 05:26:02 -07:00
Alexandre Ardhuin
7d46d43635
use throwsXxx instead of throwsA(isA<Xxx>()) (#82328) 2021-05-12 09:59:02 -07:00
Sam Rawlins
133a55ae51
Remove "unnecessary" imports. (#81003) 2021-05-06 16:19:07 -07:00
Phil Quitslund
61c30c41b2
fix sort_directives violations (#80817) 2021-04-21 13:49:03 -07:00
Jenn Magder
a2f67720ef
Migrate test/src/common to null safety (#79907) 2021-04-06 22:55:03 -07:00
Jonah Williams
74bd7b6f6d
[flutter_tools] opt all flutter tool libraries and tests out of null safety. (#74832)
* opt out the flutter tool

* oops EOF

* fix import

* Update tool_backend.dart

* Update daemon_client.dart

* fix more
2021-01-27 15:17:53 -08:00
Shi-Hao Hong
a912030982
[gen_l10n] Use l10n.yaml file instead of command line arguments if it exists (#72950)
* Reorganize files

* Use l10n.yaml instead of command line args
2021-01-05 11:50:32 +08:00
Alexandre Ardhuin
73301a35a2
Sync lints (#68136) 2020-10-15 15:37:04 -07:00
Shi-Hao Hong
b80b432555
Move gen_l10n into flutter_tools (#65025) 2020-09-03 09:26:58 -07:00