Comparable<Task>, DeleteSpec, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, Configurable<Task>@DisableCachingByDefault(because="Deletion cannot be cached") public class Delete extends org.gradle.api.internal.ConventionTask implements DeleteSpec
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
setFollowSymlinks(boolean) with true. On systems that do not support symlinks,
this will have no effect.Task.NamerTASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE| Constructor | Description |
|---|---|
Delete() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
clean() |
|
Delete |
delete(Object... targets) |
Adds some files to be deleted by this task.
|
Set<Object> |
getDelete() |
Returns the set of files which will be deleted by this task.
|
protected org.gradle.internal.file.Deleter |
getDeleter() |
|
FileCollection |
getTargetFiles() |
Returns the resolved set of files which will be deleted by this task.
|
boolean |
isFollowSymlinks() |
Returns if symlinks should be followed when doing a delete.
|
void |
setDelete(Object target) |
Sets the files to be deleted by this task.
|
void |
setDelete(Set<Object> targets) |
Sets the files to be deleted by this task.
|
void |
setFollowSymlinks(boolean followSymlinks) |
Set if symlinks should be followed.
|
conventionMapping, conventionMapping, getConventionMappingcompareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesServiceappendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getOnlyIf, getReasonNotToTrackState, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, prependParallelSafeAction, setImpliesSubProjectsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdoNotTrackState, getConventionprotected void clean()
throws IOException
IOException@Destroys public FileCollection getTargetFiles()
@Internal public Set<Object> getDelete()
public void setDelete(Set<Object> targets)
targets - A set of any type of object accepted by Project.files(Object...)public void setDelete(Object target)
target - Any type of object accepted by Project.files(Object...)@Input public boolean isFollowSymlinks()
public void setFollowSymlinks(boolean followSymlinks)
setFollowSymlinks in interface DeleteSpecfollowSymlinks - if symlinks should be followed.public Delete delete(Object... targets)
Project.files(Object...).delete in interface DeleteSpectargets - Any type of object accepted by Project.files(Object...)@Inject protected org.gradle.internal.file.Deleter getDeleter()