OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file |
| 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.md file. |
| 4 |
| 5 part of fletchc.fletch_compiler; |
| 6 |
| 7 abstract class FletchCompilerHack extends apiimpl.Compiler { |
| 8 FletchCompilerHack( |
| 9 api.CompilerInputProvider provider, |
| 10 api.CompilerOutputProvider outputProvider, |
| 11 api.DiagnosticHandler handler, |
| 12 Uri libraryRoot, |
| 13 Uri packageRoot, |
| 14 List<String> options, |
| 15 Map<String, dynamic> environment) |
| 16 : super(provider, outputProvider, handler, libraryRoot, packageRoot, |
| 17 options, environment) { |
| 18 switchBackendHack(); |
| 19 } |
| 20 |
| 21 void switchBackendHack() { |
| 22 // TODO(ahe): Modify dart2js to support a custom backend directly, and |
| 23 // remove this method. |
| 24 int backendTaskCount = backend.tasks.length; |
| 25 int apiimplTaskCount = 2; |
| 26 int baseTaskCount = tasks.length - backendTaskCount - apiimplTaskCount; |
| 27 |
| 28 tasks.removeRange(baseTaskCount, baseTaskCount + backendTaskCount); |
| 29 |
| 30 backend = new FletchBackend(this); |
| 31 tasks.addAll(backend.tasks); |
| 32 } |
| 33 } |
OLD | NEW |