mirror of
https://github.com/dart-lang/sdk
synced 2024-10-07 09:55:05 +00:00
[gardening] Fix SDKArtifactSizes benchmark.
Compress the dart-sdk directory under the root, not the grandparent of the root which will be the SDK checkout. Also fix so dart2 version is 2.9 compatible and dart version is latest version compatible. Change-Id: I6e8875d9a3c9fdabf301db379340b2d8473a54cc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/210440 Reviewed-by: Daco Harkes <dacoharkes@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com>
This commit is contained in:
parent
19d12d18d6
commit
4c47fdbea6
|
@ -66,13 +66,12 @@ Future<void> main() async {
|
|||
|
||||
// Measure the (compressed) sdk size.
|
||||
final tempDir = Directory.systemTemp.createTempSync('dartdev');
|
||||
final sdkArchive =
|
||||
compress(File(Platform.resolvedExecutable).parent.parent, tempDir);
|
||||
await reportArtifactSize(sdkArchive?.path, 'sdk');
|
||||
final sdkArchive = compress(Directory('$rootDir/dart-sdk'), tempDir);
|
||||
await reportArtifactSize(sdkArchive?.path ?? '', 'sdk');
|
||||
tempDir.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
File compress(Directory sourceDir, Directory targetDir) {
|
||||
File? compress(Directory sourceDir, Directory targetDir) {
|
||||
final outFile = File('${targetDir.path}/sdk.zip');
|
||||
|
||||
if (Platform.isMacOS || Platform.isLinux) {
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart=2.9
|
||||
|
||||
// Reports the sizes of binary artifacts shipped with the SDK.
|
||||
|
||||
import 'dart:io';
|
||||
|
@ -66,13 +68,12 @@ Future<void> main() async {
|
|||
|
||||
// Measure the (compressed) sdk size.
|
||||
final tempDir = Directory.systemTemp.createTempSync('dartdev');
|
||||
final sdkArchive =
|
||||
compress(File(Platform.resolvedExecutable).parent.parent, tempDir);
|
||||
final sdkArchive = compress(Directory('$rootDir/dart-sdk'), tempDir);
|
||||
await reportArtifactSize(sdkArchive?.path ?? '', 'sdk');
|
||||
tempDir.deleteSync(recursive: true);
|
||||
}
|
||||
|
||||
File? compress(Directory sourceDir, Directory targetDir) {
|
||||
File compress(Directory sourceDir, Directory targetDir) {
|
||||
final outFile = File('${targetDir.path}/sdk.zip');
|
||||
|
||||
if (Platform.isMacOS || Platform.isLinux) {
|
||||
|
|
Loading…
Reference in a new issue