Update build_sdk_summaries to 'build' command, update help.

Change-Id: I8aac5209fc0c7c481c9bf5ffb93faef183532572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
This commit is contained in:
Konstantin Shcheglov
2020-05-29 18:22:04 +00:00
committed by commit-bot@chromium.org
parent 352f22b06f
commit 1b6201bfe5
2 changed files with 8 additions and 19 deletions
@@ -7,7 +7,6 @@ import 'dart:io';
import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:analyzer/src/dart/sdk/sdk.dart';
import 'package:analyzer/src/summary/summary_file_builder.dart';
import 'package:meta/meta.dart';
void main(List<String> args) {
String command;
@@ -41,12 +40,8 @@ void main(List<String> args) {
//
// Handle commands.
//
if (command == 'build-strong') {
_buildSummary(
sdkPath,
outFilePath,
title: 'legacy',
);
if (command == 'build' || command == 'build-strong') {
_buildSummary(sdkPath, outFilePath);
} else {
_printUsage();
return;
@@ -58,12 +53,8 @@ void main(List<String> args) {
*/
const BINARY_NAME = "build_sdk_summaries";
void _buildSummary(
String sdkPath,
String outPath, {
@required String title,
}) {
print('Generating $title summary.');
void _buildSummary(String sdkPath, String outPath) {
print('Generating summary.');
Stopwatch sw = Stopwatch()..start();
List<int> bytes = buildSdkSummary(
resourceProvider: PhysicalResourceProvider.INSTANCE,
@@ -79,8 +70,6 @@ void _buildSummary(
void _printUsage() {
print('Usage: $BINARY_NAME command arguments');
print('Where command can be one of the following:');
print(' build-non-nullable output_file [sdk_path]');
print(' Generate non-nullable summary file.');
print(' build-legacy output_file [sdk_path]');
print(' Generate legacy summary file.');
print(' build output_file [sdk_path]');
print(' Generate summary file.');
}
+2 -2
View File
@@ -46,13 +46,13 @@ prebuilt_dart_action("generate_summary_strong") {
outputs = [ output ]
if (!dont_use_nnbd) {
args = [
"build-strong",
"build",
rebase_path(output),
rebase_path("../../sdk_nnbd"),
]
} else {
args = [
"build-strong",
"build",
rebase_path(output),
rebase_path("../../sdk"),
]