Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Development server that compiles Dart to JS on the fly. | 5 /// Development server that compiles Dart to JS on the fly. |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 212 } | 212 } |
| 213 | 213 |
| 214 class DevServer { | 214 class DevServer { |
| 215 final ServerCompiler compiler; | 215 final ServerCompiler compiler; |
| 216 final String outDir; | 216 final String outDir; |
| 217 final String host; | 217 final String host; |
| 218 final int port; | 218 final int port; |
| 219 final String _entryPath; | 219 final String _entryPath; |
| 220 | 220 |
| 221 factory DevServer(CompilerOptions options) { | 221 factory DevServer(CompilerOptions options) { |
| 222 assert(options.inputs.length == 1); | |
|
Jacob
2016/02/16 17:47:35
perhaps this should change to
assert(options.inpu
vsm
2016/02/18 01:13:09
Done.
| |
| 223 | |
| 224 var fileResolvers = createFileResolvers(options.sourceOptions); | 222 var fileResolvers = createFileResolvers(options.sourceOptions); |
| 225 if (options.sourceOptions.useImplicitHtml) { | 223 if (options.sourceOptions.useImplicitHtml) { |
| 226 fileResolvers.insert(0, _createImplicitEntryResolver(options.inputs[0])); | 224 fileResolvers.insert(0, _createImplicitEntryResolver(options.inputs[0])); |
| 227 } | 225 } |
| 228 | 226 |
| 229 var context = createAnalysisContextWithSources(options.sourceOptions, | 227 var context = createAnalysisContextWithSources(options.sourceOptions, |
| 230 fileResolvers: fileResolvers); | 228 fileResolvers: fileResolvers); |
| 231 | 229 |
| 232 var entryPath = path.basename(options.inputs[0]); | 230 var entryPath = path.basename(options.inputs[0]); |
| 233 var extension = path.extension(entryPath); | 231 var extension = path.extension(entryPath); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 330 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 333 var src = resolver.resolveAbsolute(uri, actualUri); | 331 var src = resolver.resolveAbsolute(uri, actualUri); |
| 334 return src.exists() ? src : null; | 332 return src.exists() ? src : null; |
| 335 } | 333 } |
| 336 | 334 |
| 337 Uri restoreAbsolute(Source source) => resolver.restoreAbsolute(source); | 335 Uri restoreAbsolute(Source source) => resolver.restoreAbsolute(source); |
| 338 } | 336 } |
| 339 | 337 |
| 340 final _log = new Logger('dev_compiler.src.server'); | 338 final _log = new Logger('dev_compiler.src.server'); |
| 341 final _earlyErrorResult = new CheckerResults(const [], true); | 339 final _earlyErrorResult = new CheckerResults(const [], true); |
| OLD | NEW |