| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_util; | 5 library dart2js_util; |
| 6 | 6 |
| 7 // TODO(tmandel): This is a temporary copy of the dart2js_mirrors.dart |
| 8 // file in the dartdoc folder. One of the two should be deleted |
| 9 // when docgen can replace dartdoc. |
| 10 |
| 7 import 'dart:async' show Future; | 11 import 'dart:async' show Future; |
| 8 import 'dart:io' show Path; | 12 import 'dart:io' show Path; |
| 9 | 13 |
| 10 import '../../../compiler/compiler.dart' as api; | 14 import '../../../../sdk/lib/_internal/compiler/compiler.dart' as api; |
| 11 import '../../../compiler/implementation/mirrors/dart2js_mirror.dart' as dart2js | 15 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mi
rror.dart' |
| 12 show analyze, Dart2JsMirrorSystem; | 16 as dart2js show analyze, Dart2JsMirrorSystem; |
| 13 import '../../../compiler/implementation/mirrors/mirrors.dart' | 17 import '../../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.da
rt' |
| 14 show MirrorSystem; | 18 show MirrorSystem; |
| 15 import '../../../compiler/implementation/source_file_provider.dart' | 19 import '../../../../sdk/lib/_internal/compiler/implementation/source_file_provid
er.dart' |
| 16 show FormattingDiagnosticHandler, SourceFileProvider; | 20 show FormattingDiagnosticHandler, SourceFileProvider; |
| 17 import '../../../compiler/implementation/filenames.dart' | 21 import '../../../../sdk/lib/_internal/compiler/implementation/filenames.dart' |
| 18 show appendSlash, currentDirectory; | 22 show appendSlash, currentDirectory; |
| 19 | 23 |
| 20 // TODO(johnniwinther): Support client configurable providers. | 24 // TODO(johnniwinther): Support client configurable providers. |
| 21 | 25 |
| 22 /** | 26 /** |
| 23 * Returns a future that completes to a non-null String when [script] | 27 * Returns a future that completes to a non-null String when [script] |
| 24 * has been successfully compiled. | 28 * has been successfully compiled. |
| 25 */ | 29 */ |
| 26 // TODO(amouravski): Remove this method and call dart2js via a process instead. | 30 // TODO(amouravski): Remove this method and call dart2js via a process instead. |
| 27 Future<String> compile(Path script, | 31 Future<String> compile(Path script, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 packageUri = currentDirectory.resolve(appendSlash('$packageRoot')); | 68 packageUri = currentDirectory.resolve(appendSlash('$packageRoot')); |
| 65 } | 69 } |
| 66 List<Uri> librariesUri = <Uri>[]; | 70 List<Uri> librariesUri = <Uri>[]; |
| 67 for (Path library in libraries) { | 71 for (Path library in libraries) { |
| 68 librariesUri.add(currentDirectory.resolve(library.toString())); | 72 librariesUri.add(currentDirectory.resolve(library.toString())); |
| 69 } | 73 } |
| 70 return dart2js.analyze(librariesUri, libraryUri, packageUri, | 74 return dart2js.analyze(librariesUri, libraryUri, packageUri, |
| 71 provider.readStringFromUri, diagnosticHandler, | 75 provider.readStringFromUri, diagnosticHandler, |
| 72 options); | 76 options); |
| 73 } | 77 } |
| OLD | NEW |