add support for gms and gcm javadocs
Change-Id: Ibf1465f8f8b3f8a419c8f2b36b3bff96826ba89f
diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index b7e06cb..4bdf245 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -80,6 +80,9 @@
public static JSilver jSilver = null;
+ private static boolean gmsRef = false;
+ private static boolean gcmRef = false;
+
public static boolean checkLevel(int level) {
return (showLevel & level) == level;
}
@@ -173,7 +176,7 @@
} else if (a[0].equals("-keeplist")) {
keepListFile = a[1];
} else if (a[0].equals("-proguard")) {
- proguardFile = a[1];
+ proguardFile = a[1];
} else if (a[0].equals("-proofread")) {
proofreadFile = a[1];
} else if (a[0].equals("-todo")) {
@@ -280,7 +283,13 @@
writeAssets();
// Navigation tree
- NavTree.writeNavTree(javadocDir);
+ String refPrefix = new String();
+ if(gmsRef){
+ refPrefix = "gms-";
+ } else if(gcmRef){
+ refPrefix = "gcm-";
+ }
+ NavTree.writeNavTree(javadocDir, refPrefix);
// Write yaml tree.
if (yamlNavFile != null){
@@ -288,7 +297,7 @@
}
// Packages Pages
- writePackages(javadocDir + "packages" + htmlExtension);
+ writePackages(javadocDir + refPrefix + "packages" + htmlExtension);
// Classes
writeClassLists();
@@ -550,9 +559,16 @@
if (option.equals("-yaml")) {
return 2;
}
+ if (option.equals("-gmsref")) {
+ gmsRef = true;
+ return 1;
+ }
+ if (option.equals("-gcmref")) {
+ gcmRef = true;
+ return 1;
+ }
return 0;
}
-
public static boolean validOptions(String[][] options, DocErrorReporter r) {
for (String[] a : options) {
if (a[0].equals("-error") || a[0].equals("-warning") || a[0].equals("-hide")) {
@@ -641,7 +657,11 @@
if (allHidden) {
continue;
}
-
+ if(gmsRef){
+ data.setValue("reference.gms", "true");
+ } else if(gcmRef){
+ data.setValue("reference.gcm", "true");
+ }
data.setValue("reference", "1");
data.setValue("reference.apilevels", sinceTagger.hasVersions() ? "1" : "0");
data.setValue("docs.packages." + i + ".name", s);
diff --git a/src/com/google/doclava/NavTree.java b/src/com/google/doclava/NavTree.java
index 5323213..aa02d7c 100644
--- a/src/com/google/doclava/NavTree.java
+++ b/src/com/google/doclava/NavTree.java
@@ -25,12 +25,12 @@
public class NavTree {
- public static void writeNavTree(String dir) {
+ public static void writeNavTree(String dir, String refPrefix) {
List<Node> children = new ArrayList<Node>();
for (PackageInfo pkg : Doclava.choosePackages()) {
children.add(makePackageNode(pkg));
}
- Node node = new Node("Reference", dir + "packages.html", children, null);
+ Node node = new Node("Reference", dir + refPrefix + "packages.html", children, null);
StringBuilder buf = new StringBuilder();
if (false) {
@@ -45,7 +45,13 @@
Data data = Doclava.makeHDF();
data.setValue("reference_tree", buf.toString());
- ClearPage.write(data, "navtree_data.cs", "navtree_data.js");
+ if (refPrefix == "gms-"){
+ ClearPage.write(data, "gms_navtree_data.cs", "gms_navtree_data.js");
+ } else if (refPrefix == "gcm-"){
+ ClearPage.write(data, "gcm_navtree_data.cs", "gcm_navtree_data.js");
+ } else {
+ ClearPage.write(data, "navtree_data.cs", "navtree_data.js");
+ }
}
/**