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

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

Issue 55233002: Work around changes to Platform in docgen (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | « 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/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index 1d147c700b939ff33238a2477ac1a655d24d329c..7f4dd9cde1eb0d7d70934aca6c135f7a1dbabe8d 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -249,7 +249,9 @@ Future<MirrorSystem> getMirrorSystem(List<String> args, {String packageRoot,
var libraries = !parseSdk ? _listLibraries(args) : _listSdk();
if (libraries.isEmpty) throw new StateError('No Libraries.');
// Finds the root of SDK library based off the location of docgen.
- var sdkRoot = Platform.script.resolve('../../../sdk').toFilePath();
+ var scriptDir = path.absolute(path.dirname(Platform.script.toFilePath()));
+ var sdkRoot = path.relative('../../../sdk', from: scriptDir);
+ sdkRoot = path.normalize(path.absolute(sdkRoot));
logger.info('SDK Root: ${sdkRoot}');
return _analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot);
}
@@ -478,9 +480,10 @@ void _mdnComment(Indexable item) {
//Check if MDN is loaded.
if (_mdn == null) {
// Reading in MDN related json file.
- var mdnDatabase =
- Platform.script.resolve('../../../utils/apidoc/mdn/database.json');
- _mdn = JSON.decode(new File(mdnDatabase.toFilePath()).readAsStringSync());
+ var scriptDir = path.absolute(path.dirname(Platform.script.toFilePath()));
+ var mdnPath = path.relative('../../../utils/apidoc/mdn/database.json',
+ from: scriptDir);
+ _mdn = JSON.decode(new File(mdnPath).readAsStringSync());
}
if (item.comment.isNotEmpty) return;
var domAnnotation = item.annotations.firstWhere(
« 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