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

Unified Diff: utils/apidoc/apidoc.dart

Issue 9705078: Allow specifying output directory for dartdoc and apidoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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
« lib/dartdoc/dartdoc.dart ('K') | « utils/apidoc/apidoc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index f1b385dba0d1fd38515e661e8e5fff19637be498..3457d3250d93cf8d64fa76665f22d637b71b9af9 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -19,6 +19,33 @@ HtmlDiff _diff;
final GET_PREFIX = 'get:';
void main() {
+ final args = new Options().arguments;
+
+ var outputDir = 'docs';
+
+ // Use the output directory if provided.
+ if (args.length > 1) {
+ print('Usage: apidoc [--out=<output directory>]');
+ return;
+ } else if (args.length == 1) {
+ final arg = args[0];
+ if (arg.startsWith('--out=')) {
+ outputDir = arg.substring('--out='.length);
+ } else {
+ print('Unknown option: $arg');
+ return;
+ }
+ }
+
+ doc.cleanOutputDirectory(outputDir);
+
+ // TODO(rnystrom): Use platform-specific path separator.
+ // The basic dartdoc-provided static content.
+ doc.copyFiles('${doc.scriptDir}/../../lib/dartdoc/static', outputDir);
+
+ // The apidoc-specific static content.
+ doc.copyFiles('${doc.scriptDir}/static', outputDir);
+
var files = new VMFileSystem();
parseOptions('../../frog', ['', '', '--libdir=../../frog/lib'], files);
initializeWorld(files);
@@ -38,7 +65,7 @@ void main() {
world.getOrAddLibrary('dart:io');
print('Generating docs...');
- final apidoc = new Apidoc(mdn);
+ final apidoc = new Apidoc(mdn, outputDir);
apidoc.document('html');
}
@@ -53,7 +80,9 @@ class Apidoc extends doc.Dartdoc {
*/
String mdnUrl;
- Apidoc(this.mdn) {
+ Apidoc(this.mdn, String outputDir) {
+ this.outputDir = outputDir;
+
mainTitle = 'Dart API Reference';
mainUrl = 'http://dartlang.org';
« lib/dartdoc/dartdoc.dart ('K') | « utils/apidoc/apidoc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698