Chromium Code Reviews| 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']; |