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:
parent
81458c7925
commit
53bd0e20da
@ -189,14 +189,27 @@ Future<Null> _analyzeRepo() async {
|
|||||||
|
|
||||||
await _checkForTrailingSpaces();
|
await _checkForTrailingSpaces();
|
||||||
|
|
||||||
// Try an analysis against a big version of the gallery.
|
// Try analysis against a big version of the gallery; generate into a temporary directory.
|
||||||
await _runCommand(dart,
|
final String outDir = Directory.systemTemp.createTempSync('mega_gallery').path;
|
||||||
<String>['--preview-dart-2', path.join(flutterRoot, 'dev', 'tools', 'mega_gallery.dart')],
|
|
||||||
workingDirectory: flutterRoot,
|
try {
|
||||||
);
|
await _runCommand(dart,
|
||||||
await _runFlutterAnalyze(path.join(flutterRoot, 'dev', 'benchmarks', 'mega_gallery'),
|
<String>[
|
||||||
options: <String>['--watch', '--benchmark'],
|
'--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');
|
print('${bold}DONE: Analysis successful.$reset');
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,7 @@ void main(List<String> args) {
|
|||||||
Directory.current = Directory.current.parent.parent;
|
Directory.current = Directory.current.parent.parent;
|
||||||
|
|
||||||
final ArgParser argParser = new ArgParser();
|
final ArgParser argParser = new ArgParser();
|
||||||
// ../mega_gallery? dev/benchmarks/mega_gallery?
|
argParser.addOption('out');
|
||||||
argParser.addOption('out', defaultsTo: _normalize('dev/benchmarks/mega_gallery'));
|
|
||||||
argParser.addOption('copies');
|
argParser.addOption('copies');
|
||||||
argParser.addFlag('delete', negatable: false);
|
argParser.addFlag('delete', negatable: false);
|
||||||
argParser.addFlag('help', abbr: 'h', negatable: false);
|
argParser.addFlag('help', abbr: 'h', negatable: false);
|
||||||
@ -45,6 +44,12 @@ void main(List<String> args) {
|
|||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!results.wasParsed('out')) {
|
||||||
|
print('The --out parameter is required.');
|
||||||
|
print(argParser.usage);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
int copies;
|
int copies;
|
||||||
if (!results.wasParsed('copies')) {
|
if (!results.wasParsed('copies')) {
|
||||||
final SourceStats stats = getStatsFor(_dir(source, 'lib'));
|
final SourceStats stats = getStatsFor(_dir(source, 'lib'));
|
||||||
@ -128,7 +133,7 @@ void _copyGallery(Directory galleryDir, int index) {
|
|||||||
|
|
||||||
void _copy(Directory source, Directory target) {
|
void _copy(Directory source, Directory target) {
|
||||||
if (!target.existsSync())
|
if (!target.existsSync())
|
||||||
target.createSync();
|
target.createSync(recursive: true);
|
||||||
|
|
||||||
for (FileSystemEntity entity in source.listSync(followLinks: false)) {
|
for (FileSystemEntity entity in source.listSync(followLinks: false)) {
|
||||||
final String name = path.basename(entity.path);
|
final String name = path.basename(entity.path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user