Package org.osjava.jardiff.ant
Class JarDiffTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.osjava.jardiff.ant.JarDiffTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class JarDiffTask extends org.apache.tools.ant.TaskProcess two jarfiles generating a public API difference report. This is useful for keeping track of API changes between versions of a project.- Author:
- Antony Riley
-
-
Field Summary
Fields Modifier and Type Field Description private booleanforceForce output, even if the existing output is newer than the jar files.private java.io.FilefromJarThe jarfile this diff is from.private java.lang.StringfromNameThe name to use for the from version.private java.io.FileoutThe file to write the report to.private java.io.FiletoJarThe jarfile this diff is to.private java.lang.StringtoNameThe name to use for the to verison.
-
Constructor Summary
Constructors Constructor Description JarDiffTask()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute()Run the task, generating the jardiff report.voidsetForce(boolean force)Force output even if there is an existing diff file which is newer than the source jar files.voidsetFromjar(java.io.File fromJar)Set the from jar file.voidsetFromname(java.lang.String fromName)Set the from jar visible name.voidsetOut(java.io.File out)Set the out file.voidsetTojar(java.io.File toJar)Set the to jar file.voidsetToname(java.lang.String toName)Set the to jar visible name.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Field Detail
-
fromJar
private java.io.File fromJar
The jarfile this diff is from.
-
toJar
private java.io.File toJar
The jarfile this diff is to.
-
out
private java.io.File out
The file to write the report to.
-
fromName
private java.lang.String fromName
The name to use for the from version.
-
toName
private java.lang.String toName
The name to use for the to verison.
-
force
private boolean force
Force output, even if the existing output is newer than the jar files.
-
-
Method Detail
-
execute
public void execute() throws org.apache.tools.ant.BuildExceptionRun the task, generating the jardiff report.- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException- When there is an error creating the diff, When there is a problem with the xml parser, When there is a problem with the xslt transformer When the attributes specified are invalid.
-
setFromjar
public void setFromjar(java.io.File fromJar)
Set the from jar file. Required attribute.- Parameters:
fromJar- a jar file.
-
setTojar
public void setTojar(java.io.File toJar)
Set the to jar file. Required attribute.- Parameters:
toJar- a jar file.
-
setOut
public void setOut(java.io.File out)
Set the out file. Required attribute.- Parameters:
out- an output file.
-
setFromname
public void setFromname(java.lang.String fromName)
Set the from jar visible name. Optional attribute. Defaults to the filename of fromjar.- Parameters:
fromName- a visible name.
-
setToname
public void setToname(java.lang.String toName)
Set the to jar visible name. Optional attribute. Defaults to the filename of tojar.- Parameters:
toName- a visible name.
-
setForce
public void setForce(boolean force)
Force output even if there is an existing diff file which is newer than the source jar files. Optional attribute. Defaults to false.- Parameters:
force- true to force output, false otherwise
-
-