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 call Delete.setFollowSymlinks(boolean) with true. On systems that do not support symlinks, this will have no effect.

Properties

PropertyDescription
delete

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

followSymlinks

Returns if symlinks should be followed when doing a delete.

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

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

boolean followSymlinks

Returns if symlinks should be followed when doing a delete.

FileCollection 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[]).