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

Unified Diff: sdk/lib/_internal/pub/lib/src/command/build.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/build.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/build.dart b/sdk/lib/_internal/pub/lib/src/command/build.dart
index 1a88922c2fc695bd85274821596ada401681426a..b07cd95d617b7c054fd607f49dba7d198cf5dc3c 100644
--- a/sdk/lib/_internal/pub/lib/src/command/build.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/build.dart
@@ -35,6 +35,10 @@ class BuildCommand extends BarbackCommand {
int builtFiles = 0;
BuildCommand() {
+ argParser.addOption("define", abbr: "D",
+ help: "Defines an environment constant for dart2js.",
+ allowMultiple: true, splitCommas: false);
+
argParser.addOption("format",
help: "How output should be displayed.",
allowed: ["text", "json"], defaultsTo: "text");
@@ -50,10 +54,16 @@ class BuildCommand extends BarbackCommand {
var errorsJson = [];
var logJson = [];
+ var environmentConstants = new Map.fromIterable(argResults["define"],
+ key: (pair) => pair.split("=").first,
+ value: (pair) => pair.split("=").last);
+
// Since this server will only be hit by the transformer loader and isn't
// user-facing, just use an IPv4 address to avoid a weird bug on the
// OS X buildbots.
- return AssetEnvironment.create(entrypoint, mode, useDart2JS: true)
+ return AssetEnvironment.create(entrypoint, mode,
+ environmentConstants: environmentConstants,
+ useDart2JS: true)
.then((environment) {
// Show in-progress errors, but not results. Those get handled
// implicitly by getAllAssets().

Powered by Google App Engine
This is Rietveld 408576698