Add full platform build speed instrumentations (#9162)
* Add new metric to size_tests instead * Small lints
This commit is contained in:
parent
0d402242c5
commit
4245bce545
@ -73,7 +73,7 @@ $specificMessage
|
|||||||
$_kProvisioningConfigFileEnvironmentVariable variable is not defined in your
|
$_kProvisioningConfigFileEnvironmentVariable variable is not defined in your
|
||||||
environment. Please, define it and try again.
|
environment. Please, define it and try again.
|
||||||
|
|
||||||
Example provisioining xcconfig:
|
Example provisioning xcconfig:
|
||||||
|
|
||||||
ProvisioningStyle=Manual
|
ProvisioningStyle=Manual
|
||||||
CODE_SIGN_IDENTITY=...
|
CODE_SIGN_IDENTITY=...
|
||||||
|
@ -18,6 +18,7 @@ TaskFunction createBasicMaterialAppSizeTest() {
|
|||||||
if (await sampleDir.exists())
|
if (await sampleDir.exists())
|
||||||
rmTree(sampleDir);
|
rmTree(sampleDir);
|
||||||
|
|
||||||
|
final Stopwatch watch = new Stopwatch();
|
||||||
int releaseSizeInBytes;
|
int releaseSizeInBytes;
|
||||||
|
|
||||||
await inDirectory(Directory.systemTemp, () async {
|
await inDirectory(Directory.systemTemp, () async {
|
||||||
@ -32,19 +33,26 @@ TaskFunction createBasicMaterialAppSizeTest() {
|
|||||||
|
|
||||||
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
|
||||||
await prepareProvisioningCertificates(sampleDir.path);
|
await prepareProvisioningCertificates(sampleDir.path);
|
||||||
|
watch.start();
|
||||||
await flutter('build', options: <String>['ios', '--release']);
|
await flutter('build', options: <String>['ios', '--release']);
|
||||||
|
watch.stop();
|
||||||
// IPAs are created manually AFAICT
|
// IPAs are created manually AFAICT
|
||||||
await exec('tar', <String>['-zcf', 'build/app.ipa', 'build/ios/Release-iphoneos/Runner.app/']);
|
await exec('tar', <String>['-zcf', 'build/app.ipa', 'build/ios/Release-iphoneos/Runner.app/']);
|
||||||
releaseSizeInBytes = await file('${sampleDir.path}/build/app.ipa').length();
|
releaseSizeInBytes = await file('${sampleDir.path}/build/app.ipa').length();
|
||||||
} else {
|
} else {
|
||||||
|
watch.start();
|
||||||
await flutter('build', options: <String>['apk', '--release']);
|
await flutter('build', options: <String>['apk', '--release']);
|
||||||
|
watch.stop();
|
||||||
releaseSizeInBytes = await file('${sampleDir.path}/build/app/outputs/apk/app-release.apk').length();
|
releaseSizeInBytes = await file('${sampleDir.path}/build/app/outputs/apk/app-release.apk').length();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return new TaskResult.success(
|
return new TaskResult.success(
|
||||||
<String, dynamic>{'release_size_in_bytes': releaseSizeInBytes},
|
<String, dynamic>{
|
||||||
benchmarkScoreKeys: <String>['release_size_in_bytes']);
|
'release_size_in_bytes': releaseSizeInBytes,
|
||||||
|
'build_time_millis': watch.elapsedMilliseconds,
|
||||||
|
},
|
||||||
|
benchmarkScoreKeys: <String>['release_size_in_bytes', 'build_time_millis']);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user