I have the following basic zip task:
project.tasks.create(name:'zipBuildArtifacts', type:Zip) {
outputs.upToDateWhen { false }
dependsOn 'build'
from project.files((new File("${project.buildDir}/temp/jboss/foo/deployments/folder1/folder2/jarFolder").listFiles().findAll{it.name.startsWith("com.company.product")}))
}
On several systems, this works perfectly. It finds the file and always creates the zip. On other systems it always claims to be up-to-date. I added the following listener to make sure the data was there on the system before the call to execute the task
void beforeExecute(Task task) {
if(task.name == 'zipBuildArtifacts'){
println "beforeExecute of $task"
def list = []
def results = new File("${project.buildDir}/temp/jboss/foo/deployments/folder1/folder2/jarFolder").listFiles().findAll{it.name.startsWith("com.company.product")}
println 'list'
println results
println 'end list'
println 'inputs:'
task.inputs.getFiles().each{println it}
println "end of beforeExecute of $task"
}
}
On the system that fails I get the following:
:zipBuildArtifacts
beforeExecute of task ':zipBuildArtifacts'
list
[D:\Builds\build\components\compoennt1\temp\jboss\foo\deployments\folder1\folder2\jarFolder\com.company.product.feature1.jar, D:\Builds\build\components\compoennt1\temp\jboss\foo\deployments\folder1\folder2\jarFolder\com.company.product.feature2.jar, D:\Builds\build\components\compoennt1\temp\jboss\foo\deployments\folder1\folder2\jarFolder\com.company.product.feature3.jar
...]
end list
inputs:
end of beforeExecute of task ':zipBuildArtifacts'
So the files are there, and it clearly finds the files before it tried to execute the task but it is telling me:
Skipping task ':zipBuildArtifacts' as it has no source files.
Any idea why this would be system dependent? Both systems are windows. The working system runs from command line while the failing system is run through Jenkins, but both systems are using the wrapper.