Running Clirr as an Ant Taskclirr is distributed as an Ant task. The following text assumes that you are familiar with Ant. To run clirr, you typically
To do this you will need an ant snippet similar to the following: <target name="checkbinarycompatibility" depends="build"> <!-- buildtools.classpath should contain clirr.jar and the libraries it depends on --> <taskdef classpathref="buildtools.classpath" resource="clirrtask.properties"/> <property name="jar.baseline" value="${ant.project.name}-${compatibility.baseline.version}.jar"/> <get src="${url.libbase}/${ant.project.name}/${jar.baseline}" dest="build/tmp/${jar.baseline}"/> <clirr> <origfiles dir="build/tmp" includes="${jar.baseline}"/> <newfiles dir="build/lib" includes="${jar.buildresult}"/> <!-- <formatter type="xml" outfile="build/clirr.xml" /> --> <!-- TODO: example for 3rd party classpath --> </clirr> </target> Parameters
Parameters specified as nested elementsnewFilesA FileSet that describes the current version that should be checked against the compatibility baseline. Clirr works with FileSets instead of individual jar files to allow splitting up or combining library distributions. An example is log4j, the 1.3.0 release splits up the earlier log4j.jar into several jar files. newClassPathThe 3rd party ClassPath that is referenced by the checked library version (newFiles). Any class or interface that occurs as a baseclass, parameter type or method return type must be included here. origClassPathThe 3rd party ClassPath that is referenced by the compatibility baseline version (origFiles). Any class or interface that occurs as a baseclass, parameter type or method return type must be included here. Often the origClassPath is the same as the newClassPath. In these cases you can specify these paths using the refid attribute to avoid duplicating the classpath information. Please refer to the ant manual for details. formatterA formatter that generates Clirr output. Multiple formatters can be specified. Available attributes for each formatter element:
If no formatter is specified, Clirr will write it's findings to stdout in plain format. |