ANT Examples <taskdef/> Calculate file size

 

- Info:

- Task file size and writes it in Dest.txt.

 

- Example:

- Create ANT Script Test.xml

 

Test.xml

<?xml version="1.0" encoding="UTF-8"?>

<project name="MyAntProject" default="default" basedir=".">

<property name = "jarSize"

value = "12"/>

<taskdef name = "filesize"

classname = "ant.FileSizeTask"

classpath = "C:\cvs\jbdme\nokia7210_cn\lib\filesize.jar"/>

<target name = "default">

<filesize file = "D:\ProgramFiles\WirelessToolkit20\apps\Test\bin\Test.jar"

property = "jarSize"/>

<filter token = "ivor"

value = "${jarSize}"/>

<copy file = "D:\Stuff\Src.txt"

tofile = "D:\Stuff\Dest.txt"

overwrite = "yes"

filtering = "true"/>

</target>

</project>