Name
delete
Synopsis
Deletes one or more files and directories.
Warning
This is the most dangerous task in Ant. You can very easily erase
your entire project with a single tag: <delete dir="."/>.
Attributes
-
defaultexcludes(all, boolean, N) Determines whether to use default excludes, as described in Chapter 4 under “FileSet DataType.” Defaults to
true.-
dir(all, File, *) The directory to delete, including all its files and subdirectories. Somewhat surprisingly, this attribute has nothing to do with the
fileattribute or nested<fileset>. Specifically, it does not specify the directory where a file given in thefileattribute is found. Instead, this attribute tells the task to “brutally” delete an entire directory tree.-
excludes(all, String, N) A comma-separated list of file patterns to exclude. These are in addition to the default excludes.
-
excludesfile(all, File, N) The name of a file containing one exclude pattern per line.
-
failonerror(1.4, boolean, N) If
true, the build process fails when this task fails. Defaults totrue.-
file(all, File, *) The name of a file to delete.
-
includeemptydirs(1.3, 1.4, boolean, N) If
true, directories are deleted even if they are empty. Relevant only when using nested<fileset>s. Defaults tofalse.-
includes(all, String, N) A comma-separated list of file patterns to include.
-
includesfile(all, File, N) The name of a file containing one include pattern per line.
-
quiet(1.3, 1.4, boolean, N) If
true, do not fail if a file or directory cannot be deleted. Defaults ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access