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

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

Issue 53313007: Change dart:io Platform.script to return a URI. Change all uses of Platform.script to work with th… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix dom.py docs 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
Index: pkg/docgen/lib/docgen.dart
diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart
index 7378afe7899d9ec67d73edf848f0bb4bf8b64721..1d147c700b939ff33238a2477ac1a655d24d329c 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -249,8 +249,7 @@ 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 = path.join(path.dirname(path.dirname(path.dirname(path.dirname(
- path.absolute(Platform.script))))), 'sdk');
+ var sdkRoot = Platform.script.resolve('../../../sdk').toFilePath();
logger.info('SDK Root: ${sdkRoot}');
return _analyzeLibraries(libraries, sdkRoot, packageRoot: packageRoot);
}
@@ -479,10 +478,9 @@ void _mdnComment(Indexable item) {
//Check if MDN is loaded.
if (_mdn == null) {
// Reading in MDN related json file.
- var mdnDir = path.join(path.dirname(path.dirname(path.dirname(path.dirname(
- path.absolute(Platform.script))))), 'utils', 'apidoc', 'mdn');
- _mdn = JSON.decode(new File(path.join(mdnDir, 'database.json'))
- .readAsStringSync());
+ var mdnDatabase =
+ Platform.script.resolve('../../../utils/apidoc/mdn/database.json');
+ _mdn = JSON.decode(new File(mdnDatabase.toFilePath()).readAsStringSync());
}
if (item.comment.isNotEmpty) return;
var domAnnotation = item.annotations.firstWhere(

Powered by Google App Engine
This is Rietveld 408576698