Commit 4245bce5 authored by xster's avatar xster Committed by GitHub

Add full platform build speed instrumentations (#9162)

* Add new metric to size_tests instead

* Small lints
parent 0d402242
...@@ -73,7 +73,7 @@ $specificMessage ...@@ -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() { ...@@ -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() { ...@@ -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']);
}; };
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment