I am hitting a strange bug with gradle 2.12. My task is being considered up to date when it has input files and I explicitly disabled the up-to-date checking. Given the setup below, running
gradle doCopy
works as expected. Running
gradle clean doCopy
results in the task always being up-to-date and thus the task is skipped. It appears that SkipEmptySourceFilesTaskExecuter thinks the source files are empty when they are not.
This could be related to Zip task ignores output when checking if up to date and GRADLE-2579
To reproduce:
build.gradle:
apply plugin: ‘java’
configurations {
cfg
}
dependencies {
cfg files("$projectDir/replaceme.zip")
}
task doCopy(type: Copy) {
outputs.upToDateWhen { false }
def templates = zipTree(configurations.cfg.singleFile).matching({ "folder/*" }).files;
println "TEMPLATES: " + templates;
from(templates) {
include '**/replaceme.json'
expand([bar: "BBB"])
}
into "$buildDir"
}
replaceme.zip/folder/replaceme.json:
{
"foo": ${bar}
}