Diffy is a set of Ant extensions for comparing and versioning directory structures The comparison algorithm is asymmetric in that it treats one directory as the "old" version of the directory structure, and the other as the "new", or target version. It produces enumerations of file and directory elements that list which have been added, changed, deleted, and optionally "moved".
The resulting lists delineate the element-by-element delta between two "revisions" of the same structure. These lists are completely sufficient to drive version control commands with the end result being that the original, "old", structure is tranformed into the "new" structure, and ultimately commited. (I will release additional tasks soon that use this output to perform the actual revisioning against version control systems, like CVS.)
This is useful in a number of situations:
In the build.xml:
<taskdef resource="diffy.properties"> <classpath location="lib-path/diffy.jar"/> </taskdef> <target name="diffy"> <difftree oldDir="${olddir}" newDir="${newdir}" dump="yes"/> </target>
From the command line:
ant diffy -Dolddir=C:/path1 -Dnewdir=C:/path2
Execution of the <difftree> task
causes several <dirset> and <fileset> definitions to be created
for the various element categories:
fs.files.added
, fs.files.changed
,
etc.
Because the dump flag is set,
a complete listing of element categories will be displayed.