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 library analyzer.source.embedder; | 5 library analyzer.source.embedder; |
6 | 6 |
7 import 'dart:collection' show HashMap; | 7 import 'dart:collection' show HashMap; |
8 import 'dart:core' hide Resource; | 8 import 'dart:core' hide Resource; |
9 | 9 |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 /// top level key 'embedded_libs'. Under the 'embedded_libs' key are key value | 121 /// top level key 'embedded_libs'. Under the 'embedded_libs' key are key value |
122 /// pairs. Each key is a 'dart:' library uri and each value is a path | 122 /// pairs. Each key is a 'dart:' library uri and each value is a path |
123 /// (relative to the directory containing `_embedder.yaml`) to a dart script | 123 /// (relative to the directory containing `_embedder.yaml`) to a dart script |
124 /// for the given library. For example: | 124 /// for the given library. For example: |
125 /// | 125 /// |
126 /// embedded_libs: | 126 /// embedded_libs: |
127 /// 'dart:io': '../../sdk/io/io.dart' | 127 /// 'dart:io': '../../sdk/io/io.dart' |
128 /// | 128 /// |
129 /// If a key doesn't begin with `dart:` it is ignored. | 129 /// If a key doesn't begin with `dart:` it is ignored. |
130 /// | 130 /// |
| 131 /// This class is deprecated; use DartUriResolver directly. In particular, if |
| 132 /// there used to be an instance creation of the form: |
| 133 /// |
| 134 /// ``` |
| 135 /// new EmbedderUriResolver(embedderMap) |
| 136 /// ``` |
| 137 /// |
| 138 /// This should be replaced by |
| 139 /// |
| 140 /// ``` |
| 141 /// new DartUriResolver(new EmbedderSdk(embedderMap)) |
| 142 /// ``` |
| 143 @deprecated |
131 class EmbedderUriResolver implements DartUriResolver { | 144 class EmbedderUriResolver implements DartUriResolver { |
132 EmbedderSdk _embedderSdk; | 145 EmbedderSdk _embedderSdk; |
133 DartUriResolver _dartUriResolver; | 146 DartUriResolver _dartUriResolver; |
134 | 147 |
135 /// Construct a [EmbedderUriResolver] from a package map | 148 /// Construct a [EmbedderUriResolver] from a package map |
136 /// (see [PackageMapProvider]). | 149 /// (see [PackageMapProvider]). |
137 EmbedderUriResolver(Map<Folder, YamlMap> embedderMap) | 150 EmbedderUriResolver(Map<Folder, YamlMap> embedderMap) |
138 : this._forSdk(new EmbedderSdk(embedderMap)); | 151 : this._forSdk(new EmbedderSdk(embedderMap)); |
139 | 152 |
140 /// (Provisional API.) | 153 /// (Provisional API.) |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 String _readEmbedderYaml(Folder libDir) { | 236 String _readEmbedderYaml(Folder libDir) { |
224 File file = libDir.getChild(EMBEDDER_FILE_NAME); | 237 File file = libDir.getChild(EMBEDDER_FILE_NAME); |
225 try { | 238 try { |
226 return file.readAsStringSync(); | 239 return file.readAsStringSync(); |
227 } on FileSystemException { | 240 } on FileSystemException { |
228 // File can't be read. | 241 // File can't be read. |
229 return null; | 242 return null; |
230 } | 243 } |
231 } | 244 } |
232 } | 245 } |
OLD | NEW |