summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Dougherty <ddougherty@google.com>2014-02-15 13:21:55 -0800
committerDirk Dougherty <ddougherty@google.com>2014-05-08 20:22:48 -0700
commite1951c7ae0c084a54990ef853a21987eea637d2a (patch)
treee54d772d8929fdc42af8b91f526dbbf07ff059dc
parent8bfc32ba1c79cdc576101944346f66112b1a3776 (diff)
downloadandroid_external_doclava-e1951c7ae0c084a54990ef853a21987eea637d2a.tar.gz
android_external_doclava-e1951c7ae0c084a54990ef853a21987eea637d2a.tar.bz2
android_external_doclava-e1951c7ae0c084a54990ef853a21987eea637d2a.zip
Add new docs build flag -briefdocs that builds the docs and
resolves jd links but doesn't output reference or browsable samples pages. Change-Id: I51e0c8fbcef17f773728ff0c777595a61ac31592
-rw-r--r--src/com/google/doclava/Doclava.java114
1 files changed, 74 insertions, 40 deletions
diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index a96b91c..88222e7 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -92,6 +92,9 @@ public class Doclava {
public static Set<String> showAnnotations = new HashSet<String>();
public static boolean includeDefaultAssets = true;
private static boolean generateDocs = true;
+ //build sdk docs without reference or browsable samples (use -briefdocs)
+ private static boolean brief_docs = false;
+
private static boolean parseComments = false;
private static String yamlNavFile = null;
@@ -267,6 +270,11 @@ public class Doclava {
// Don't copy the doclava assets to devsite output (ie use proj assets only)
includeDefaultAssets = false;
outputPathHtmlDirs = outputPathHtmlDirs + "/" + devsiteRoot;
+ } else if (a[0].equals("-briefdocs")) {
+ // Don't generate reference docs or browsable sample code
+ // pages when building the docs. Javadoc links in input
+ // files are still resolved.
+ brief_docs = true;
}
}
@@ -301,28 +309,38 @@ public class Doclava {
return false;
}
- //startTime = System.nanoTime();
-
- // Apply @since tags from the XML file
- sinceTagger.tagAll(Converter.rootClasses());
+ if (!brief_docs) {
+ long taggingStartTime = System.nanoTime();
+ // Apply @since tags from the XML file
+ sinceTagger.tagAll(Converter.rootClasses());
- // Apply details of federated documentation
- federationTagger.tagAll(Converter.rootClasses());
+ // Apply details of federated documentation
+ federationTagger.tagAll(Converter.rootClasses());
- // Files for proofreading
- if (proofreadFile != null) {
- Proofread.initProofread(proofreadFile);
- }
- if (todoFile != null) {
- TodoFile.writeTodoFile(todoFile);
+ // Files for proofreading
+ if (proofreadFile != null) {
+ Proofread.initProofread(proofreadFile);
+ }
+ if (todoFile != null) {
+ TodoFile.writeTodoFile(todoFile);
+ }
+ long taggingTime = System.nanoTime() - taggingStartTime;
+ System.out.println(" ... @since tagging APIs: "
+ + (taggingTime / 1000000000) + " sec.");
}
- if (samplesRef) {
+ if ((samplesRef) && (!brief_docs)) {
+ long samplesStartTime = System.nanoTime();
// always write samples without offlineMode behaviors
- writeSamples(false, sampleCodes, SORT_BY_NAV_GROUPS);
- }
+ writeSamples(false, sampleCodes, SORT_BY_NAV_GROUPS);
+ long samplesTime = System.nanoTime() - samplesStartTime;
+ System.out.println(" ... Writing browseable samples: "
+ + (samplesTime / 1000000000) + " sec.");
+ }
+ long htmlStartTime = System.nanoTime();
// HTML2 Pages -- Generate Pages from optional secondary dir
+
if (!inputPathHtmlDir2.isEmpty()) {
if (!outputPathHtmlDir2.isEmpty()) {
ClearPage.outputDir = outputPathBase + "/" + outputPathHtmlDir2;
@@ -338,6 +356,9 @@ public class Doclava {
ClearPage.outputDir = outputPathHtmlDirs;
writeHTMLPages();
}
+ long htmlTime = System.nanoTime() - htmlStartTime;
+ System.out.println(" ... Writing static html: "
+ + (htmlTime / 1000000000) + " sec.");
writeAssets();
@@ -350,43 +371,53 @@ public class Doclava {
}
NavTree.writeNavTree(javadocDir, refPrefix);
- // Write yaml tree.
- if (yamlNavFile != null){
- NavTree.writeYamlTree(javadocDir, yamlNavFile);
- }
+ if (!brief_docs) {
+ // Write yaml tree.
+ if (yamlNavFile != null){
+ NavTree.writeYamlTree(javadocDir, yamlNavFile);
+ }
- // Packages Pages
- writePackages(javadocDir + refPrefix + "packages" + htmlExtension);
+ long refStartTime = System.nanoTime();
+ // Packages Pages
- // Classes
- writeClassLists();
- writeClasses();
- writeHierarchy();
- // writeKeywords();
+ writePackages(javadocDir + refPrefix + "packages" + htmlExtension);
- // Lists for JavaScript
- writeLists();
- if (keepListFile != null) {
- writeKeepList(keepListFile);
- }
+ // Classes
+ writeClassLists();
+ writeClasses();
+ writeHierarchy();
+ // writeKeywords();
- // Index page
- writeIndex();
+ // Lists for JavaScript
+ writeLists();
+ if (keepListFile != null) {
+ writeKeepList(keepListFile);
+ }
- Proofread.finishProofread(proofreadFile);
+ // Index page
+ writeIndex();
+
+ Proofread.finishProofread(proofreadFile);
+
+ if (sdkValuePath != null) {
+ writeSdkValues(sdkValuePath);
+ }
+ long refTime = System.nanoTime() - refStartTime;
+ System.out.println(" ... Writing reference files: "
+ + (refTime / 1000000000) + " sec.");
+ }
- if (sdkValuePath != null) {
- writeSdkValues(sdkValuePath);
- }
// Write metadata for all processed files to jd_lists_unified.js in out dir
if (!sTaglist.isEmpty()) {
PageMetadata.WriteList(sTaglist);
}
}
- // Stubs
- if (stubsDir != null || apiFile != null || proguardFile != null) {
- Stubs.writeStubsAndApi(stubsDir, apiFile, proguardFile, stubPackages);
+ if (!brief_docs) {
+ // Stubs
+ if (stubsDir != null || apiFile != null || proguardFile != null) {
+ Stubs.writeStubsAndApi(stubsDir, apiFile, proguardFile, stubPackages);
+ }
}
Errors.printErrors();
@@ -550,6 +581,9 @@ public class Doclava {
if (option.equals("-devsite")) {
return 1;
}
+ if (option.equals("-briefdocs")) {
+ return 1;
+ }
if (option.equals("-htmldir")) {
return 2;
}