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

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

Issue 575733002: Revert "try again to not auto start editor port" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/README.md ('k') | sdk/lib/_internal/pub_generated/lib/src/command/serve.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/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 0283c2df87c30e106f871d0b345e687018c1763c..1d7db1562df5e226494c9c45b9920f8d0eec1719 100644
--- a/sdk/lib/_internal/pub/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/serve.dart
@@ -46,6 +46,9 @@ class ServeCommand extends BarbackCommand {
/// `true` if Dart entrypoints should be compiled to JavaScript.
bool get useDart2JS => commandOptions['dart2js'];
+ /// `true` if the admin server URL should be displayed on startup.
+ bool get logAdminUrl => commandOptions['log-admin-url'];
+
BarbackMode get defaultMode => BarbackMode.DEBUG;
List<String> get defaultSourceDirectories => ["web", "test"];
@@ -60,8 +63,11 @@ class ServeCommand extends BarbackCommand {
commandParser.addOption('port', defaultsTo: '8080',
help: 'The base port to listen on.');
- // TODO(nweiz): Remove once editor also removes this. This is now a NOOP.
- // Check on http://dartbug.com/20960
+ // TODO(rnystrom): A hidden option to print the URL that the admin server
+ // is bound to on startup. Since this is currently only used for the Web
+ // Socket interface, we don't want to show it to users, but the tests and
+ // Editor need this logged to know what port to bind to.
+ // Remove this (and always log) when #16954 is fixed.
commandParser.addFlag('log-admin-url', defaultsTo: false, hide: true);
// TODO(nweiz): Make this public when issue 16954 is fixed.
@@ -87,13 +93,13 @@ class ServeCommand extends BarbackCommand {
var directoryLength = sourceDirectories.map((dir) => dir.length)
.reduce(math.max);
- if (adminPort != null) {
- var server = await environment.startAdminServer(adminPort);
- server.results.listen((_) {
- // The admin server produces no result values.
- assert(false);
- }, onError: _fatalError);
+ var server = await environment.startAdminServer(adminPort);
+ server.results.listen((_) {
+ // The admin server produces no result values.
+ assert(false);
+ }, onError: _fatalError);
+ if (logAdminUrl) {
log.message("Running admin server on "
"${log.bold('http://$hostname:${server.port}')}");
}
« no previous file with comments | « sdk/lib/_internal/pub/README.md ('k') | sdk/lib/_internal/pub_generated/lib/src/command/serve.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698