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

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

Issue 204983022: Add a hidden flag for specifying pub serve's admin port. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 | « no previous file | 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/build_environment.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
index f155374d7bf82e536e4d270da6a1223cda9cdfea..730c927ea6e383424506027b175d0830a1ec52b6 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/build_environment.dart
@@ -139,13 +139,13 @@ class BuildEnvironment {
/// Starts up the admin server on an appropriate port and returns it.
///
/// This may only be called once on the build environment.
- Future<AdminServer> startAdminServer() {
+ Future<AdminServer> startAdminServer([int port]) {
// Can only start once.
assert(_adminServer == null);
- // The admin server is bound to one before the base port, unless it's
- // ephemeral in which case the admin port is too.
- var port = _basePort == 0 ? 0 : _basePort - 1;
+ // The admin server is bound to one before the base port by default, unless
+ // it's ephemeral in which case the admin port is too.
+ if (port == null) port = _basePort == 0 ? 0 : _basePort - 1;
return AdminServer.bind(this, _hostname, port)
.then((server) => _adminServer = server);
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/lib/src/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698