[devicelab] measure entire release folder size, zipped (#115612)
* [devicelab] measure entire release folder size, zipped * [devicelab] tar with more settings * super safe reland * Update perf_tests.dart
This commit is contained in:
parent
450f16245b
commit
0b33b85928
@ -1513,19 +1513,29 @@ class CompileTest {
|
|||||||
watch.start();
|
watch.start();
|
||||||
await flutter('build', options: options);
|
await flutter('build', options: options);
|
||||||
watch.stop();
|
watch.stop();
|
||||||
final String basename = path.basename(cwd);
|
final String buildPath = path.join(
|
||||||
final String exePath = path.join(
|
|
||||||
cwd,
|
cwd,
|
||||||
'build',
|
'build',
|
||||||
'windows',
|
'windows',
|
||||||
'runner',
|
'runner',
|
||||||
'release',
|
'release',
|
||||||
'$basename.exe');
|
);
|
||||||
final File exe = file(exePath);
|
|
||||||
// On Windows, we do not produce a single installation package file,
|
// On Windows, we do not produce a single installation package file,
|
||||||
// rather a directory containing an .exe and .dll files.
|
// rather a directory containing an .exe and .dll files. Zip them all
|
||||||
// The release size is set to the size of the produced .exe file
|
// together to get an approximate release size.
|
||||||
releaseSizeInBytes = exe.lengthSync();
|
final int result = await exec('tar.exe', <String>['-zcf', 'build/app.tar.gz', '"$buildPath"']);
|
||||||
|
if (result == 0) {
|
||||||
|
final File outputFile = file('build/app.tar.gz');
|
||||||
|
if (outputFile.existsSync()) {
|
||||||
|
releaseSizeInBytes = outputFile.lengthSync();
|
||||||
|
} else {
|
||||||
|
print('tar completed successfully, but ${outputFile.path} does not exist!');
|
||||||
|
releaseSizeInBytes = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print('Failed to run tar.exe: $result');
|
||||||
|
releaseSizeInBytes = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user