Adding version information to DroidDoc. Rather than pulling the version from
@since tags in the code, it's pulled from the API XML files also used by
apicheck.
The code now reads the apicheck XML, and applies it's versions to the DroidDoc
class models. The models output the version to HDF, and that's picked up by
the CS templates.
The clearsilver templates will be changed to be pretty in a follow up change.
diff --git a/tools/droiddoc/src/DroidDoc.java b/tools/droiddoc/src/DroidDoc.java
index 6f2b517..63fbc96 100644
--- a/tools/droiddoc/src/DroidDoc.java
+++ b/tools/droiddoc/src/DroidDoc.java
@@ -98,6 +98,7 @@
String apiFile = null;
String debugStubsFile = "";
HashSet<String> stubPackages = null;
+ SinceTagger sinceTagger = new SinceTagger();
root = r;
@@ -190,6 +191,9 @@
else if (a[0].equals("-nodocs")) {
noDocs = true;
}
+ else if (a[0].equals("-since")) {
+ sinceTagger.addVersion(a[1], a[2]);
+ }
}
// read some prefs from the template
@@ -203,6 +207,9 @@
if (!noDocs) {
long startTime = System.nanoTime();
+ // Apply @since tags from the XML file
+ sinceTagger.tagAll(Converter.rootClasses());
+
// Files for proofreading
if (proofreadFile != null) {
Proofread.initProofread(proofreadFile);
@@ -260,7 +267,7 @@
if (stubsDir != null) {
Stubs.writeStubs(stubsDir, apiXML, apiFile, stubPackages);
}
-
+
Errors.printErrors();
return !Errors.hadError;
}
@@ -409,9 +416,12 @@
if (option.equals("-nodocs")) {
return 1;
}
+ if (option.equals("-since")) {
+ return 3;
+ }
return 0;
}
-
+
public static boolean validOptions(String[][] options, DocErrorReporter r)
{
for (String[] a: options) {
@@ -777,6 +787,7 @@
String name = pkg.name();
data.setValue("package.name", name);
+ data.setValue("package.since", pkg.getSince());
data.setValue("package.descr", "...description...");
makeClassListHDF(data, "package.interfaces",