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

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

Issue 17745007: Getting docgen to work with the SDK. (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
« pkg/docgen/bin/docgen.dart ('K') | « pkg/docgen/bin/docgen.dart ('k') | 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 52d10d2387f797f8ddb6c516f926ab818d300348..1761cf8885a3714a6447ec430109adf6388c16c1 100644
--- a/pkg/docgen/lib/docgen.dart
+++ b/pkg/docgen/lib/docgen.dart
@@ -33,6 +33,7 @@ import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirro
import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors_util.dart';
import '../../../sdk/lib/_internal/compiler/implementation/source_file_provider.dart';
+import '../../../sdk/lib/_internal/libraries.dart';
var logger = new Logger('Docgen');
@@ -64,8 +65,10 @@ class Docgen {
bool outputToYaml;
bool outputToJson;
bool includePrivate;
- /// State for whether or not the SDK libraries should also be outputted.
+ /// State for whether imported SDK libraries should also be outputted.
bool includeSdk;
+ /// State for whether all SDK libraries should be outputted.
+ bool parseSdk;
/**
* Docgen constructor initializes the link resolver for markdown parsing.
@@ -87,7 +90,8 @@ class Docgen {
}
outputToJson = !outputToYaml;
includePrivate = argResults['include-private'];
- includeSdk = argResults['include-sdk'];
+ parseSdk = argResults['parse-sdk'];
+ includeSdk = parseSdk == true ? true : argResults['include-sdk'];
Andrei Mouravski 2013/06/26 04:42:11 Simply do = parseSdk || arg...
this.linkResolver = (name) =>
fixReference(name, _currentLibrary, _currentClass, _currentMember);
@@ -123,12 +127,23 @@ class Docgen {
..forEach((lib) => logger.info('Added to libraries: $lib'));
}
+ List<String> listSdk() {
+ var sdk = new List<String>();
+ LIBRARIES.forEach((String name, LibraryInfo info) {
+ if (info.documented) {
+ sdk.add('dart:$name');
+ logger.info('Add to SDK: ${sdk.last}');
+ }
+ });
+ return sdk;
+ }
+
/**
* Analyzes set of libraries by getting a mirror system and triggers the
* documentation of the libraries.
*/
void analyze(List<String> args) {
- var libraries = listLibraries(args);
+ var libraries = parseSdk == false ? listLibraries(args) : listSdk();
Andrei Mouravski 2013/06/26 04:42:11 Same as above.
if (libraries.isEmpty) throw new StateError('No Libraries.');
// DART_SDK should be set to the root of the SDK library.
var sdkRoot = Platform.environment['DART_SDK'];
« pkg/docgen/bin/docgen.dart ('K') | « pkg/docgen/bin/docgen.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698