Hello, Is there a way to make gradle skip copy task, if the files already exists and their contents hasn’t been changed? Thank you!!
Well I almost found the answer. I think it’s possible by using sync task:
task mycopy<<
{
sync{
from ("$projectDir/conf/templates"){ include ("web-log4j.properties") }
filter{line ->line.replaceAll("@@@LEVEL@@@","$log4jlevel")}
filter{line ->line.replaceAll("/home/publication-log/","/home/publication-log/instances/$customer/logs/")}
into ("$buildDir/home/publication-log/instances/$customer/configuration")
rename("web-log4j.properties","lo4g.properties")
}
sync{
from("$projectDir/sql"){include('**/*')}
from("$projectDir/customer_specific_data"){include('*.sql')}
into("$buildDir/home/publication-log/instances/$customer/configuration/sql")
}
}
Now all I need is to apply exclude files lists in case it’s already exists. Any suggestions please? Thank you
There is no ‘sync’ method. What you want is ‘task mysync(type: Sync) { … }’.