OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 library dart2js_incremental; | 5 library dart2js_incremental; |
6 | 6 |
7 import 'dart:async' show | 7 import 'dart:async' show |
8 EventSink, | 8 EventSink, |
9 Future; | 9 Future; |
10 | 10 |
11 import 'dart:profiler' show | 11 import 'dart:profiler' show |
12 UserTag; | 12 UserTag; |
13 | 13 |
14 import 'package:compiler/src/apiimpl.dart' show | 14 import 'package:compiler/src/apiimpl.dart' show |
15 Compiler; | 15 Compiler; |
16 | 16 |
17 import 'package:compiler/compiler.dart' show | 17 import 'package:compiler/compiler_new.dart' show |
18 CompilerInputProvider, | 18 CompilerDiagnostics, |
19 CompilerOutputProvider, | 19 CompilerInput, |
20 Diagnostic, | 20 CompilerOutput, |
21 DiagnosticHandler; | 21 Diagnostic; |
22 | 22 |
23 import 'package:compiler/src/dart2jslib.dart' show | 23 import 'package:compiler/src/dart2jslib.dart' show |
24 NullSink; | 24 NullSink; |
25 | 25 |
26 import 'package:compiler/src/js_backend/js_backend.dart' show | 26 import 'package:compiler/src/js_backend/js_backend.dart' show |
27 JavaScriptBackend; | 27 JavaScriptBackend; |
28 | 28 |
29 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' | 29 import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' |
30 as full show Emitter; | 30 as full show Emitter; |
31 | 31 |
(...skipping 12 matching lines...) Expand all Loading... |
44 const List<String> INCREMENTAL_OPTIONS = const <String>[ | 44 const List<String> INCREMENTAL_OPTIONS = const <String>[ |
45 '--disable-type-inference', | 45 '--disable-type-inference', |
46 '--incremental-support', | 46 '--incremental-support', |
47 '--generate-code-with-compile-time-errors', | 47 '--generate-code-with-compile-time-errors', |
48 '--no-source-maps', // TODO(ahe): Remove this. | 48 '--no-source-maps', // TODO(ahe): Remove this. |
49 ]; | 49 ]; |
50 | 50 |
51 class IncrementalCompiler { | 51 class IncrementalCompiler { |
52 final Uri libraryRoot; | 52 final Uri libraryRoot; |
53 final Uri packageRoot; | 53 final Uri packageRoot; |
54 final CompilerInputProvider inputProvider; | 54 final CompilerInput inputProvider; |
55 final DiagnosticHandler diagnosticHandler; | 55 final CompilerDiagnostics diagnosticHandler; |
56 final List<String> options; | 56 final List<String> options; |
57 final CompilerOutputProvider outputProvider; | 57 final CompilerOutput outputProvider; |
58 final Map<String, dynamic> environment; | 58 final Map<String, dynamic> environment; |
59 final List<String> _updates = <String>[]; | 59 final List<String> _updates = <String>[]; |
60 final IncrementalCompilerContext _context = new IncrementalCompilerContext(); | 60 final IncrementalCompilerContext _context = new IncrementalCompilerContext(); |
61 | 61 |
62 Compiler _compiler; | 62 Compiler _compiler; |
63 | 63 |
64 IncrementalCompiler({ | 64 IncrementalCompiler({ |
65 this.libraryRoot, | 65 this.libraryRoot, |
66 this.packageRoot, | 66 this.packageRoot, |
67 this.inputProvider, | 67 this.inputProvider, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 class IncrementalCompilationFailed { | 166 class IncrementalCompilationFailed { |
167 final String reason; | 167 final String reason; |
168 | 168 |
169 const IncrementalCompilationFailed(this.reason); | 169 const IncrementalCompilationFailed(this.reason); |
170 | 170 |
171 String toString() => "Can't incrementally compile program.\n\n$reason"; | 171 String toString() => "Can't incrementally compile program.\n\n$reason"; |
172 } | 172 } |
OLD | NEW |