Hi Steve,
since Gradle 3.0 we also track the implementation of a task and its classpath for up to date checks: https://docs.gradle.org/3.0/release-notes#incremental-build-improvements
This would explain why your task is not up to date and gets re-executed.
Cheers,
Stefan