Apache Ant Delete Task
This task is used to delete a single file, directory or subdirectories. We can also delete set of files by specifying set of files. It does not remove empty directory by default, we need to use includeEmptyDirs attribute to remove that directory.
It has various attributes that are tabled below.
Apache Ant Delete Task Attributes
Apache Ant Delete Example
Lets see an example to understand the functioning of delete task.
Delete a File
Delete a Directory
Delete all the .java files from the current directory and subdirectories.
Delete all the files and subdirectories of build, even build itself.