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

Unified Diff: pkg/docgen/lib/src/package_helpers.dart

Issue 736923002: Revert revision 41812 "Let docgen detect a dart-sdk directory that's differently named" (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/docgen/lib/src/package_helpers.dart
===================================================================
--- pkg/docgen/lib/src/package_helpers.dart (revision 41820)
+++ pkg/docgen/lib/src/package_helpers.dart (working copy)
@@ -23,17 +23,10 @@
var scriptDir = path.absolute(path.dirname(Platform.script.toFilePath()));
var root = scriptDir;
var base = path.basename(root);
- var found = false;
- // When we find a version file or sdk we are one level below the root.
- while (!found && base != 'sdk' && base != 'pkg') {
+ // When we find dart-sdk or sdk we are one level below the root.
+ while (base != 'dart-sdk' && base != 'sdk' && base != 'pkg') {
root = path.dirname(root);
base = path.basename(root);
- // Look for something that looks like the dart-sdk directory, which we
- // expect to be in the path above us and to have a 'version' file containing
- // the same version as we are running.
- if (hasMatchingVersionFile(root)) {
- found = true;
- }
if (root == base) {
// We have reached the root of the filesystem without finding anything.
throw new FileSystemException("Cannot find SDK directory starting from ",
@@ -45,17 +38,6 @@
}
String _rootDirectoryCache;
-
-/// Does this directory contain a version file that has the same version as
-/// we do.
-bool hasMatchingVersionFile(String root) {
- var versionFile = new File(path.join(root, 'version'));
- if (!versionFile.existsSync()) return false;
- var version = versionFile.readAsStringSync().trim();
- var vmVersion = Platform.version;
- return vmVersion.startsWith(version);
-}
-
/// Given a LibraryMirror that is a library, return the name of the directory
/// holding the package information for that library. If the library is not
/// part of a package, return null.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698