If you declare a file in inputs.files
or outputs.files
then gradle will ALWAYS consider the file(s) in the UP-TO-DATE
checks.
Adding an outputs.upToDateWhen {}
closure does not stop the normal input/output file checking. It simply gives you as a developer another chance to stop the task from being UP-TO-DATE
. Returning true from this closure does not override the usual input/output file hash checking.
I get the feeling that you should only use a custom upToDateWhen {}
closure and not use inputs.files
This will mean that your custom logic is the only thing that’s considered in the UP-TO-DATE
check.