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 /// Command line tool to run the checker on a Dart program. | 5 /// Command line tool to run the checker on a Dart program. |
6 library dev_compiler.devc; | 6 library dev_compiler.devc; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:convert'; | 9 import 'dart:convert'; |
10 import 'dart:io'; | 10 import 'dart:io'; |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 options.dumpSrcDir, entryNode.uri, rules, options)); | 84 options.dumpSrcDir, entryNode.uri, rules, options)); |
85 } | 85 } |
86 if (outputDir != null) { | 86 if (outputDir != null) { |
87 generators.add(options.outputDart | 87 generators.add(options.outputDart |
88 ? new DartGenerator(outputDir, entryNode.uri, rules, options) | 88 ? new DartGenerator(outputDir, entryNode.uri, rules, options) |
89 : new JSGenerator(outputDir, entryNode.uri, rules, options)); | 89 : new JSGenerator(outputDir, entryNode.uri, rules, options)); |
90 } | 90 } |
91 return new Compiler._(options, resolver, reporter, rules, checker, graph, | 91 return new Compiler._(options, resolver, reporter, rules, checker, graph, |
92 entryNode, generators, | 92 entryNode, generators, |
93 // TODO(sigmund): refactor to support hashing of the dart output? | 93 // TODO(sigmund): refactor to support hashing of the dart output? |
94 options.serverMode && generators.length == 1 && !options.outputDart); | 94 options.enableHashing && generators.length == 1 && !options.outputDart); |
95 } | 95 } |
96 | 96 |
97 Compiler._(this._options, this._resolver, this._reporter, this._rules, | 97 Compiler._(this._options, this._resolver, this._reporter, this._rules, |
98 this._checker, this._graph, this._entryNode, this._generators, | 98 this._checker, this._graph, this._entryNode, this._generators, |
99 this._hashing); | 99 this._hashing); |
100 | 100 |
101 bool _buildSource(SourceNode node) { | 101 bool _buildSource(SourceNode node) { |
102 if (node is HtmlSourceNode) { | 102 if (node is HtmlSourceNode) { |
103 _buildHtmlFile(node); | 103 _buildHtmlFile(node); |
104 } else if (node is DartSourceNode) { | 104 } else if (node is DartSourceNode) { |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // Note: the cache-control header should be enough, but this doesn't hurt | 306 // Note: the cache-control header should be enough, but this doesn't hurt |
307 // and can help renew the policy after it expires. | 307 // and can help renew the policy after it expires. |
308 headers['ETag'] = segments[1]; | 308 headers['ETag'] = segments[1]; |
309 } | 309 } |
310 return response.change(headers: headers); | 310 return response.change(headers: headers); |
311 }; | 311 }; |
312 } | 312 } |
313 | 313 |
314 final _log = new Logger('dev_compiler'); | 314 final _log = new Logger('dev_compiler'); |
315 final _earlyErrorResult = new CheckerResults(const [], null, true); | 315 final _earlyErrorResult = new CheckerResults(const [], null, true); |
OLD | NEW |