task copyConfigFiles {
def src = System.getenv()['SOURCE']
def dest = System.getenv()['DESTINATION']
copy {
from "${src}/config/etc/"
into "${dest}/home/tivo/etc"
include 'test*.conf'
rename { String fileName ->
fileName.replace('testABC.conf', 'ABC.conf')
}
rename { String fileName ->
fileName.replace('testPQR.conf', 'PQR.conf')
}
rename { String fileName ->
fileName.replace('testSTU.conf', 'STU.conf')
}
rename { String fileName ->
fileName.replace('testXYZ.conf', 'XYZ.conf')
}
fileMode = 0644
}
}
I want this code to be forcefully executed. I mean if it is executed twice consecutively, it should actually copy file twice. I saw some solutions like
outputs.upToDateWhen {
false
}
but it does not actually copy file twice. since if any file in SOURCE is changed is not reflected in DESTINATION directory.
Is there any good clean solution to do that?