Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Unified Diff: sdk/lib/_internal/pub/lib/src/command/serve.dart

Issue 1101343004: Fix all the analysis hints in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/lib/src/command/serve.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/serve.dart b/sdk/lib/_internal/pub/lib/src/command/serve.dart
index 32074fc90fbd20bb3479b8148d5a21c5cd091b42..d7e9de5f56f7724bc9cbedec5b36de47d0fa7bbb 100644
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart
@@ -10,7 +10,6 @@ import 'dart:math' as math;
import 'package:barback/barback.dart';
import '../barback/asset_environment.dart';
-import '../barback/pub_package_provider.dart';
import '../log.dart' as log;
import '../utils.dart';
import 'barback.dart';
@@ -27,8 +26,6 @@ class ServeCommand extends BarbackCommand {
String get invocation => "pub serve [directories...]";
String get docUrl => "http://dartlang.org/tools/pub/cmd/pub-serve.html";
- PubPackageProvider _provider;
-
String get hostname => argResults['hostname'];
/// The base port for the servers.
@@ -59,6 +56,9 @@ class ServeCommand extends BarbackCommand {
final _completer = new Completer();
ServeCommand() {
+ argParser.addOption("define", abbr: "D",
+ help: "Defines an environment constant for dart2js.",
+ allowMultiple: true, splitCommas: false);
argParser.addOption('hostname', defaultsTo: 'localhost',
help: 'The hostname to listen on.');
argParser.addOption('port', defaultsTo: '8080',
@@ -88,9 +88,13 @@ class ServeCommand extends BarbackCommand {
var watcherType = argResults['force-poll'] ?
WatcherType.POLLING : WatcherType.AUTO;
+ var environmentConstants = new Map.fromIterable(argResults["define"],
+ key: (pair) => pair.split("=").first,
+ value: (pair) => pair.split("=").last);
+
var environment = await AssetEnvironment.create(entrypoint, mode,
watcherType: watcherType, hostname: hostname, basePort: port,
- useDart2JS: useDart2JS);
+ useDart2JS: useDart2JS, environmentConstants: environmentConstants);
var directoryLength = sourceDirectories.map((dir) => dir.length)
.reduce(math.max);
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/global_list.dart ('k') | sdk/lib/_internal/pub/lib/src/command_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698