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

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

Issue 571633002: only run the admin server if admin-port is specified (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: reference bug for the TODO 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/lib/src/command/serve.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart b/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
index 8255ec1932dda27f1446a923700dfdf870006ab2..15e220f73285992f0c3c379ebd41eb6b77cf0766 100644
--- a/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
+++ b/sdk/lib/_internal/pub_generated/lib/src/command/serve.dart
@@ -67,77 +67,84 @@ class ServeCommand extends BarbackCommand {
var environment = x2;
var directoryLength =
sourceDirectories.map(((dir) => dir.length)).reduce(math.max);
- environment.startAdminServer(adminPort).then((x3) {
- try {
- var server = x3;
- server.results.listen(((_) {
- assert(false);
- }), onError: _fatalError);
- join2() {
- environment.pauseUpdates();
- var it0 = sourceDirectories.iterator;
- break0(x7) {
- environment.barback.errors.listen(((error) {
- log.error(log.red("Build error:\n$error"));
- }));
- environment.barback.results.listen(((result) {
- if (result.succeeded) {
- log.message(
- "Build completed ${log.green('successfully')}");
- } else {
- log.message(
- "Build completed with " "${log.red(result.errors.length)} errors.");
- }
- }), onError: _fatalError);
- environment.resumeUpdates();
- _completer.future.then((x4) {
- try {
- x4;
- completer0.complete(null);
- } catch (e2) {
- completer0.completeError(e2);
- }
- }, onError: (e3) {
- completer0.completeError(e3);
- });
- }
- continue0(x8) {
- if (it0.moveNext()) {
- Future.wait([]).then((x6) {
- var directory = it0.current;
- _startServer(
- environment,
- directory,
- directoryLength).then((x5) {
- try {
- x5;
- continue0(null);
- } catch (e4) {
- completer0.completeError(e4);
- }
- }, onError: (e5) {
- completer0.completeError(e5);
- });
- });
+ join2() {
+ join3() {
+ environment.pauseUpdates();
+ var it0 = sourceDirectories.iterator;
+ break0(x6) {
+ environment.barback.errors.listen(((error) {
+ log.error(log.red("Build error:\n$error"));
+ }));
+ environment.barback.results.listen(((result) {
+ if (result.succeeded) {
+ log.message(
+ "Build completed ${log.green('successfully')}");
} else {
- break0(null);
+ log.message(
+ "Build completed with " "${log.red(result.errors.length)} errors.");
+ }
+ }), onError: _fatalError);
+ environment.resumeUpdates();
+ _completer.future.then((x3) {
+ try {
+ x3;
+ completer0.complete(null);
+ } catch (e1) {
+ completer0.completeError(e1);
}
+ }, onError: (e2) {
+ completer0.completeError(e2);
+ });
+ }
+ continue0(x7) {
+ if (it0.moveNext()) {
+ Future.wait([]).then((x5) {
+ var directory = it0.current;
+ _startServer(
+ environment,
+ directory,
+ directoryLength).then((x4) {
+ try {
+ x4;
+ continue0(null);
+ } catch (e3) {
+ completer0.completeError(e3);
+ }
+ }, onError: (e4) {
+ completer0.completeError(e4);
+ });
+ });
+ } else {
+ break0(null);
}
- continue0(null);
}
- if (logAdminUrl) {
- log.message(
- "Running admin server on " "${log.bold('http://${hostname}:${server.port}')}");
- join2();
- } else {
+ continue0(null);
+ }
+ if (logAdminUrl) {
+ log.message(
+ "Running admin server on " "${log.bold('http://${hostname}:${server.port}')}");
+ join3();
+ } else {
+ join3();
+ }
+ }
+ if (adminPort != null) {
+ environment.startAdminServer(adminPort).then((x8) {
+ try {
+ var server = x8;
+ server.results.listen(((_) {
+ assert(false);
+ }), onError: _fatalError);
join2();
+ } catch (e5) {
+ completer0.completeError(e5);
}
- } catch (e1) {
- completer0.completeError(e1);
- }
- }, onError: (e6) {
- completer0.completeError(e6);
- });
+ }, onError: (e6) {
+ completer0.completeError(e6);
+ });
+ } else {
+ join2();
+ }
} catch (e0) {
completer0.completeError(e0);
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/command/serve.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698