|
Examples
MakeDirDiff can be run as an Ant task and a command line tool
Featured, Phase-Requirements, Phase-Deploy, ant, java, task, dir, files, directory, make, diff, difference, differences, compare, examples Example of running ‘Make Directory Difference’ toolРусский: Примеры запуска MakeDirDiff Defining MakeDirDiff task in Ant script <taskdef name="makeDirDiff" classname="org.grenader.makedirdiff.MakeDirDiff">
<classpath>
<pathelement location="./ant.jar"/>
<pathelement location="./jsCssMin-1.0.jar"/>
<pathelement location="./makeDirDiff-1.4.jar"/>
</classpath>
</taskdef>Executing a sample ANT taskWe will run and analyze the sample ant task that is stored in a build.xml file in each makeDirDiff-bin-1.x.zip file.
Running as a java applicationCommand line parametersMakeDirDiff requires three parameters and optional flags:
Note that MakeDirDiff without parameters or with wrong number of parameters shows this help text. MS Windows command examplejava -cp *; org.grenader.makedirdiff.MakeDirDiff ./original ./result ./previous Flag -cleanDestDir can be added to a command line. -cleanDestDir makes the application to clean ./result directory at the beginning of work. You can find this command in the makeDirDiff-Example.bat in makeDirDiff-bin-1.x.zip archive Unix command examplejava -cp *: org.grenader.makedirdiff.MakeDirDiff ./original ./result ./previous Flag -cleanDestDir can be added to a command line. -cleanDestDir makes the application to clean ./result directory at the beginning of work. You can find this command in the makeDirDiff-Example.sh in makeDirDiff-bin-1.x.zip archive Example ANT taskThe following Ant task is stored in build.xml file in each makeDirDiff-bin-1.x.zip file <!-- Basic Example of using makeDirDiff Ant task -->
<target name="example">
<!-- Defind required jars-->
<path id="taskDependencies">
<pathelement location="./ant.jar"/>
<pathelement location="./jsCssMin-1.0.jar"/>
<pathelement location="./makeDirDiff-1.4.jar"/>
</path>
<!-- Defind makeDirDiff Ant task -->
<taskdef name="makeDirDiff" classname="org.grenader.makedirdiff.MakeDirDiff">
<classpath refid="taskDependencies"/>
</taskdef>
<!--
Execute the makeDirDiff task
"./original" - original data directory. It's defined as a nested fileset item
"./result" - result directory. It's defined as a destDir attribute
"./previous" - previous data directory. It's defined as a prevDir attribute
"cleanDestDir - true/false, not required. If "true" result directory will be
cleaned before copying new/changed files into it.
-->
<makeDirDiff
destDir="./result"
prevDir="./previous">
<fileset dir="./original"/>
</makeDirDiff>
</target>
|