I’m using gradle 7.5.1. Is there a way to tell overwrite=false (like ant) on gradly copy task so that it won’t overwrite the files if exists at destination directory… after googling, i found below solution but it is 4yrs old solution… is it the same even now also or do we have any simple flag we can set on copy task in latest gradle ?
task myCopy(type: Copy) {
def destination = project.file("WebContent")
from rootDir.getPath() + "/tmp"
into destination
eachFile {
if (it.getRelativePath().getFile(destination).exists()) {
it.exclude()
}
}
}