Package jdiff
Class JDiffAntTask
- java.lang.Object
-
- jdiff.JDiffAntTask
-
public class JDiffAntTask extends java.lang.ObjectAn Ant task to produce a simple JDiff report. More complex reports still need parameters that are controlled by the Ant Javadoc task.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJDiffAntTask.ProjectInfoThis class handles the information about a project, whether it is the older or newer version.
-
Constructor Summary
Constructors Constructor Description JDiffAntTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguredNew(JDiffAntTask.ProjectInfo projInfo)Used to store the child element named "new", which is under the JDiff task XML element.voidaddConfiguredOld(JDiffAntTask.ProjectInfo projInfo)Used to store the child element named "old", which is under the JDiff task XML element.protected voidaddSourcePaths(org.apache.tools.ant.taskdefs.Javadoc jd, JDiffAntTask.ProjectInfo proj)Add the root directories for the given project to the Javadoc sourcepath.protected voidcompareXML(java.lang.String oldapiname, java.lang.String newapiname)Convenient method to create a Javadoc task, configure it and run it to compare the XML representations of two instances of a project's source files, and generate an HTML report summarizing the differences.protected voidcopyFile(java.lang.String src, java.lang.String dst)Copy a file from src to dst.voidexecute()protected voidgenerateJavadoc(JDiffAntTask.ProjectInfo proj)Generate the Javadoc for the project.protected voidgenerateXML(JDiffAntTask.ProjectInfo proj)Convenient method to create a Javadoc task, configure it and run it to generate the XML representation of a project's source files.java.io.FilegetDestdir()booleangetDocchanges()protected java.lang.StringgetPackageList(JDiffAntTask.ProjectInfo proj)Return the comma-separated list of packages.java.lang.StringgetSource()booleangetStats()booleangetVerbose()protected org.apache.tools.ant.taskdefs.JavadocinitJavadoc(java.lang.String logMsg)Create a fresh new Javadoc task object and initialize it.voidsetDestdir(java.io.File value)Used to store the destdir attribute of the JDiff task XML element.voidsetDocchanges(boolean value)voidsetProject(org.apache.tools.ant.Project proj)Used as part of Ant's startup.voidsetSource(java.lang.String source)voidsetStats(boolean value)voidsetVerbose(boolean value)
-
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Throws:
org.apache.tools.ant.BuildException
-
generateXML
protected void generateXML(JDiffAntTask.ProjectInfo proj)
Convenient method to create a Javadoc task, configure it and run it to generate the XML representation of a project's source files.- Parameters:
proj- The current Project
-
compareXML
protected void compareXML(java.lang.String oldapiname, java.lang.String newapiname)Convenient method to create a Javadoc task, configure it and run it to compare the XML representations of two instances of a project's source files, and generate an HTML report summarizing the differences.- Parameters:
oldapiname- The name of the older version of the projectnewapiname- The name of the newer version of the project
-
generateJavadoc
protected void generateJavadoc(JDiffAntTask.ProjectInfo proj)
Generate the Javadoc for the project. If you want to generate the Javadoc report for the project with different parameters from the simple ones used here, then use the Javadoc Ant task directly, and set the javadoc attribute to the "old" or "new" element.- Parameters:
proj- The current Project
-
initJavadoc
protected org.apache.tools.ant.taskdefs.Javadoc initJavadoc(java.lang.String logMsg)
Create a fresh new Javadoc task object and initialize it.- Parameters:
logMsg- String which appears as a prefix in the Ant log- Returns:
- The new task.Javadoc object
-
addSourcePaths
protected void addSourcePaths(org.apache.tools.ant.taskdefs.Javadoc jd, JDiffAntTask.ProjectInfo proj)Add the root directories for the given project to the Javadoc sourcepath.
-
getPackageList
protected java.lang.String getPackageList(JDiffAntTask.ProjectInfo proj) throws org.apache.tools.ant.BuildException
Return the comma-separated list of packages. The list is generated from Ant DirSet tasks, and includes all directories in a hierarchy, e.g. com, com/acme. com/acme/foo. Duplicates are ignored.- Throws:
org.apache.tools.ant.BuildException
-
copyFile
protected void copyFile(java.lang.String src, java.lang.String dst)Copy a file from src to dst. Also checks that "destdir/changes" exists
-
setProject
public void setProject(org.apache.tools.ant.Project proj)
Used as part of Ant's startup.
-
setDestdir
public void setDestdir(java.io.File value)
Used to store the destdir attribute of the JDiff task XML element.
-
getDestdir
public java.io.File getDestdir()
-
setVerbose
public void setVerbose(boolean value)
-
getVerbose
public boolean getVerbose()
-
setDocchanges
public void setDocchanges(boolean value)
-
getDocchanges
public boolean getDocchanges()
-
setStats
public void setStats(boolean value)
-
getStats
public boolean getStats()
-
setSource
public void setSource(java.lang.String source)
-
getSource
public java.lang.String getSource()
-
addConfiguredOld
public void addConfiguredOld(JDiffAntTask.ProjectInfo projInfo)
Used to store the child element named "old", which is under the JDiff task XML element.
-
addConfiguredNew
public void addConfiguredNew(JDiffAntTask.ProjectInfo projInfo)
Used to store the child element named "new", which is under the JDiff task XML element.
-
-