Chromium Code Reviews| Index: utils/apidoc/apidoc.dart |
| diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart |
| index a4fbe43c5b1433316b74d7b5b176b410ed0d72aa..61039aa32684db81b534efa3306e6ccc83debb52 100644 |
| --- a/utils/apidoc/apidoc.dart |
| +++ b/utils/apidoc/apidoc.dart |
| @@ -104,10 +104,10 @@ void main() { |
| // TODO(johnniwinther): Libraries for the compilation seem to be more like |
| // URIs. Perhaps Path should have a toURI() method. |
| // Add all of the core libraries. |
| - final apidocLibraries = <Path>[]; |
| + final apidocLibraries = <Uri>[]; |
| LIBRARIES.forEach((String name, LibraryInfo info) { |
| if (info.documented) { |
| - apidocLibraries.add(new Path('dart:$name')); |
| + apidocLibraries.add(Uri.parse('dart:$name')); |
| } |
| }); |
| @@ -130,7 +130,7 @@ void main() { |
| } |
| if (new File.fromPath(libPath).existsSync()) { |
| - apidocLibraries.add(libPath); |
| + apidocLibraries.add(_pathToFileUri(libPath.toNativePath())); |
| includedLibraries.add(libName); |
| } else { |
| print('Warning: could not find package at $path'); |
| @@ -147,7 +147,7 @@ void main() { |
| // TODO(amouravski): make apidoc use roughly the same flow as bin/dartdoc. |
| Future.wait([copiedStatic, copiedApiDocStatic, htmlDiff]) |
| - .then((_) => apidoc.documentLibraries( apidocLibraries, libPath, |
| + .then((_) => apidoc.documentLibraries(apidocLibraries, libPath, |
| packageRoot)) |
| .then((_) => compileScript(mode, outputDir, libPath)) |
| .then((_) => print(apidoc.status)) |
| @@ -447,3 +447,14 @@ class Apidoc extends Dartdoc { |
| return a(memberUrl(member), memberName); |
| } |
| } |
| + |
| +/** Converts a local path string to a `file:` [Uri]. */ |
|
Andrei Mouravski
2013/04/09 01:48:36
Instead of copypasta, import dartdoc/utils
nweiz
2013/04/09 02:10:23
I don't like importing utils across projects. It b
Andrei Mouravski
2013/04/09 02:13:49
In which case, putting the function into lib/dartd
|
| +Uri _pathToFileUri(String pathString) { |
| + pathString = path.absolute(pathString); |
| + if (Platform.operatingSystem != 'windows') { |
| + return Uri.parse('file://$pathString'); |
| + } else { |
| + return Uri.parse('file:///${pathString.replaceAll("\\", "/")}'); |
| + } |
| +} |
| + |