Delete

API Documentation:Delete

Deletes files or directories. Example:

task makePretty(type: Delete) {
  delete 'uglyFolder', 'uglyFile'
  followSymlinks = true
}

Be default symlinks will not be followed when deleting files. To change this behavior, set Delete.getFollowSymlinks() property to true. On systems that do not support symlinks, this will have no effect.

Properties

PropertyDescription
delete
Deprecated

The set of files which will be deleted by this task.

followSymlinks
Incubating

Specifies whether or not symbolic links should be followed during deletion.

targetFiles

The resolved set of files which will be deleted by this task.

Methods

MethodDescription
delete(targets)

Adds some files to be deleted by this task. The given targets are evaluated as per Project.files(java.lang.Object[]).

Script blocks

No script blocks

Property details

Set<Object> delete

Note: This property is deprecated and will be removed in the next major version of Gradle.

The set of files which will be deleted by this task.

Property<Boolean> followSymlinks

Note: This property is incubating and may change in a future version of Gradle.

Specifies whether or not symbolic links should be followed during deletion.

ConfigurableFileCollection targetFiles (read-only)

The resolved set of files which will be deleted by this task.

Method details

Delete delete(Object... targets)

Adds some files to be deleted by this task. The given targets are evaluated as per Project.files(java.lang.Object[]).