Remove barback, build and serve commands (#3833)
diff --git a/lib/src/command/barback.dart b/lib/src/command/barback.dart
deleted file mode 100644
index 9d52aa9..0000000
--- a/lib/src/command/barback.dart
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-import '../command.dart';
-import '../log.dart' as log;
-import '../utils.dart';
-
-/// Shared base class for [BuildCommand] and [ServeCommand].
-abstract class BarbackCommand extends PubCommand {
- BarbackCommand() {
- argParser.addOption('mode', hide: true);
- argParser.addFlag('all', hide: true);
- argParser.addOption('web-compiler', hide: true);
- }
-
- @override
- Future<void> runProtected() async {
- // Switch to JSON output if specified. We need to do this before parsing
- // the source directories so an error will be correctly reported in JSON
- // format.
- log.json.enabled =
- argResults.options.contains('format') && argResults['format'] == 'json';
-
- fail(
- log.red('Dart 2 has a new build system. Learn how to migrate '
- "from ${log.bold('pub build')} and\n"
- "${log.bold('pub serve')}: https://dart.dev/web/dart-2\n"),
- );
- }
-}
diff --git a/lib/src/command/build.dart b/lib/src/command/build.dart
deleted file mode 100644
index 8c199d6..0000000
--- a/lib/src/command/build.dart
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-import 'barback.dart';
-
-/// Handles the `build` pub command.
-class BuildCommand extends BarbackCommand {
- @override
- String get name => 'build';
- @override
- String get description => 'Deprecated command';
- @override
- bool get hidden => true;
-
- BuildCommand() {
- argParser.addOption('define', hide: true);
- argParser.addOption('format', hide: true);
- argParser.addOption('output', hide: true);
- }
-}
diff --git a/lib/src/command/serve.dart b/lib/src/command/serve.dart
deleted file mode 100644
index 4c560e7..0000000
--- a/lib/src/command/serve.dart
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// 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.
-
-import 'barback.dart';
-
-/// Handles the `serve` pub command.
-class ServeCommand extends BarbackCommand {
- @override
- String get name => 'serve';
- @override
- String get description => 'Deprecated command';
- @override
- bool get hidden => true;
-
- ServeCommand() {
- argParser.addOption('define', hide: true);
- argParser.addOption('hostname', hide: true);
- argParser.addOption('port', hide: true);
- argParser.addFlag('log-admin-url', hide: true);
- argParser.addOption('admin-port', hide: true);
- argParser.addOption('build-delay', hide: true);
- argParser.addFlag('dart2js', hide: true);
- argParser.addFlag('force-poll', hide: true);
- }
-}
diff --git a/lib/src/command_runner.dart b/lib/src/command_runner.dart
index ebaf63b..5fa9344 100644
--- a/lib/src/command_runner.dart
+++ b/lib/src/command_runner.dart
@@ -11,7 +11,6 @@
import 'command.dart' show PubTopLevel, lineLength;
import 'command/add.dart';
-import 'command/build.dart';
import 'command/cache.dart';
import 'command/deps.dart';
import 'command/downgrade.dart';
@@ -23,7 +22,6 @@
import 'command/outdated.dart';
import 'command/remove.dart';
import 'command/run.dart';
-import 'command/serve.dart';
import 'command/token.dart';
import 'command/upgrade.dart';
import 'command/uploader.dart';
@@ -139,7 +137,6 @@
// When adding new commands be sure to also add them to
// `pub_embeddable_command.dart`.
addCommand(AddCommand());
- addCommand(BuildCommand());
addCommand(CacheCommand());
addCommand(DepsCommand());
addCommand(DowngradeCommand());
@@ -149,7 +146,6 @@
addCommand(OutdatedCommand());
addCommand(RemoveCommand());
addCommand(RunCommand());
- addCommand(ServeCommand());
addCommand(UpgradeCommand());
addCommand(UploaderCommand());
addCommand(LoginCommand());
diff --git a/lib/src/pub_embeddable_command.dart b/lib/src/pub_embeddable_command.dart
index 29ac73f..48c4258 100644
--- a/lib/src/pub_embeddable_command.dart
+++ b/lib/src/pub_embeddable_command.dart
@@ -8,7 +8,6 @@
import 'command.dart' show PubCommand, PubTopLevel;
import 'command.dart';
import 'command/add.dart';
-import 'command/build.dart';
import 'command/cache.dart';
import 'command/deps.dart';
import 'command/downgrade.dart';
@@ -90,7 +89,6 @@
//
// New commands should (most likely) be included in both lists.
addSubcommand(AddCommand());
- addSubcommand(BuildCommand());
addSubcommand(CacheCommand());
addSubcommand(DepsCommand());
addSubcommand(DowngradeCommand());