From d13316cb4a8472de1fe80cef34c51b0f1adc7c78 Mon Sep 17 00:00:00 2001 From: Kenzie Davisson <43759233+kenzieschmoll@users.noreply.github.com> Date: Thu, 9 Nov 2023 08:51:06 -0800 Subject: [PATCH] Add `build-mode` and `pub-get` argument to the `serve` and `build` CLI tools (#6695) --- CONTRIBUTING.md | 4 +- tool/RELEASE_INSTRUCTIONS.md | 2 +- tool/lib/commands/build.dart | 117 ++++++++++++++++++++++ tool/lib/commands/build_release.dart | 96 ------------------ tool/lib/commands/serve.dart | 95 ++++++++++-------- tool/lib/commands/shared.dart | 70 +++++++++++++ tool/lib/commands/update_flutter_sdk.dart | 49 ++++----- tool/lib/commands/update_perfetto.dart | 1 + tool/lib/devtools_command_runner.dart | 4 +- tool/lib/utils.dart | 7 -- 10 files changed, 275 insertions(+), 170 deletions(-) create mode 100644 tool/lib/commands/build.dart delete mode 100644 tool/lib/commands/build_release.dart create mode 100644 tool/lib/commands/shared.dart diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2abb9371ca3..1ed48793c6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,7 +84,7 @@ of launch configurations for running and debugging DevTools: ### Workflow for making changes -1. Change your local Flutter SDK to the latest flutter candidate branch: `devtools_tool update-flutter-sdk --local` +1. Change your local Flutter SDK to the latest flutter candidate branch: `devtools_tool update-flutter-sdk --from-path` 2. Create a branch from your cloned DevTools repo: `git checkout -b myBranch` 3. Ensure your branch, dependencies, and generated code are up-to-date: `devtools_tool sync` 4. Implement your changes, and commit to your branch: `git commit -m “description”` @@ -173,7 +173,7 @@ command palette (`F1`)) and add the following to your settings: "env": { "LOCAL_DART_SDK": "/path/to/dart-sdk/sdk" // Path to the version that Flutter DevTools is pinned to. - "FLUTTER_ROOT": "C:\\Dev\\Google\\devtools\\tool\\flutter-sdk" + "FLUTTER_ROOT": "/path/to/devtools/tool/flutter-sdk" } }, ``` diff --git a/tool/RELEASE_INSTRUCTIONS.md b/tool/RELEASE_INSTRUCTIONS.md index 8d315777b1b..d35d44e0879 100644 --- a/tool/RELEASE_INSTRUCTIONS.md +++ b/tool/RELEASE_INSTRUCTIONS.md @@ -19,7 +19,7 @@ Make sure: c. The local checkout is at `main` branch: `git rebase-update` 2. Your Flutter version is equal to latest candidate release branch: - - Run `devtools_tool update-flutter-sdk --local` + - Run `devtools_tool update-flutter-sdk --from-path` 3. You have goma [configured](http://go/ma-mac-setup) ### Prepare the release diff --git a/tool/lib/commands/build.dart b/tool/lib/commands/build.dart new file mode 100644 index 00000000000..c392bc0c6c7 --- /dev/null +++ b/tool/lib/commands/build.dart @@ -0,0 +1,117 @@ +// Copyright 2023 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:io'; + +import 'package:args/command_runner.dart'; +import 'package:devtools_tool/commands/shared.dart'; +import 'package:devtools_tool/model.dart'; +import 'package:io/io.dart'; +import 'package:path/path.dart' as path; + +import '../utils.dart'; + +/// This command builds the DevTools Flutter web app. +/// +/// By default, this command builds DevTools in release mode, but this can be +/// overridden by passing 'debug' or 'profile' as the +/// [BuildCommandArgs.buildMode] argument. +/// +/// If the [BuildCommandArgs.useFlutterFromPath] argument is present, the +/// Flutter SDK will not be updated to the latest Flutter candidate before +/// building DevTools. Use this flag to save the cost of updating the Flutter +/// SDK when you already have the proper SDK checked out. This is helpful when +/// developing with the DevTools server. +/// +/// If the [BuildCommandArgs.updatePerfetto] argument is present, the +/// precompiled bits for Perfetto will be updated from the +/// `devtools_tool update-perfetto` command as part of the DevTools build +/// process. +/// +/// If [BuildCommandArgs.pubGet] argument is negated (e.g. --no-pub-get), then +/// `devtools_tool pub-get --only-main` command will not be run before building +/// the DevTools web app. Use this flag to save the cost of updating pub +/// packages if your pub cahce does not need to be updated. This is helpful when +/// developing with the DevTools server. +class BuildCommand extends Command { + BuildCommand() { + argParser + ..addUseFlutterFromPathFlag() + ..addUpdatePerfettoFlag() + ..addPubGetFlag() + ..addBulidModeOption(); + } + + @override + String get name => 'build'; + + @override + String get description => 'Prepares a release build of DevTools.'; + + @override + Future run() async { + final repo = DevToolsRepo.getInstance(); + final processManager = ProcessManager(); + + final useLocalFlutter = + argResults![BuildCommandArgs.useFlutterFromPath.flagName]; + final updatePerfetto = + argResults![BuildCommandArgs.updatePerfetto.flagName]; + final runPubGet = argResults![BuildCommandArgs.pubGet.flagName]; + final buildMode = argResults![BuildCommandArgs.buildMode.flagName]; + + final webBuildDir = + Directory(path.join(repo.devtoolsAppDirectoryPath, 'build', 'web')); + + if (!useLocalFlutter) { + logStatus('updating tool/flutter-sdk to the latest flutter candidate'); + await processManager.runProcess(CliCommand.tool('update-flutter-sdk')); + } + + if (updatePerfetto) { + logStatus('updating the bundled Perfetto assets'); + await processManager.runProcess(CliCommand.tool('update-perfetto')); + } + + logStatus('cleaning project'); + if (webBuildDir.existsSync()) { + webBuildDir.deleteSync(recursive: true); + } + await processManager.runProcess( + CliCommand.flutter('clean'), + workingDirectory: repo.devtoolsAppDirectoryPath, + ); + + logStatus('building DevTools in release mode'); + await processManager.runAll( + commands: [ + if (runPubGet) CliCommand.tool('pub-get --only-main'), + CliCommand.flutter( + [ + 'build', + 'web', + '--web-renderer', + 'canvaskit', + '--pwa-strategy=offline-first', + if (buildMode != 'debug') '--$buildMode', + '--no-tree-shake-icons', + ].join(' '), + ), + ], + workingDirectory: repo.devtoolsAppDirectoryPath, + ); + + // TODO(kenz): investigate if we need to perform a windows equivalent of + // `chmod` or if we even need to perform `chmod` for linux / mac anymore. + if (!Platform.isWindows) { + final canvaskitDir = Directory(path.join(webBuildDir.path, 'canvaskit')); + for (final file in canvaskitDir.listSync()) { + if (RegExp(r'canvaskit\..*').hasMatch(file.path)) { + await processManager + .runProcess(CliCommand('chmod 0755 ${file.path}')); + } + } + } + } +} diff --git a/tool/lib/commands/build_release.dart b/tool/lib/commands/build_release.dart deleted file mode 100644 index 6a2f19acefd..00000000000 --- a/tool/lib/commands/build_release.dart +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2023 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:io'; - -import 'package:args/command_runner.dart'; -import 'package:devtools_tool/model.dart'; -import 'package:io/io.dart'; -import 'package:path/path.dart' as path; - -import '../utils.dart'; - -const _useLocalFlutterFlag = 'use-local-flutter'; -const _updatePerfettoFlag = 'update-perfetto'; - -class BuildReleaseCommand extends Command { - BuildReleaseCommand() { - argParser - ..addFlag( - _useLocalFlutterFlag, - negatable: false, - defaultsTo: false, - help: - 'Whether to use the Flutter SDK on PATH instead of the Flutter SDK ' - 'contained in the "tool/flutter-sdk" directory.', - ) - ..addFlag( - _updatePerfettoFlag, - negatable: false, - defaultsTo: false, - help: 'Whether to update the Perfetto assets before building DevTools.', - ); - } - - @override - String get name => 'build-release'; - - @override - String get description => 'Prepares a release build of DevTools.'; - - @override - Future run() async { - final repo = DevToolsRepo.getInstance(); - final processManager = ProcessManager(); - - final useLocalFlutter = argResults![_useLocalFlutterFlag]; - final updatePerfetto = argResults![_updatePerfettoFlag]; - - final webBuildDir = - Directory(path.join(repo.devtoolsAppDirectoryPath, 'build', 'web')); - - if (!useLocalFlutter) { - logStatus('updating tool/flutter-sdk to the latest flutter candidate'); - await processManager.runProcess(CliCommand.tool('update-flutter-sdk')); - } - - if (updatePerfetto) { - logStatus('updating the bundled Perfetto assets'); - await processManager.runProcess(CliCommand.tool('update-perfetto')); - } - - logStatus('cleaning project'); - if (webBuildDir.existsSync()) { - webBuildDir.deleteSync(recursive: true); - } - await processManager.runProcess( - CliCommand.flutter('clean'), - workingDirectory: repo.devtoolsAppDirectoryPath, - ); - - logStatus('building DevTools in release mode'); - await processManager.runAll( - commands: [ - CliCommand.tool('pub-get --only-main'), - CliCommand.flutter( - 'build web --web-renderer canvaskit --pwa-strategy=offline-first' - ' --release --no-tree-shake-icons', - ), - ], - workingDirectory: repo.devtoolsAppDirectoryPath, - ); - - // TODO(kenz): investigate if we need to perform a windows equivalent of - // `chmod` or if we even need to perform `chmod` for linux / mac anymore. - if (!Platform.isWindows) { - final canvaskitDir = Directory(path.join(webBuildDir.path, 'canvaskit')); - for (final file in canvaskitDir.listSync()) { - if (RegExp(r'canvaskit\..*').hasMatch(file.path)) { - await processManager - .runProcess(CliCommand('chmod 0755 ${file.path}')); - } - } - } - } -} diff --git a/tool/lib/commands/serve.dart b/tool/lib/commands/serve.dart index 869abdfbbb9..5c805bc55a5 100644 --- a/tool/lib/commands/serve.dart +++ b/tool/lib/commands/serve.dart @@ -6,56 +6,61 @@ import 'dart:io'; import 'package:args/command_runner.dart'; import 'package:devtools_tool/model.dart'; +import 'package:devtools_tool/utils.dart'; import 'package:io/io.dart'; import 'package:path/path.dart' as path; -import '../utils.dart'; +import 'shared.dart'; -const _useLocalFlutterFlag = 'use-local-flutter'; -const _updatePerfettoFlag = 'update-perfetto'; const _buildAppFlag = 'build-app'; const _machineFlag = 'machine'; const _allowEmbeddingFlag = 'allow-embedding'; /// This command builds DevTools in release mode by running the -/// `devtools_tool build-release` command and then serves DevTools with a -/// locally running DevTools server. +/// `devtools_tool build` command and then serves DevTools with a locally +/// running DevTools server. /// -/// If the [_buildAppFlag] is negated (e.g. --no-build-app), then the DevTools -/// web app will not be rebuilt before serving. +/// If the [_buildAppFlag] argument is negated (e.g. --no-build-app), then the +/// DevTools web app will not be rebuilt before serving. The following arguments +/// are ignored if '--no-build-app' is present in the list of arguments passed +/// to this command. All of the following commands are passed along to the +/// `devtools_tool build` command. /// -/// If [_useLocalFlutterFlag] is present, the Flutter SDK will not be updated to -/// the latest Flutter candidate. Use this flag to save the cost of updating the -/// Flutter SDK when you already have the proper SDK checked out. +/// If the [BuildCommandArgs.useFlutterFromPath] argument is present, the +/// Flutter SDK will not be updated to the latest Flutter candidate before +/// building DevTools. Use this flag to save the cost of updating the Flutter +/// SDK when you already have the proper SDK checked out. This is helpful when +/// developing with the DevTools server. /// -/// If [_updatePerfettoFlag] is present, the precompiled bits for Perfetto will -/// be updated from the `devtools_tool update-perfetto` command as part of the -/// DevTools build process (e.g. running `devtools_tool build-release`). +/// If the [BuildCommandArgs.updatePerfetto] argument is present, the +/// precompiled bits for Perfetto will be updated from the +/// `devtools_tool update-perfetto` command as part of the DevTools build +/// process. +/// +/// If [BuildCommandArgs.pubGet] argument is negated (e.g. --no-pub-get), then +/// `devtools_tool pub-get --only-main` command will not be run before building +/// the DevTools web app. Use this flag to save the cost of updating pub +/// packages if your pub cahce does not need to be updated. This is helpful when +/// developing with the DevTools server. +/// +/// The [BuildCommandArgs.buildMode] argument specifies the Flutter build mode +/// that the DevTools web app will be built in ('release', 'profile', 'debug'). +/// This defaults to 'release' if unspecified. class ServeCommand extends Command { ServeCommand() { argParser - ..addFlag( - _useLocalFlutterFlag, - negatable: false, - defaultsTo: false, - help: - 'Whether to use the Flutter SDK on PATH instead of the Flutter SDK ' - 'contained in the "tool/flutter-sdk" directory.', - ) - ..addFlag( - _updatePerfettoFlag, - negatable: false, - defaultsTo: false, - help: 'Whether to update the Perfetto assets before building DevTools.', - ) ..addFlag( _buildAppFlag, negatable: true, defaultsTo: true, help: - 'Whether to build the DevTools app in release mode before starting ' - 'the DevTools server.', + 'Whether to build the DevTools web app before starting the DevTools' + ' server.', ) + ..addUseFlutterFromPathFlag() + ..addUpdatePerfettoFlag() + ..addPubGetFlag() + ..addBulidModeOption() // Flags defined in the server in DDS. ..addFlag( _machineFlag, @@ -81,15 +86,25 @@ class ServeCommand extends Command { final repo = DevToolsRepo.getInstance(); final processManager = ProcessManager(); - final useLocalFlutter = argResults![_useLocalFlutterFlag]; - final updatePerfetto = argResults![_updatePerfettoFlag]; final buildApp = argResults![_buildAppFlag]; + final useFlutterFromPath = + argResults![BuildCommandArgs.useFlutterFromPath.flagName]; + final updatePerfetto = + argResults![BuildCommandArgs.updatePerfetto.flagName]; + final runPubGet = argResults![BuildCommandArgs.pubGet.flagName]; + final devToolsAppBuildMode = + argResults![BuildCommandArgs.buildMode.flagName]; final remainingArguments = List.of(argResults!.arguments) - ..remove(_useLocalFlutterFlag) - ..remove(_updatePerfettoFlag) - ..remove(_buildAppFlag) - ..remove('--no-$_buildAppFlag'); + ..remove(BuildCommandArgs.useFlutterFromPath.asArg()) + ..remove(BuildCommandArgs.updatePerfetto.asArg()) + ..remove(valueAsArg(_buildAppFlag)) + ..remove(valueAsArg(_buildAppFlag, negated: true)) + ..remove(BuildCommandArgs.pubGet.asArg()) + ..remove(BuildCommandArgs.pubGet.asArg(negated: true)) + ..removeWhere( + (element) => element.startsWith(BuildCommandArgs.buildMode.asArg()), + ); final localDartSdkLocation = Platform.environment['LOCAL_DART_SDK']; if (localDartSdkLocation == null) { @@ -114,14 +129,16 @@ class ServeCommand extends Command { if (buildApp) { final process = await processManager.runProcess( CliCommand.tool( - 'build-release' - ' ${useLocalFlutter ? '--$_useLocalFlutterFlag' : ''}' - ' ${updatePerfetto ? '--$_updatePerfettoFlag' : ''}', + 'build' + '${useFlutterFromPath ? ' ${BuildCommandArgs.useFlutterFromPath.asArg()}' : ''}' + '${updatePerfetto ? ' ${BuildCommandArgs.updatePerfetto.asArg()}' : ''}' + ' ${BuildCommandArgs.buildMode.asArg()}=$devToolsAppBuildMode' + ' ${BuildCommandArgs.pubGet.asArg(negated: !runPubGet)}', ), ); if (process.exitCode == 1) { throw Exception( - 'Something went wrong while running `devtools_tool build-release`', + 'Something went wrong while running `devtools_tool build`', ); } logStatus('completed building DevTools: $devToolsBuildLocation'); diff --git a/tool/lib/commands/shared.dart b/tool/lib/commands/shared.dart new file mode 100644 index 00000000000..4d33b3e4c72 --- /dev/null +++ b/tool/lib/commands/shared.dart @@ -0,0 +1,70 @@ +// Copyright 2023 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:args/args.dart'; +import 'package:args/command_runner.dart'; + +extension CommandExtension on Command { + void logStatus(String log) { + print('[$name] $log'); + } +} + +extension BuildCommandArgsExtension on ArgParser { + void addBulidModeOption() { + addOption( + BuildCommandArgs.buildMode.name, + allowed: ['debug', 'profile', 'release'], + defaultsTo: 'release', + help: 'The build mode to use for the DevTools web app. This should only' + ' be "debug" or "profile" for the purpose of local development.', + ); + } + + void addPubGetFlag() { + addFlag( + BuildCommandArgs.pubGet.flagName, + negatable: true, + defaultsTo: true, + help: 'Whether to run `devtools_tool pub-get --only-main` before building' + ' the DevTools web app.', + ); + } + + void addUpdatePerfettoFlag() { + addFlag( + BuildCommandArgs.updatePerfetto.flagName, + negatable: false, + defaultsTo: false, + help: 'Whether to update the Perfetto assets before building DevTools.', + ); + } + + void addUseFlutterFromPathFlag() { + addFlag( + BuildCommandArgs.useFlutterFromPath.flagName, + negatable: false, + defaultsTo: false, + help: 'Whether to use the Flutter SDK on PATH instead of the Flutter SDK ' + 'contained in the "tool/flutter-sdk" directory.', + ); + } +} + +enum BuildCommandArgs { + buildMode('build-mode'), + pubGet('pub-get'), + useFlutterFromPath('use-flutter-from-path'), + updatePerfetto('update-perfetto'); + + const BuildCommandArgs(this.flagName); + + final String flagName; + + String asArg({bool negated = false}) => + valueAsArg(flagName, negated: negated); +} + +String valueAsArg(String value, {bool negated = false}) => + '--${negated ? 'no-' : ''}$value'; diff --git a/tool/lib/commands/update_flutter_sdk.dart b/tool/lib/commands/update_flutter_sdk.dart index 94464cdf66b..144fc6ea6e3 100644 --- a/tool/lib/commands/update_flutter_sdk.dart +++ b/tool/lib/commands/update_flutter_sdk.dart @@ -12,14 +12,14 @@ import 'package:path/path.dart' as path; import '../utils.dart'; -const _localFlag = 'local'; +const _fromPathFlag = 'from-path'; const _useCacheFlag = 'use-cache'; /// This command updates the the Flutter SDK contained in the 'tool/' directory /// to the latest Flutter candidate branch. /// -/// When the '--local' flag is passed, your local flutter/flutter checkout will -/// be updated as well. +/// When the '--from-path' flag is passed, the Flutter SDK that is on PATH (your +/// local flutter/flutter git checkout) will be updated as well. /// /// This command will use the Flutter version from the 'flutter-candidate.txt' /// file in the repository root, unless the '--no-use-cache' flag is passed, @@ -30,22 +30,23 @@ const _useCacheFlag = 'use-cache'; /// time since the GitHub workflow that updates this file runs twice per day. /// /// To run this script: -/// `devtools_tool update-flutter-sdk [--local] [--no-use-cache]` +/// `devtools_tool update-flutter-sdk [--from-path] [--no-use-cache]` class UpdateFlutterSdkCommand extends Command { UpdateFlutterSdkCommand() { argParser ..addFlag( - _localFlag, + _fromPathFlag, + abbr: 'p', negatable: false, - help: 'Update your local checkout of the Flutter SDK', + help: 'Update the Flutter SDK that is on PATH (your local ' + 'flutter/flutter git checkout)', ) ..addFlag( _useCacheFlag, negatable: true, defaultsTo: true, - help: - 'Use the cached Flutter version stored in "flutter-candidate.txt" ' - 'instead of the latest version at ' + help: 'Update the Flutter SDK(s) to the cached Flutter version stored ' + 'in "flutter-candidate.txt" instead of the latest version at ' '"https://flutter.googlesource.com/mirrors/flutter/"', ); } @@ -55,12 +56,12 @@ class UpdateFlutterSdkCommand extends Command { @override String get description => 'Updates the the Flutter SDK contained in the \'tool/\' directory to the ' - 'latest Flutter candidate branch. Optionally updates your local checkout ' - 'of the Flutter SDK as well.'; + 'latest Flutter candidate branch. Optionally, can also update the Flutter' + 'SDK that is on PATH (your local flutter/flutter git checkout).'; @override Future run() async { - final updateLocalFlutter = argResults![_localFlag]; + final updateFlutterFromPath = argResults![_fromPathFlag]; final useCachedVersion = argResults![_useCacheFlag]; final log = Logger.standard(); @@ -90,7 +91,8 @@ class UpdateFlutterSdkCommand extends Command { workingDirectory: repo.toolDirectoryPath, )) .stdout - .replaceFirst('refs/', ''); + .replaceFirst('refs/', '') + .trim(); } log.stdout( @@ -98,14 +100,14 @@ class UpdateFlutterSdkCommand extends Command { '${useCachedVersion ? 'from cache' : 'from upstream'}: $flutterTag ', ); - if (updateLocalFlutter) { + if (updateFlutterFromPath) { final sdk = FlutterSdk.current; if (sdk == null) { print('Unable to locate a Flutter sdk.'); return 1; } - log.stdout('Updating local Flutter checkout...'); + log.stdout('Updating local flutter/flutter repository...'); // Verify we have an upstream remote to pull from. await findRemote( @@ -125,7 +127,7 @@ class UpdateFlutterSdkCommand extends Command { ], workingDirectory: sdk.sdkPath, ); - log.stdout('Finished updating local Flutter checkout.'); + log.stdout('Finished updating local flutter/flutter repository.'); } final flutterSdkDirName = 'flutter-sdk'; @@ -133,21 +135,23 @@ class UpdateFlutterSdkCommand extends Command { repo.toolDirectoryPath, flutterSdkDirName, ); - final toolFlutterSdk = Directory.fromUri(Uri.file(toolSdkPath)); + final toolFlutterSdkDirectory = Directory(toolSdkPath); log.stdout('Updating "$toolSdkPath" to branch $flutterTag'); - if (toolFlutterSdk.existsSync()) { - log.stdout('"$toolSdkPath" directory already exists'); + if (toolFlutterSdkDirectory.existsSync()) { + log.stdout( + '"$toolSdkPath" directory already exists. Fetching $flutterTag from GitHub.', + ); await processManager.runAll( commands: [ CliCommand.git('fetch'), CliCommand.git('checkout $flutterTag -f'), CliCommand.flutter('--version'), ], - workingDirectory: toolFlutterSdk.path, + workingDirectory: toolFlutterSdkDirectory.path, ); } else { - log.stdout('"$toolSdkPath" directory does not exist - cloning it now'); + log.stdout('Cloning flutter/flutter into "$toolSdkPath" directory.'); await processManager.runProcess( CliCommand.git( 'clone https://github.com/flutter/flutter $flutterSdkDirName', @@ -159,10 +163,9 @@ class UpdateFlutterSdkCommand extends Command { CliCommand.git('checkout $flutterTag -f'), CliCommand.flutter('--version'), ], - workingDirectory: toolFlutterSdk.path, + workingDirectory: toolFlutterSdkDirectory.path, ); } - log.stdout('Finished updating $toolSdkPath.'); } } diff --git a/tool/lib/commands/update_perfetto.dart b/tool/lib/commands/update_perfetto.dart index d1471fe4143..1433c9e4dcf 100644 --- a/tool/lib/commands/update_perfetto.dart +++ b/tool/lib/commands/update_perfetto.dart @@ -10,6 +10,7 @@ import 'package:io/io.dart'; import 'package:path/path.dart' as path; import '../utils.dart'; +import 'shared.dart'; const _buildFlag = 'build'; diff --git a/tool/lib/devtools_command_runner.dart b/tool/lib/devtools_command_runner.dart index 942d6d921da..8d0130e4ae7 100644 --- a/tool/lib/devtools_command_runner.dart +++ b/tool/lib/devtools_command_runner.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:args/command_runner.dart'; -import 'package:devtools_tool/commands/build_release.dart'; +import 'package:devtools_tool/commands/build.dart'; import 'package:devtools_tool/commands/fix_goldens.dart'; import 'package:devtools_tool/commands/generate_code.dart'; import 'package:devtools_tool/commands/serve.dart'; @@ -24,7 +24,7 @@ class DevToolsCommandRunner extends CommandRunner { DevToolsCommandRunner() : super('devtools_tool', 'A repo management tool for DevTools.') { addCommand(AnalyzeCommand()); - addCommand(BuildReleaseCommand()); + addCommand(BuildCommand()); addCommand(FixGoldensCommand()); addCommand(GenerateCodeCommand()); addCommand(ListCommand()); diff --git a/tool/lib/utils.dart b/tool/lib/utils.dart index 6d459c3caa5..cde41d8d040 100644 --- a/tool/lib/utils.dart +++ b/tool/lib/utils.dart @@ -6,7 +6,6 @@ import 'dart:async'; import 'dart:convert'; import 'dart:io'; -import 'package:args/command_runner.dart'; import 'package:devtools_tool/model.dart'; import 'package:io/io.dart'; import 'package:path/path.dart' as path; @@ -217,12 +216,6 @@ Future findRemote( return remoteUpstream; } -extension CommandExtension on Command { - void logStatus(String log) { - print('[$name] $log'); - } -} - extension JoinExtension on List { String joinWithNewLine() { return '${join('\n')}\n';