*
* @param oldapiname The name of the older version of the project
* @param newapiname The name of the newer version of the project
*/
protected void compareXML(String oldapiname, String newapiname) {
Javadoc jd = initJavadoc("Comparing versions");
jd.setDestdir(getDestdir());
jd.setPrivate(true);
// Tell Javadoc which files we want to scan - a dummy file in this case
jd.setSourcefiles(jdiffHome + DIR_SEP + "Null.java");
// Create the DocletInfo first so we have a way to use it to add params
DocletInfo dInfo = jd.createDoclet();
jd.setDoclet("jdiff.JDiff");
jd.setDocletPath(new Path(project, jdiffClassPath));
// Now set up some parameters for the JDiff doclet.
DocletParam dp1 = dInfo.createParam();
dp1.setName("-oldapi");
dp1.setValue(oldapiname);
DocletParam dp2 = dInfo.createParam();
dp2.setName("-newapi");
dp2.setValue(newapiname);
// Get the generated XML files from the same directory as the report
DocletParam dp3 = dInfo.createParam();
dp3.setName("-oldapidir");
dp3.setValue(getDestdir().toString());
DocletParam dp4 = dInfo.createParam();
dp4.setName("-newapidir");
dp4.setValue(getDestdir().toString());
// Assume that Javadoc reports already exist in ../"apiname"
DocletParam dp5 = dInfo.createParam();
dp5.setName("-javadocold");
dp5.setValue(".." + DIR_SEP + oldapiname + DIR_SEP);
DocletParam dp6 = dInfo.createParam();
dp6.setName("-javadocnew");
dp6.setValue(".." + DIR_SEP + newapiname + DIR_SEP);
if (getStats()) {
// There are no arguments to this argument
dInfo.createParam().setName("-stats");
// We also have to copy two image files for the stats pages
copyFile(jdiffHome + DIR_SEP + "black.gif",
getDestdir().toString() + DIR_SEP + "black.gif");
copyFile(jdiffHome + DIR_SEP + "background.gif",
getDestdir().toString() + DIR_SEP + "background.gif");
}
if (getDocchanges()) {
// There are no arguments to this argument
dInfo.createParam().setName("-docchanges");
}
if (getIncompatible()) {
// There are no arguments to this argument
dInfo.createParam().setName("-incompatible");
}
if(getScript()) {
dInfo.createParam().setName("-script");
}
// Execute the Javadoc command to compare the two XML files
jd.perform();
}