@@ -152,6 +152,9 @@ Future<void> run(List<String> arguments) async {
152
152
printProgress ('Internationalization...' );
153
153
await verifyInternationalizations (flutterRoot, dart);
154
154
155
+ printProgress ('Localization files of stocks app...' );
156
+ await verifyStockAppLocalizations (flutterRoot);
157
+
155
158
printProgress ('Integration test timeouts...' );
156
159
await verifyIntegrationTestTimeouts (flutterRoot);
157
160
@@ -1312,6 +1315,49 @@ Future<void> verifyInternationalizations(String workingDirectory, String dartExe
1312
1315
}
1313
1316
}
1314
1317
1318
+ Future <void > verifyStockAppLocalizations (String workingDirectory) async {
1319
+ final Directory appRoot = Directory (
1320
+ path.join (workingDirectory, 'dev' , 'benchmarks' , 'test_apps' , 'stocks' ),
1321
+ );
1322
+ if (! appRoot.existsSync ()) {
1323
+ foundError (< String > ['Stocks app does not exist at expected location: ${appRoot .path }' ]);
1324
+ }
1325
+
1326
+ // Regenerate the localizations.
1327
+ final String flutterExecutable = path.join (
1328
+ workingDirectory,
1329
+ 'bin' ,
1330
+ 'flutter${Platform .isWindows ? '.bat' : '' }' ,
1331
+ );
1332
+ await _evalCommand (flutterExecutable, const < String > ['gen-l10n' ], workingDirectory: appRoot.path);
1333
+ final Directory i10nDirectory = Directory (path.join (appRoot.path, 'lib' , 'i18n' ));
1334
+ if (! i10nDirectory.existsSync ()) {
1335
+ foundError (< String > [
1336
+ 'Localization files for stocks app not found at expected location: ${i10nDirectory .path }' ,
1337
+ ]);
1338
+ }
1339
+
1340
+ // Check that regeneration did not dirty the tree.
1341
+ final EvalResult result = await _evalCommand ('git' , < String > [
1342
+ 'diff' ,
1343
+ '--name-only' ,
1344
+ '--exit-code' ,
1345
+ i10nDirectory.path,
1346
+ ], workingDirectory: workingDirectory);
1347
+ if (result.exitCode == 1 ) {
1348
+ foundError (< String > [
1349
+ 'The following localization files for the stocks app appear to be out of date:' ,
1350
+ ...(const LineSplitter ().convert (result.stdout).map ((String line) => ' * $line ' )),
1351
+ 'Run "flutter gen-l10n" in "${path .relative (appRoot .path , from : workingDirectory )}" to regenerate.' ,
1352
+ ]);
1353
+ } else if (result.exitCode != 0 ) {
1354
+ foundError (< String > [
1355
+ 'Failed to run "git diff" on localization files of stocks app:' ,
1356
+ result.stderr,
1357
+ ]);
1358
+ }
1359
+ }
1360
+
1315
1361
/// Verifies that all instances of "checked mode" have been migrated to "debug mode".
1316
1362
Future <void > verifyNoCheckedMode (String workingDirectory) async {
1317
1363
final String flutterPackages = path.join (workingDirectory, 'packages' );
0 commit comments