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.src.compiler; | 6 library dev_compiler.src.compiler; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 checker.visitCompilationUnit(unit); | 166 checker.visitCompilationUnit(unit); |
167 if (checker.failure) failureInLib = true; | 167 if (checker.failure) failureInLib = true; |
168 } | 168 } |
169 | 169 |
170 if (failureInLib) { | 170 if (failureInLib) { |
171 _failure = true; | 171 _failure = true; |
172 if (!options.codegenOptions.forceCompile) return; | 172 if (!options.codegenOptions.forceCompile) return; |
173 } | 173 } |
174 | 174 |
175 if (_jsGen != null) { | 175 if (_jsGen != null) { |
176 // TODO(jmesserly): full incremental support would avoid checking as well, | |
Jennifer Messerly
2015/08/31 23:43:08
I'm already making good progress on addressing thi
| |
177 // however, we'd lose compiler messages in that case. | |
178 | |
179 // Note: analyzer's modification stamp is millisecondsSinceEpoch | |
180 int lastModifyTime = unitElements | |
181 .map((e) => context.getModificationStamp(e.source)) | |
182 .reduce(math.max); | |
183 var outFile = new File(getOutputPath(library.source.uri)); | |
184 if (outFile.existsSync() && | |
185 outFile.lastModifiedSync().millisecondsSinceEpoch >= lastModifyTime) { | |
186 // Output already up to date. | |
187 return; | |
188 } | |
189 | |
176 var unit = units.first; | 190 var unit = units.first; |
177 var parts = units.skip(1).toList(); | 191 var parts = units.skip(1).toList(); |
178 _jsGen.generateLibrary(new LibraryUnit(unit, parts)); | 192 _jsGen.generateLibrary(new LibraryUnit(unit, parts)); |
179 } | 193 } |
180 } | 194 } |
181 | 195 |
182 void _copyDartRuntime() { | 196 void _copyDartRuntime() { |
183 if (_sdkCopied) return; | 197 if (_sdkCopied) return; |
184 _sdkCopied = true; | 198 _sdkCopied = true; |
185 for (var file in defaultRuntimeFiles) { | 199 for (var file in defaultRuntimeFiles) { |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 '_rtti.js', | 468 '_rtti.js', |
455 '_classes.js', | 469 '_classes.js', |
456 '_operations.js', | 470 '_operations.js', |
457 'dart_runtime.js', | 471 'dart_runtime.js', |
458 ]; | 472 ]; |
459 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); | 473 files.addAll(corelibOrder.map((l) => l.replaceAll('.', '/') + '.js')); |
460 return files; | 474 return files; |
461 }(); | 475 }(); |
462 | 476 |
463 final _log = new Logger('dev_compiler.src.compiler'); | 477 final _log = new Logger('dev_compiler.src.compiler'); |
OLD | NEW |