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

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

Issue 341123002: Support running executables from dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. 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
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 14e5796083fa1766d7331bfe32045fe68b8d882c..716357784096044a6b5ab4cd77aa1b08caccb57e 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
@@ -204,6 +204,20 @@ class AssetEnvironment {
});
}
+ /// Binds a new port to serve assets from within the "bin" directory of
+ /// [package].
+ ///
+ /// Adds the sources within that directory and then binds a server to it.
+ /// Unlike [serveDirectory], this works with packages that are not the
+ /// entrypoint.
+ ///
+ /// Returns a [Future] that completes to the bound server.
+ Future<BarbackServer> servePackageBinDirectory(String package) {
+ return _provideDirectorySources(graph.packages[package], "bin").then(
+ (_) => BarbackServer.bind(this, _hostname, 0, package: package,
+ rootDirectory: "bin"));
+ }
+
/// Stops the server bound to [rootDirectory].
///
/// Also removes any source files within that directory from barback. Returns
@@ -395,7 +409,7 @@ class AssetEnvironment {
// Bind a server that we can use to load the transformers.
var transformerServer;
- return BarbackServer.bind(this, _hostname, 0, null).then((server) {
+ return BarbackServer.bind(this, _hostname, 0).then((server) {
transformerServer = server;
var errorStream = barback.errors.map((error) {

Powered by Google App Engine
This is Rietveld 408576698