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

Unified Diff: utils/apidoc/apidoc.dart

Issue 10201012: add appcache generation to apidocs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: refactor from review Created 8 years, 8 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') | « lib/dartdoc/dartdoc.dart ('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 a327c2a4410dc4dad85cbd6db8f9f1e285eac9df..04a8412715446be0890ed3f952a790a55f6c7df3 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -34,6 +34,7 @@ void main() {
int mode = doc.MODE_STATIC;
String outputDir = 'docs';
String compilerPath;
+ bool generateAppCache = true;
// Parse the command-line arguments.
for (int i = 0; i < args.length; i++) {
@@ -48,6 +49,10 @@ void main() {
mode = doc.MODE_LIVE_NAV;
break;
+ case '--generate-app-cache=false':
+ generateAppCache = false;
+ break;
+
default:
if (arg.startsWith('--out=')) {
outputDir = arg.substring('--out='.length);
@@ -75,16 +80,16 @@ void main() {
final clientScript = (mode == doc.MODE_STATIC) ?
'static' : 'live-nav';
- doc.compileScript(compilerPath, libDir,
+ Future scriptCompiled = doc.compileScript(compilerPath, libDir,
Bob Nystrom 2012/04/25 21:43:15 "final"
sethladd 2012/04/25 23:13:28 Done.
'${doc.scriptDir}/../../lib/dartdoc/client-$clientScript.dart',
'${outputDir}/client-$clientScript.js');
// TODO(rnystrom): Use platform-specific path separator.
// The basic dartdoc-provided static content.
- doc.copyFiles('${doc.scriptDir}/../../lib/dartdoc/static', outputDir);
+ Future copiedStatic = doc.copyFiles('${doc.scriptDir}/../../lib/dartdoc/static', outputDir);
Bob Nystrom 2012/04/25 21:43:15 Long line.
sethladd 2012/04/25 23:13:28 Done.
// The apidoc-specific static content.
- doc.copyFiles('${doc.scriptDir}/static', outputDir);
+ Future copiedApiDocStatic = doc.copyFiles('${doc.scriptDir}/static', outputDir);
Bob Nystrom 2012/04/25 21:43:15 Here too.
sethladd 2012/04/25 23:13:28 Done.
var files = new VMFileSystem();
parseOptions(frogPath, ['', '', '--libdir=$frogPath/lib'], files);
@@ -113,8 +118,13 @@ void main() {
world.process();
print('Generating docs...');
- final apidoc = new Apidoc(mdn, outputDir, mode);
- apidoc.document();
+ final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache);
+
+ // hackish: all I really need to do is run app cache when these
+ // futures are done, but app cache generation is inside document()
Bob Nystrom 2012/04/25 21:43:15 Why not just have generateAppCache be a separate m
sethladd 2012/04/25 23:13:28 class Dartdoc still needs the generateAppCache boo
Bob Nystrom 2012/04/25 23:27:50 Ah, OK.
+ Futures.wait([scriptCompiled, copiedStatic, copiedApiDocStatic]).then((_) {
+ apidoc.document();
+ });
}
class Apidoc extends doc.Dartdoc {
@@ -130,9 +140,10 @@ class Apidoc extends doc.Dartdoc {
*/
String mdnUrl;
- Apidoc(this.mdn, String outputDir, int mode) {
+ Apidoc(this.mdn, String outputDir, int mode, bool generateAppCache) {
this.outputDir = outputDir;
this.mode = mode;
+ this.generateAppCache = generateAppCache;
mainTitle = 'Dart API Reference';
mainUrl = 'http://dartlang.org';
@@ -501,4 +512,5 @@ class Apidoc extends doc.Dartdoc {
return '';
}
+
}
« lib/dartdoc/dartdoc.dart ('K') | « lib/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698