From 5e16daf1e789e40f2461893c90f3daffa3f9909b Mon Sep 17 00:00:00 2001
From: Diane Holt Deletes either a single file, all files in a specified directory and its
-sub-directories, or a set of files specified by one or more FileSets.
-When specifying a set of files, empty directories are not removed by default.
-To remove empty directories, use the includeEmptyDirs atribute. Deletes a single file, a specified directory and all its files and
+subdirectories, or a set of files specified by one or more
+FileSets.
+When specifying a set of files, empty directories are not removed by
+default.
+To remove empty directories, use the Delete
Description
-includeEmptyDirs
attribute.
+Parameters
@@ -23,38 +26,41 @@ To remove empty directories, use the includeEmptyDirs atribute.
file
The file to delete.
- at least one of the two
+ At least one of the two, unless a
<fileset>
is specified.
dir
- The directory to delete files from.
+ The directory to delete, including all its files and subdirectories.
verbose
- Show name of each deleted file ("true"/"false").
+ Show the name of each deleted file ("true"/"false").
Default is "false" when omitted.
No
quiet
If the file does not exist, do not display a diagnostic
- message or modify the exit status to reflect an error (unless Ant
- has been invoked with the -verbose or -debug switches).
- This means that if a file or directory cannot be deleted,
- then no error is reported. This setting emulates the
- -f option to the Unix "rm" command.
- ("true"/"false").
- Default is "false" meaning things are "noisy".
- Setting this to true, implies setting failonerror to false.
+ message (unless Ant
+ has been invoked with the ‑verbose
or
+ ‑debug
switches) or modify the exit status to
+ reflect an error.
+ When set to "true", if a file or directory cannot be deleted,
+ no error is reported. This setting emulates the
+ -f
option to the Unix rm command.
+ Default is "false".
+ Setting this to "true" implies setting
+ failonerror
to "false".
+
No
@@ -64,37 +70,6 @@ To remove empty directories, use the includeEmptyDirs atribute.
using filesets. Default is "false".
failonerror
- This flag (which is only of relevance if 'quiet' is false),
- controls whether an error -such as a failure to delete a file-
- stops the build task, or is merely reported to the screen.
- The default is "true"
+ Controls whether an error (such as a failure to delete a file)
+ stops the build or is merely reported to the screen.
+ Only relevant if
quiet
is "false".
+ Default is "true".
No
No
-
-
- includes
- Deprecated. Comma separated list of patterns of files that must be
- deleted. All files are in the current directory
- and any sub-directories are deleted when omitted.
- No
-
-
- includesfile
- Deprecated. The name of a file. Each line of this file is
- taken to be an include pattern
- No
-
-
- excludes
- Deprecated. Comma separated list of patterns of files that must be
- excluded from the deletion list. No files (except default excludes) are excluded when omitted.
- No
-
-
- excludesfile
- Deprecated. The name of a file. Each line of this file is
- taken to be an exclude pattern
- No
-
-
defaultexcludes
- Deprecated. Indicates whether default excludes should be used or not
- ("yes"/"no"). Default excludes are used when omitted.
- No
- Examples
<delete file="/lib/ant.jar"/>
@@ -106,8 +81,8 @@ and subdirectories of lib
.
deletes all files with the extension ".bak
" from the current directory
-and any sub-directories.
deletes all files with the extension .bak
from the current directory
+and any subdirectories.
<delete includeEmptyDirs="true" > <fileset dir="build" /> </delete>