Chromium Code Reviews| Index: pkg/docgen/lib/docgen.dart |
| diff --git a/pkg/docgen/lib/docgen.dart b/pkg/docgen/lib/docgen.dart |
| index dd5ae22b2663fbe0bd14208532c462bd02d033c5..5989a7a7d2dcd2831c2f8c4d32267050dbccedde 100644 |
| --- a/pkg/docgen/lib/docgen.dart |
| +++ b/pkg/docgen/lib/docgen.dart |
| @@ -60,10 +60,16 @@ markdown.Resolver linkResolver; |
| * If [parseSdk] is 'true', then all Dart SDK libraries will be documented. |
| * This option is useful when only the SDK libraries are needed. |
|
Emily Fortuna
2013/07/03 20:24:40
can we add some documentation explaining what a re
janicejl
2013/07/03 21:25:08
Done.
|
| */ |
| -void docgen(List<String> files, {String packageRoot, bool outputToYaml: true, |
| - bool includePrivate: false, bool includeSdk: false, bool parseSdk: false}) { |
| +Future<bool> docgen(List<String> files, {String packageRoot, |
| + bool outputToYaml: true, bool includePrivate: false, bool includeSdk: false, |
| + bool parseSdk: false}) { |
| + var docgenResult = new Completer<bool>(); |
|
Andrei Mouravski
2013/07/03 20:19:00
You can do this without a completer.
Also, you don
Andrei Mouravski
2013/07/03 21:04:52
Sorry, was trying to reply quickly.
You can just
janicejl
2013/07/03 21:25:08
Done.
|
| + |
| if (packageRoot == null && !parseSdk) { |
| - packageRoot = _findPackageRoot(files.first); |
| + if (FileSystemEntity.typeSync(files.first) |
|
Andrei Mouravski
2013/07/03 20:19:00
Why do you do this?
janicejl
2013/07/03 21:25:08
To only pass in a directory. Before we were only s
Andrei Mouravski
2013/07/03 21:27:50
Um, okay. This code needs to be tested a bunch (no
janicejl
2013/07/03 21:46:45
Done.
|
| + == FileSystemEntityType.DIRECTORY) { |
| + packageRoot = _findPackageRoot(files.first); |
| + } |
| } |
| logger.info('Package Root: ${packageRoot}'); |
| @@ -78,7 +84,10 @@ void docgen(List<String> files, {String packageRoot, bool outputToYaml: true, |
| _documentLibraries(mirrorSystem.libraries.values, |
| includeSdk: includeSdk, includePrivate: includePrivate, |
| outputToYaml: outputToYaml); |
| - }); |
| + }).then((e) => docgenResult.complete(true)) |
| + .catchError((e) => docgenResult.complete(false)); |
| + |
| + return docgenResult.future; |
| } |
| List<String> _listLibraries(List<String> args) { |