Revert "[devicelab] measure entire release folder size, zipped (#115612)" (#115617)

This reverts commit 0b33b85928.
This commit is contained in:
Jonah Williams 2022-11-17 18:13:49 -08:00 committed by GitHub
parent 0b33b85928
commit 9379c3233c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1513,29 +1513,19 @@ class CompileTest {
watch.start();
await flutter('build', options: options);
watch.stop();
final String buildPath = path.join(
final String basename = path.basename(cwd);
final String exePath = path.join(
cwd,
'build',
'windows',
'runner',
'release',
);
'$basename.exe');
final File exe = file(exePath);
// On Windows, we do not produce a single installation package file,
// rather a directory containing an .exe and .dll files. Zip them all
// together to get an approximate release size.
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;
}
// rather a directory containing an .exe and .dll files.
// The release size is set to the size of the produced .exe file
releaseSizeInBytes = exe.lengthSync();
break;
}