Login  |  SSL  |  My Account   

Apache Ant Examples

Print E-mail

This article shows you some example Apache Ant snippets generated by the Data Digester GUI application. They may be easily integrated in your own Ant build scripts. Simply copy the generated snippets into your own Ant target. The Ant task must be defined using the following declaration (please adjust the classpath value appropriate for the directory where you installed the Data Digester software):

1
2
3
<taskdef name="digestercli" classname="com.lf.digester.ant.DigesterCLITask"
 classpath="C:\Program Files\digester-1.6.3\ant\digester-ant.jar"/>
 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
<digestercli>
 <check />
 <checkxml />
 <extxml>.digest</extxml>
 <checkxmlpgp />
 <checkintermediates />
 <stoponmismatch />
 <pgpkeyignore />
 <fileset dir="D:\checksum_test">
 <include name="jnlp-1_5-mr-spec.pdf.digest" />
 </fileset>
</digestercli>
 

Sample Apache Ant snippet to check a single checksum file

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<digestercli>
 <generate />
 <md5 />
 <extmd5>.md5</extmd5>
 <sha1 />
 <extsha1>.sha</extsha1>
 <xmlpertarget />
 <overwrite />
 <timestamp />
 <ignoredigests />
 <subdirectories />
 <extxml>.digest</extxml>
 <xmldigestformat>hex</xmldigestformat>
 <xmlabsolutepaths />
 <xmlintermediates>exponential</xmlintermediates>
 <exponentialstart>8K</exponentialstart>
 <maxintermediates>5</maxintermediates>
 <fileset dir="D:\checksum_test">
  <include name="franz.txt" />
 </fileset>
</digestercli>
 

Sample Apache Ant snippet to generate a single checksum file

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<digestercli>
 <refresh />
 <md5 />
 <extmd5>.md5</extmd5>
 <sha1 />
 <extsha1>.sha</extsha1>
 <xmlperdirectory />
 <overwrite />
 <timestamp />
 <summaryfile>summary</summaryfile>
 <ignoredigests />
 <subdirectories />
 <pgpversion>Data Digester 1.6.3</pgpversion>
 <extxml>.digest</extxml>
 <xmldigestformat>hex</xmldigestformat>
 <xmlabsolutepaths />
 <xmlpgp />
 <xmlpgpkeyid />
 <xmlpgpkeyname />
 <xmlpgpkeyemail />
 <xmlintermediates>exponential</xmlintermediates>
 <exponentialstart>8K</exponentialstart>
 <maxintermediates>5</maxintermediates>
 <refreshignoremissing />
 <refreshxmlentryfilesize />
 <refreshxmlentrytimestamp />
 <pgpkey>
  <id>0x7EB2B10924E58CDB</id>
 </pgpkey>
 <dirset dir="D:\">
  <include name="checksum_test" />
 </dirset>
</digestercli>
 

Sample Apache Ant snippet to refresh a directory and its subdirectories

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<digestercli>
 <sync />
 <optfilesize />
 <optxmlentryfilesize />
 <optxmlentrytimestamp />
 <optdigest />
 <optintermediate />
 <sourcetimestamp />
 <overwrite />
 <subdirectories />
 <syncgnubsdtimestamp />
 <syncpgptimestamp />
 <syncxmltimestamp />
 <syncxmlentryfilesize />
 <syncxmlentrytimestamp />
 <xmlperdirectory />
 <md5 />
 <sha1 />
 <sourceset>
  <gentemplate>My Sync4</gentemplate>
  <gentemplaterefresh />
  <dirset dir="C:\Temp\digester">
   <include name="cms" />
  </dirset>
 </sourceset>
 <targetset>
  <name>Targets</name>
  <url>sftp://mydomain.com:22/home/user1/public_html/.cms</url>
 </targetset>
</digestercli>
 

Sample Apache Ant snippet to synchronize a remote directory on the basis of a local directory