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

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

Issue 18653005: Docgen returning a future (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 dd5ae22b2663fbe0bd14208532c462bd02d033c5..3bd9dbd2240cca1ab80cd2995004e532cb4c7190 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -59,18 +59,24 @@ markdown.Resolver linkResolver;
* also be documented.
* If [parseSdk] is 'true', then all Dart SDK libraries will be documented.
* This option is useful when only the SDK libraries are needed.
+ *
+ * Returns true if docgen sucessfuly completes.
*/
-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}) {
if (packageRoot == null && !parseSdk) {
- packageRoot = _findPackageRoot(files.first);
+ if (FileSystemEntity.typeSync(files.first)
+ == FileSystemEntityType.DIRECTORY) {
+ packageRoot = _findPackageRoot(files.first);
+ }
}
logger.info('Package Root: ${packageRoot}');
linkResolver = (name) =>
fixReference(name, _currentLibrary, _currentClass, _currentMember);
- getMirrorSystem(files, packageRoot, parseSdk: parseSdk)
+ return getMirrorSystem(files, packageRoot, parseSdk: parseSdk)
.then((MirrorSystem mirrorSystem) {
if (mirrorSystem.libraries.isEmpty) {
throw new StateError('No library mirrors were created.');
@@ -78,7 +84,7 @@ void docgen(List<String> files, {String packageRoot, bool outputToYaml: true,
_documentLibraries(mirrorSystem.libraries.values,
includeSdk: includeSdk, includePrivate: includePrivate,
outputToYaml: outputToYaml);
- });
+ }).then((e) => true);
Andrei Mouravski 2013/07/03 21:27:51 Nono, return true inside the first then.
janicejl 2013/07/03 21:46:45 Done.
}
List<String> _listLibraries(List<String> args) {
« 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