| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.sdk.io; | 8 library engine.sdk.io; |
| 9 | 9 |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 _analysisContext = new AnalysisContextImpl(); | 182 _analysisContext = new AnalysisContextImpl(); |
| 183 _analysisContext.sourceFactory = new SourceFactory([new DartUriResolver(this
)]); | 183 _analysisContext.sourceFactory = new SourceFactory([new DartUriResolver(this
)]); |
| 184 List<String> uris = this.uris; | 184 List<String> uris = this.uris; |
| 185 ChangeSet changeSet = new ChangeSet(); | 185 ChangeSet changeSet = new ChangeSet(); |
| 186 for (String uri in uris) { | 186 for (String uri in uris) { |
| 187 changeSet.addedSource(_analysisContext.sourceFactory.forUri(uri)); | 187 changeSet.addedSource(_analysisContext.sourceFactory.forUri(uri)); |
| 188 } | 188 } |
| 189 _analysisContext.applyChanges(changeSet); | 189 _analysisContext.applyChanges(changeSet); |
| 190 } | 190 } |
| 191 | 191 |
| 192 @override |
| 192 Source fromEncoding(UriKind kind, Uri uri) => new FileBasedSource.con2(new Jav
aFile.fromUri(uri), kind); | 193 Source fromEncoding(UriKind kind, Uri uri) => new FileBasedSource.con2(new Jav
aFile.fromUri(uri), kind); |
| 193 | 194 |
| 195 @override |
| 194 AnalysisContext get context => _analysisContext; | 196 AnalysisContext get context => _analysisContext; |
| 195 | 197 |
| 196 /** | 198 /** |
| 197 * Return the file containing the Dartium executable, or `null` if it does not
exist. | 199 * Return the file containing the Dartium executable, or `null` if it does not
exist. |
| 198 * | 200 * |
| 199 * @return the file containing the Dartium executable | 201 * @return the file containing the Dartium executable |
| 200 */ | 202 */ |
| 201 JavaFile get dartiumExecutable { | 203 JavaFile get dartiumExecutable { |
| 202 if (_dartiumExecutable == null) { | 204 if (_dartiumExecutable == null) { |
| 203 JavaFile file = new JavaFile.relative(dartiumWorkingDirectory, dartiumBina
ryName); | 205 JavaFile file = new JavaFile.relative(dartiumWorkingDirectory, dartiumBina
ryName); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 * Return the file containing the Pub executable, or `null` if it does not exi
st. | 264 * Return the file containing the Pub executable, or `null` if it does not exi
st. |
| 263 * | 265 * |
| 264 * @return the file containing the Pub executable | 266 * @return the file containing the Pub executable |
| 265 */ | 267 */ |
| 266 JavaFile get pubExecutable { | 268 JavaFile get pubExecutable { |
| 267 String pubBinaryName = OSUtilities.isWindows() ? _PUB_EXECUTABLE_NAME_WIN :
_PUB_EXECUTABLE_NAME; | 269 String pubBinaryName = OSUtilities.isWindows() ? _PUB_EXECUTABLE_NAME_WIN :
_PUB_EXECUTABLE_NAME; |
| 268 JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _
BIN_DIRECTORY_NAME), pubBinaryName); | 270 JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory, _
BIN_DIRECTORY_NAME), pubBinaryName); |
| 269 return file.exists() ? file : null; | 271 return file.exists() ? file : null; |
| 270 } | 272 } |
| 271 | 273 |
| 274 @override |
| 272 List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries; | 275 List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries; |
| 273 | 276 |
| 277 @override |
| 274 SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri); | 278 SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri); |
| 275 | 279 |
| 276 /** | 280 /** |
| 277 * Return the revision number of this SDK, or `"0"` if the revision number can
not be | 281 * Return the revision number of this SDK, or `"0"` if the revision number can
not be |
| 278 * discovered. | 282 * discovered. |
| 279 * | 283 * |
| 280 * @return the revision number of this SDK | 284 * @return the revision number of this SDK |
| 281 */ | 285 */ |
| 286 @override |
| 282 String get sdkVersion { | 287 String get sdkVersion { |
| 283 if (_sdkVersion == null) { | 288 if (_sdkVersion == null) { |
| 284 _sdkVersion = DartSdk.DEFAULT_VERSION; | 289 _sdkVersion = DartSdk.DEFAULT_VERSION; |
| 285 JavaFile revisionFile = new JavaFile.relative(_sdkDirectory, _REVISION_FIL
E_NAME); | 290 JavaFile revisionFile = new JavaFile.relative(_sdkDirectory, _REVISION_FIL
E_NAME); |
| 286 try { | 291 try { |
| 287 String revision = revisionFile.readAsStringSync(); | 292 String revision = revisionFile.readAsStringSync(); |
| 288 if (revision != null) { | 293 if (revision != null) { |
| 289 _sdkVersion = revision; | 294 _sdkVersion = revision; |
| 290 } | 295 } |
| 291 } on JavaIOException catch (exception) { | 296 } on JavaIOException catch (exception) { |
| 292 } | 297 } |
| 293 } | 298 } |
| 294 return _sdkVersion; | 299 return _sdkVersion; |
| 295 } | 300 } |
| 296 | 301 |
| 297 /** | 302 /** |
| 298 * Return an array containing the library URI's for the libraries defined in t
his SDK. | 303 * Return an array containing the library URI's for the libraries defined in t
his SDK. |
| 299 * | 304 * |
| 300 * @return the library URI's for the libraries defined in this SDK | 305 * @return the library URI's for the libraries defined in this SDK |
| 301 */ | 306 */ |
| 307 @override |
| 302 List<String> get uris => _libraryMap.uris; | 308 List<String> get uris => _libraryMap.uris; |
| 303 | 309 |
| 304 /** | 310 /** |
| 305 * Return the file containing the VM executable, or `null` if it does not exis
t. | 311 * Return the file containing the VM executable, or `null` if it does not exis
t. |
| 306 * | 312 * |
| 307 * @return the file containing the VM executable | 313 * @return the file containing the VM executable |
| 308 */ | 314 */ |
| 309 JavaFile get vmExecutable { | 315 JavaFile get vmExecutable { |
| 310 if (_vmExecutable == null) { | 316 if (_vmExecutable == null) { |
| 311 JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory,
_BIN_DIRECTORY_NAME), vmBinaryName); | 317 JavaFile file = new JavaFile.relative(new JavaFile.relative(_sdkDirectory,
_BIN_DIRECTORY_NAME), vmBinaryName); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 323 */ | 329 */ |
| 324 bool get hasDocumentation => docDirectory.exists(); | 330 bool get hasDocumentation => docDirectory.exists(); |
| 325 | 331 |
| 326 /** | 332 /** |
| 327 * Return `true` if the Dartium binary is available. | 333 * Return `true` if the Dartium binary is available. |
| 328 * | 334 * |
| 329 * @return `true` if the Dartium binary is available | 335 * @return `true` if the Dartium binary is available |
| 330 */ | 336 */ |
| 331 bool get isDartiumInstalled => dartiumExecutable != null; | 337 bool get isDartiumInstalled => dartiumExecutable != null; |
| 332 | 338 |
| 339 @override |
| 333 Source mapDartUri(String dartUri) { | 340 Source mapDartUri(String dartUri) { |
| 334 SdkLibrary library = getSdkLibrary(dartUri); | 341 SdkLibrary library = getSdkLibrary(dartUri); |
| 335 if (library == null) { | 342 if (library == null) { |
| 336 return null; | 343 return null; |
| 337 } | 344 } |
| 338 return new FileBasedSource.con2(new JavaFile.relative(libraryDirectory, libr
ary.path), UriKind.DART_URI); | 345 return new FileBasedSource.con2(new JavaFile.relative(libraryDirectory, libr
ary.path), UriKind.DART_URI); |
| 339 } | 346 } |
| 340 | 347 |
| 341 /** | 348 /** |
| 342 * Ensure that the dart VM is executable. If it is not, make it executable and
log that it was | 349 * Ensure that the dart VM is executable. If it is not, make it executable and
log that it was |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 Parser parser = new Parser(source, errorListener); | 467 Parser parser = new Parser(source, errorListener); |
| 461 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); | 468 CompilationUnit unit = parser.parseCompilationUnit(scanner.tokenize()); |
| 462 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li
braryBuilder(_useDart2jsPaths); | 469 SdkLibrariesReader_LibraryBuilder libraryBuilder = new SdkLibrariesReader_Li
braryBuilder(_useDart2jsPaths); |
| 463 // If any syntactic errors were found then don't try to visit the AST struct
ure. | 470 // If any syntactic errors were found then don't try to visit the AST struct
ure. |
| 464 if (!errorListener.errorReported) { | 471 if (!errorListener.errorReported) { |
| 465 unit.accept(libraryBuilder); | 472 unit.accept(libraryBuilder); |
| 466 } | 473 } |
| 467 return libraryBuilder.librariesMap; | 474 return libraryBuilder.librariesMap; |
| 468 } | 475 } |
| 469 } | 476 } |
| OLD | NEW |