| 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(
|
|
|