forked from firka/flutter
[flutter_tools] Avoid duplicated calls to l10n generation (#76066)
This commit is contained in:
@@ -37,15 +37,9 @@ Future<void> generateLocalizationsSyntheticPackage({
|
||||
);
|
||||
}
|
||||
|
||||
BuildResult result;
|
||||
// If an l10n.yaml file exists but is empty, attempt to build synthetic
|
||||
// package with default settings.
|
||||
if (yamlNode.value == null) {
|
||||
result = await buildSystem.build(
|
||||
const GenerateLocalizationsTarget(),
|
||||
environment,
|
||||
);
|
||||
} else {
|
||||
// If an l10n.yaml file exists and is not empty, attempt to parse settings in
|
||||
// it.
|
||||
if (yamlNode.value != null) {
|
||||
final YamlMap yamlMap = yamlNode as YamlMap;
|
||||
final Object value = yamlMap['synthetic-package'];
|
||||
if (value is! bool && value != null) {
|
||||
@@ -63,7 +57,7 @@ Future<void> generateLocalizationsSyntheticPackage({
|
||||
}
|
||||
}
|
||||
|
||||
result = await buildSystem.build(
|
||||
final BuildResult result = await buildSystem.build(
|
||||
const GenerateLocalizationsTarget(),
|
||||
environment,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user