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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/analyzer/lib/src/generated/sdk_io.dart
diff --git a/analyzer/lib/src/generated/sdk_io.dart b/packages/analyzer/lib/src/generated/sdk_io.dart
similarity index 92%
rename from analyzer/lib/src/generated/sdk_io.dart
rename to packages/analyzer/lib/src/generated/sdk_io.dart
index bcdb33d8ed8f92d1c9b16adf1528f09febaa33ac..b155b9a784f0d0f9adde775b83fb4843bfb7c4f2 100644
--- a/analyzer/lib/src/generated/sdk_io.dart
+++ b/packages/analyzer/lib/src/generated/sdk_io.dart
@@ -2,9 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// This code was auto-generated, is not intended to be edited, and is subject to
-// significant change. Please see the README file for more information.
-
library engine.sdk.io;
import 'dart:io';
@@ -342,8 +339,10 @@ class DirectoryBasedDartSdk implements DartSdk {
JavaFile get pubExecutable {
if (_pubExecutable == null) {
_pubExecutable = _verifyExecutable(new JavaFile.relative(
- new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME), OSUtilities
- .isWindows() ? _PUB_EXECUTABLE_NAME_WIN : _PUB_EXECUTABLE_NAME));
+ new JavaFile.relative(_sdkDirectory, _BIN_DIRECTORY_NAME),
+ OSUtilities.isWindows()
+ ? _PUB_EXECUTABLE_NAME_WIN
+ : _PUB_EXECUTABLE_NAME));
}
return _pubExecutable;
}
@@ -400,6 +399,22 @@ class DirectoryBasedDartSdk implements DartSdk {
return _vmExecutable;
}
+ /**
+ * Determine the search order for trying to locate the [_LIBRARIES_FILE].
+ */
+ Iterable<JavaFile> get _libraryMapLocations sync* {
+ yield new JavaFile.relative(
+ new JavaFile.relative(
+ new JavaFile.relative(
+ new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
+ _SDK_LIBRARY_METADATA_DIR),
+ _SDK_LIBRARY_METADATA_LIB_DIR),
+ _LIBRARIES_FILE);
+ yield new JavaFile.relative(
+ new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
+ _LIBRARIES_FILE);
+ }
+
@override
Source fromFileUri(Uri uri) {
JavaFile file = new JavaFile.fromUri(uri);
@@ -474,23 +489,24 @@ class DirectoryBasedDartSdk implements DartSdk {
* is available. Return the initialized library map.
*/
LibraryMap initialLibraryMap(bool useDart2jsPaths) {
- JavaFile librariesFile = new JavaFile.relative(
- new JavaFile.relative(
- new JavaFile.relative(
- new JavaFile.relative(libraryDirectory, _INTERNAL_DIR),
- _SDK_LIBRARY_METADATA_DIR),
- _SDK_LIBRARY_METADATA_LIB_DIR),
- _LIBRARIES_FILE);
- try {
- String contents = librariesFile.readAsStringSync();
- return new SdkLibrariesReader(useDart2jsPaths).readFromFile(
- librariesFile, contents);
- } catch (exception, stackTrace) {
- AnalysisEngine.instance.logger.logError(
- "Could not initialize the library map from ${librariesFile.getAbsolutePath()}",
- new CaughtException(exception, stackTrace));
- return new LibraryMap();
+ List<String> searchedPaths = <String>[];
+ var lastStackTrace = null;
+ var lastException = null;
+ for (JavaFile librariesFile in _libraryMapLocations) {
+ try {
+ String contents = librariesFile.readAsStringSync();
+ return new SdkLibrariesReader(useDart2jsPaths)
+ .readFromFile(librariesFile, contents);
+ } catch (exception, stackTrace) {
+ searchedPaths.add(librariesFile.getAbsolutePath());
+ lastException = exception;
+ lastStackTrace = stackTrace;
+ }
}
+ AnalysisEngine.instance.logger.logError(
+ "Could not initialize the library map from $searchedPaths",
+ new CaughtException(lastException, lastStackTrace));
+ return new LibraryMap();
}
@override
« 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