ANT Tags <delete/>

 

- Info:

- Deletes files and directories.

- Root directory is defined with basedir parameter of <project> tag.

- <fileset> defines to delete all files from dest directory that end with .class.

 

- Example:

- Create ANT Script Test.xml

 

Test.xml

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

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

<target name= "default">

<delete file = "Test.txt" />

<delete file = "src\Test.txt"/>

<delete file = "..\Test.txt" />

<delete dir = "tmp"/>

<delete>

<fileset dir = "dest" includes="**\*.class"/>

</delete>

</target>

</project>