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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart

Issue 301063002: First stab at "pub run" command. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add TODO. Created 6 years, 6 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
« no previous file with comments | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/command.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
index e9f1bdb3ccda5ff67af19daa7a923ab597705150..71dd4decde22a6bd1d21714c93b3e0d729f58e87 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
@@ -39,17 +39,15 @@ class AssetEnvironment {
/// Creates a new build environment for working with the assets used by
/// [entrypoint] and its dependencies.
///
- /// Spawns an HTTP server for each directory in [rootDirectories]. These
- /// servers will be on [hostname] and have ports based on [basePort].
- /// [basePort] itself is reserved for "web/" and `basePort + 1` is reserved
- /// for "test/"; further ports will be allocated for other root directories as
- /// necessary. If [basePort] is zero, each server will have an ephemeral port.
+ /// HTTP servers that serve directories from this environment will be bound
+ /// to [hostname] and have ports based on [basePort]. If omitted, they
+ /// default to "localhost" and "0" (use ephemeral ports), respectively.
///
/// Loads all used transformers using [mode] (including dart2js if
/// [useDart2JS] is true).
///
- /// Includes [rootDirectories] in the root package, as well as "lib" and
- /// "asset".
+ /// This will only add the root package's "lib" directory to the environment.
+ /// Other directories can be added to the environment using [serveDirectory].
///
/// If [watcherType] is not [WatcherType.NONE], watches source assets for
/// modification.
@@ -57,8 +55,11 @@ class AssetEnvironment {
/// Returns a [Future] that completes to the environment once the inputs,
/// transformers, and server are loaded and ready.
static Future<AssetEnvironment> create(Entrypoint entrypoint,
- String hostname, int basePort, BarbackMode mode, WatcherType watcherType,
- {bool useDart2JS: true}) {
+ BarbackMode mode, WatcherType watcherType,
+ {String hostname, int basePort, bool useDart2JS: true}) {
+ if (hostname == null) hostname = "localhost";
+ if (basePort == null) basePort = 0;
+
return entrypoint.loadPackageGraph().then((graph) {
log.fine("Loaded package graph.");
var barback = new Barback(new PubPackageProvider(graph));
« no previous file with comments | « sdk/lib/_internal/pub/bin/pub.dart ('k') | sdk/lib/_internal/pub/lib/src/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698