summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDirk Dougherty <ddougherty@google.com>2014-06-21 01:33:49 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-21 01:33:49 +0000
commit80e276116a8c4183444b8c89297daa054d53bf9d (patch)
treec2e4a14a6aa30e228ba839b5df341f4a36c4c8ff /src
parent32f2de2c795891219f436d3128b37bee70656c7f (diff)
parente1951c7ae0c084a54990ef853a21987eea637d2a (diff)
downloadandroid_external_doclava-80e276116a8c4183444b8c89297daa054d53bf9d.tar.gz
android_external_doclava-80e276116a8c4183444b8c89297daa054d53bf9d.tar.bz2
android_external_doclava-80e276116a8c4183444b8c89297daa054d53bf9d.zip
am e1951c7a: Add new docs build flag -briefdocs that builds the docs and resolves jd links but doesn\'t output reference or browsable samples pages.
* commit 'e1951c7ae0c084a54990ef853a21987eea637d2a': Add new docs build flag -briefdocs that builds the docs and resolves jd links but doesn't output reference or browsable samples pages.
Diffstat (limited to 'src')
-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;
}