Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(369)

Side by Side Diff: packages/analyzer/lib/src/generated/sdk_io.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
6 // significant change. Please see the README file for more information.
7
8 library engine.sdk.io; 5 library engine.sdk.io;
9 6
10 import 'dart:io'; 7 import 'dart:io';
11 8
12 import 'package:analyzer/src/context/context.dart' as newContext; 9 import 'package:analyzer/src/context/context.dart' as newContext;
13 import 'package:analyzer/src/generated/java_engine.dart'; 10 import 'package:analyzer/src/generated/java_engine.dart';
14 11
15 import 'ast.dart'; 12 import 'ast.dart';
16 import 'engine.dart'; 13 import 'engine.dart';
17 import 'error.dart'; 14 import 'error.dart';
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 */ 332 */
336 JavaFile get libraryDirectory => 333 JavaFile get libraryDirectory =>
337 new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME); 334 new JavaFile.relative(_sdkDirectory, _LIB_DIRECTORY_NAME);
338 335
339 /** 336 /**
340 * Return the file containing the Pub executable, or `null` if it does not exi st. 337 * Return the file containing the Pub executable, or `null` if it does not exi st.
341 */ 338 */
342 JavaFile get pubExecutable { 339 JavaFile get pubExecutable {
343 if (_pubExecutable == null) { 340 if (_pubExecutable == null) {
344 _pubExecutable = _verifyExecutable(new JavaFile.relative( 341 _pubExecutable = _verifyExecutable(new JavaFile.relative(
345 new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities 342 new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
346 .isWindows() ? _PUB_EXECUTABLE_NAME_WIN : _PUB_EXECUTABLE_NAME)); 343 OSUtilities.isWindows()
344 ? _PUB_EXECUTABLE_NAME_WIN
345 : _PUB_EXECUTABLE_NAME));
347 } 346 }
348 return _pubExecutable; 347 return _pubExecutable;
349 } 348 }
350 349
351 @override 350 @override
352 List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries; 351 List<SdkLibrary> get sdkLibraries => _libraryMap.sdkLibraries;
353 352
354 /** 353 /**
355 * Return the revision number of this SDK, or `"0"` if the revision number 354 * Return the revision number of this SDK, or `"0"` if the revision number
356 * cannot be discovered. 355 * cannot be discovered.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 */ 392 */
394 JavaFile get vmExecutable { 393 JavaFile get vmExecutable {
395 if (_vmExecutable == null) { 394 if (_vmExecutable == null) {
396 _vmExecutable = _verifyExecutable(new JavaFile.relative( 395 _vmExecutable = _verifyExecutable(new JavaFile.relative(
397 new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), 396 new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
398 vmBinaryName)); 397 vmBinaryName));
399 } 398 }
400 return _vmExecutable; 399 return _vmExecutable;
401 } 400 }
402 401
402 /**
403 * Determine the search order for trying to locate the [_LIBRARIES_FILE].
404 */
405 Iterable<JavaFile> get _libraryMapLocations sync* {
406 yield new JavaFile.relative(
407 new JavaFile.relative(
408 new JavaFile.relative(
409 new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
410 _SDK_LIBRARY_METADATA_DIR),
411 _SDK_LIBRARY_METADATA_LIB_DIR),
412 _LIBRARIES_FILE);
413 yield new JavaFile.relative(
414 new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
415 _LIBRARIES_FILE);
416 }
417
403 @override 418 @override
404 Source fromFileUri(Uri uri) { 419 Source fromFileUri(Uri uri) {
405 JavaFile file = new JavaFile.fromUri(uri); 420 JavaFile file = new JavaFile.fromUri(uri);
406 String filePath = file.getAbsolutePath(); 421 String filePath = file.getAbsolutePath();
407 String libPath = libraryDirectory.getAbsolutePath(); 422 String libPath = libraryDirectory.getAbsolutePath();
408 if (!filePath.startsWith("$libPath${JavaFile.separator}")) { 423 if (!filePath.startsWith("$libPath${JavaFile.separator}")) {
409 return null; 424 return null;
410 } 425 }
411 filePath = filePath.substring(libPath.length + 1); 426 filePath = filePath.substring(libPath.length + 1);
412 for (SdkLibrary library in _libraryMap.sdkLibraries) { 427 for (SdkLibrary library in _libraryMap.sdkLibraries) {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 482
468 @override 483 @override
469 SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri); 484 SdkLibrary getSdkLibrary(String dartUri) => _libraryMap.getLibrary(dartUri);
470 485
471 /** 486 /**
472 * Read all of the configuration files to initialize the library maps. The 487 * Read all of the configuration files to initialize the library maps. The
473 * flag [useDart2jsPaths] is `true` if the dart2js path should be used when it 488 * flag [useDart2jsPaths] is `true` if the dart2js path should be used when it
474 * is available. Return the initialized library map. 489 * is available. Return the initialized library map.
475 */ 490 */
476 LibraryMap initialLibraryMap(bool useDart2jsPaths) { 491 LibraryMap initialLibraryMap(bool useDart2jsPaths) {
477 JavaFile librariesFile = new JavaFile.relative( 492 List<String> searchedPaths = <String>[];
478 new JavaFile.relative( 493 var lastStackTrace = null;
479 new JavaFile.relative( 494 var lastException = null;
480 new JavaFile.relative(libraryDirectory, _INTERNAL_DIR), 495 for (JavaFile librariesFile in _libraryMapLocations) {
481 _SDK_LIBRARY_METADATA_DIR), 496 try {
482 _SDK_LIBRARY_METADATA_LIB_DIR), 497 String contents = librariesFile.readAsStringSync();
483 _LIBRARIES_FILE); 498 return new SdkLibrariesReader(useDart2jsPaths)
484 try { 499 .readFromFile(librariesFile, contents);
485 String contents = librariesFile.readAsStringSync(); 500 } catch (exception, stackTrace) {
486 return new SdkLibrariesReader(useDart2jsPaths).readFromFile( 501 searchedPaths.add(librariesFile.getAbsolutePath());
487 librariesFile, contents); 502 lastException = exception;
488 } catch (exception, stackTrace) { 503 lastStackTrace = stackTrace;
489 AnalysisEngine.instance.logger.logError( 504 }
490 "Could not initialize the library map from ${librariesFile.getAbsolute Path()}",
491 new CaughtException(exception, stackTrace));
492 return new LibraryMap();
493 } 505 }
506 AnalysisEngine.instance.logger.logError(
507 "Could not initialize the library map from $searchedPaths",
508 new CaughtException(lastException, lastStackTrace));
509 return new LibraryMap();
494 } 510 }
495 511
496 @override 512 @override
497 Source mapDartUri(String dartUri) { 513 Source mapDartUri(String dartUri) {
498 String libraryName; 514 String libraryName;
499 String relativePath; 515 String relativePath;
500 int index = dartUri.indexOf('/'); 516 int index = dartUri.indexOf('/');
501 if (index >= 0) { 517 if (index >= 0) {
502 libraryName = dartUri.substring(0, index); 518 libraryName = dartUri.substring(0, index);
503 relativePath = dartUri.substring(index + 1); 519 relativePath = dartUri.substring(index + 1);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 SdkLibrariesReader_LibraryBuilder libraryBuilder = 601 SdkLibrariesReader_LibraryBuilder libraryBuilder =
586 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths); 602 new SdkLibrariesReader_LibraryBuilder(_useDart2jsPaths);
587 // If any syntactic errors were found then don't try to visit the AST 603 // If any syntactic errors were found then don't try to visit the AST
588 // structure. 604 // structure.
589 if (!errorListener.errorReported) { 605 if (!errorListener.errorReported) {
590 unit.accept(libraryBuilder); 606 unit.accept(libraryBuilder);
591 } 607 }
592 return libraryBuilder.librariesMap; 608 return libraryBuilder.librariesMap;
593 } 609 }
594 } 610 }
OLDNEW
« no previous file with comments | « packages/analyzer/lib/src/generated/sdk.dart ('k') | packages/analyzer/lib/src/generated/source.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698