Chromium Code Reviews| Index: utils/apidoc/apidoc.dart |
| diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart |
| index 0fa4171db6cc292f9c5a51a66bd2d17017fd2f6c..98d995fe4999f45cacc2240d7593ce700692ffb3 100644 |
| --- a/utils/apidoc/apidoc.dart |
| +++ b/utils/apidoc/apidoc.dart |
| @@ -109,21 +109,34 @@ void main() { |
| apidocLibraries.add(new Path('dart:$name')); |
| } |
| }); |
| - apidocLibraries.add(doc.scriptDir.append('../../pkg/unittest/unittest.dart')); |
| - apidocLibraries.add(doc.scriptDir.append('../../pkg/i18n/intl.dart')); |
| - |
| - print('Generating docs...'); |
| - final apidoc = new Apidoc(mdn, htmldoc, outputDir, mode, generateAppCache); |
| - // Select the libraries to include in the produced documentation: |
| - apidoc.includeApi = true; |
| - apidoc.includedLibraries = <String>[ |
| - 'unittest', |
| - 'intl', |
| - ]; |
| - |
| - Futures.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) { |
| - apidoc.documentLibraries(apidocLibraries, doc.libPath); |
| - }); |
| + |
| + final includedLibraries = <String>[]; |
| + var lister = new Directory.fromPath( |
| + doc.scriptDir.append('../../pkg/')).list(); |
| + lister.onDir = (dirPath) { |
| + var path = new Path(dirPath); |
| + var libname = path.filename; |
| + // TODO(jmesserly): rename i18n to intl |
| + if (libname == 'i18n') libname = 'intl'; |
|
dgrove
2012/08/21 18:42:31
This change is coming in now, so perhaps get rid o
Jennifer Messerly
2012/08/21 18:50:13
Done.
|
| + path = path.append('${libname}.dart'); |
| + if (new File.fromPath(path).existsSync()) { |
| + apidocLibraries.add(path); |
| + includedLibraries.add(libname); |
| + } else { |
| + print('Warning: could not find package at $path'); |
| + } |
| + }; |
| + lister.onDone = (success) { |
| + print('Generating docs...'); |
| + final apidoc = new Apidoc(mdn, htmldoc, outputDir, mode, generateAppCache); |
| + // Select the libraries to include in the produced documentation: |
| + apidoc.includeApi = true; |
| + apidoc.includedLibraries = includedLibraries; |
| + |
| + Futures.wait([compiled, copiedStatic, copiedApiDocStatic]).then((_) { |
| + apidoc.documentLibraries(apidocLibraries, doc.libPath); |
| + }); |
| + }; |
| } |
| /** |