Lets say I create a copy task A from a file as below
task A (type: Copy) {
from 'abc.txt'
into buildDir
eachFile { fileCopyDetails ->
println "Copying ${fileCopyDetails.getName()} from ${fileCopyDetails.getSourceName()}"}
}
And in a different file or the same file, I wish to do as below
A.configure {
rename 'xyz.txt'
}
I am expecting the output to be :
> Copying xyz.txt from abc.txt
But it prints
> Copying abc.txt from abc.txt
According to https://docs.gradle.org/current/javadoc/org/gradle/api/file/FileCopyDetails.html , getName() returns the base name of this file at the copy destination. But that is not how it is working in my case.