Skip to content

Commit 1e32c00

Browse files
authored
Remove synthetic package qualifier for flutter: generate: error. (#163145)
`generateLocalizations` should fail (`flutter gen-l10n`) if `flutter: generate:` does not exist. The previous logic was faulty, because it was totally possible to opt-out of synthetic packages (i.e. in a `l10n.yaml` file), but still not be specifying `flutter: generate:`, which I _believe_ is supposed to still be an error. This came up in flutter/flutter#160289 as `flutter config --explicit-package-dependencies` is enabled by default, as the error is no longer thrown. Made a few other small test forward-fixes that otherwise would break with the switch (but are expected) as well.
1 parent 063f80d commit 1e32c00

4 files changed

Lines changed: 220 additions & 142 deletions

File tree

dev/benchmarks/test_apps/stocks/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ dev_dependencies:
7878
yaml: 3.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
7979

8080
flutter:
81+
generate: true
8182
uses-material-design: true
8283

8384
# PUBSPEC CHECKSUM: 17a3

packages/flutter_tools/lib/src/localizations/gen_l10n.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ Future<LocalizationsGenerator> generateLocalizations({
3434
fileSystem: projectDir.fileSystem,
3535
logger: logger,
3636
);
37-
if (options.syntheticPackage &&
38-
(flutterManifest == null || !flutterManifest.generateLocalizations)) {
37+
if (flutterManifest == null || !flutterManifest.generateLocalizations) {
3938
throwToolExit(
4039
'Attempted to generate localizations code without having '
4140
'the flutter: generate flag turned on.'

0 commit comments

Comments
 (0)