Run gradle task.... Ignore all dependency resolution

I need a task which doesnt have any dependency resolution , or any prior operation… just need for some clean up… should just do clean up and nothing else…

Please explain in more detail. Gradle won’t perform any dependency resolution unless the task operates on some dependencies.

By the way, this should be marked as a question rather than a problem.

This is my gradle task where I am trying to delete the ${HOME}/.gradle/caches directory

task cleanCache (type:Delete) {

def home = System.getenv()[‘HOME’]

println “Cleaning up gradle cache in ${home}”

delete “${home}/.gradle/caches” }

It doesnt have any dependency, still it downloads several things and does a lot of thing, I just want a simple folder deletion. Should not do anything other then this…

If executing this task downloads something, then something is wrong somewhere else in the build script(s). Specifically, some code does something in the configuration phase of the build that should only be done in the execution phase. This is a common mistake.