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

Unified Diff: lib/src/server/server.dart

Issue 1270993002: fixes #276, path manipulation issues on windows. Also fixes server mode (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: fix comment Created 5 years, 4 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 | « lib/src/options.dart ('k') | test/codegen/expect/js_test.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/server/server.dart
diff --git a/lib/src/server/server.dart b/lib/src/server/server.dart
index 13b9b244df75428328f5d5dd789545f4d92c2f16..6e30a9cd3d29ef14cb0f00244e40baad0dae5fe1 100644
--- a/lib/src/server/server.dart
+++ b/lib/src/server/server.dart
@@ -246,7 +246,7 @@ class DevServer {
? SourceResolverOptions.implicitHtmlFile
: entryPath;
- Future<bool> start() async {
+ Future start() async {
// Create output directory if needed. shelf_static will fail otherwise.
var out = new Directory(outDir);
if (!await out.exists()) await out.create(recursive: true);
@@ -257,8 +257,11 @@ class DevServer {
defaultDocument: _entryPath));
await shelf.serve(handler, host, port);
print('Serving $_entryPath at http://$host:$port/');
- CheckerResults results = compiler.run();
- return !results.failure;
+ // Give the compiler a head start. This is not needed for correctness,
+ // but will likely speed up the first load. Regardless of whether compile
+ // succeeds we should still start the server.
+ compiler.run();
+ // Server has started so this future will complete.
}
shelf.Handler rebuildAndCache(shelf.Handler handler) => (request) {
@@ -285,11 +288,11 @@ class DevServer {
}
UriResolver _createImplicitEntryResolver(String entryPath) {
- var entry = path.absolute(SourceResolverOptions.implicitHtmlFile);
- var src = path.absolute(entryPath);
+ var entry = path.toUri(path.absolute(SourceResolverOptions.implicitHtmlFile));
+ var src = path.toUri(path.absolute(entryPath));
var provider = new MemoryResourceProvider();
provider.newFile(
- entry, '<body><script type="application/dart" src="$src"></script>');
+ entry.path, '<body><script type="application/dart" src="$src"></script>');
return new _ExistingSourceUriResolver(new ResourceUriResolver(provider));
}
« no previous file with comments | « lib/src/options.dart ('k') | test/codegen/expect/js_test.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698