move where the mega_gallery benchmark code is generated by default (#20157)

* move where the mega_gallery benchmark code is generated by default

* generate into a temporary diectory
This commit is contained in:
Devon Carew
2018-08-06 09:26:32 -07:00
committed by GitHub
parent 81458c7925
commit 53bd0e20da
2 changed files with 29 additions and 11 deletions

View File

@@ -189,14 +189,27 @@ Future<Null> _analyzeRepo() async {
await _checkForTrailingSpaces();
// Try an analysis against a big version of the gallery.
await _runCommand(dart,
<String>['--preview-dart-2', path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart')],
workingDirectory: flutterRoot,
);
await _runFlutterAnalyze(path.join(flutterRoot, 'dev', 'benchmarks', 'mega_gallery'),
options: <String>['--watch', '--benchmark'],
);
// Try analysis against a big version of the gallery; generate into a temporary directory.
final String outDir = Directory.systemTemp.createTempSync('mega_gallery').path;
try {
await _runCommand(dart,
<String>[
'--preview-dart-2',
path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart'),
'--out',
outDir,
],
workingDirectory: flutterRoot,
);
await _runFlutterAnalyze(outDir, options: <String>['--watch', '--benchmark']);
} finally {
try {
new Directory(outDir).deleteSync(recursive: true);
} catch (e) {
// ignore
}
}
print('${bold}DONE: Analysis successful.$reset');
}