DeleteSpec
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.Namer
TASK_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(java.lang.Object... targets) |
Adds some files to be deleted by this task.
|
java.util.Set<java.lang.Object> |
getDelete() |
Returns the set of files which will be deleted by this task.
|
protected org.gradle.api.internal.file.FileResolver |
getFileResolver() |
|
protected org.gradle.internal.nativeintegration.filesystem.FileSystem |
getFileSystem() |
|
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(java.lang.Object target) |
Sets the files to be deleted by this task.
|
void |
setDelete(java.util.Set<java.lang.Object> targets) |
Sets the files to be deleted by this task.
|
void |
setFollowSymlinks(boolean followSymlinks) |
Set if symlinks should be followed.
|
appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString
conventionMapping, conventionMapping, getConventionMapping
newInputDirectory, newInputFile, newOutputDirectory, newOutputFile
@Inject protected org.gradle.internal.nativeintegration.filesystem.FileSystem getFileSystem()
@Inject protected org.gradle.api.internal.file.FileResolver getFileResolver()
protected void clean()
@Destroys public FileCollection getTargetFiles()
@Internal public java.util.Set<java.lang.Object> getDelete()
public void setDelete(java.util.Set<java.lang.Object> targets)
targets
- A set of any type of object accepted by Project.files(Object...)
public void setDelete(java.lang.Object target)
target
- Any type of object accepted by Project.files(Object...)
@Input public boolean isFollowSymlinks()
public void setFollowSymlinks(boolean followSymlinks)
setFollowSymlinks
in interface DeleteSpec
followSymlinks
- if symlinks should be followed.public Delete delete(java.lang.Object... targets)
Project.files(Object...)
.delete
in interface DeleteSpec
targets
- Any type of object accepted by Project.files(Object...)