task jflex {
inputs.source fileTree(
dir:'src', exclude:'**/.*/**', include:'com/admc/jcreole/*.grammar')
outputs.file new File('tmp/derived-src/com/admc/jcreole/CreoleScanner.java')
doLast {
...
javaexec {
...
}
}
}
I’ve been doing this for decades with Ant, but it’s not working with Gradle. The indicated source does exist and the indicated output does not exist-- how is Gradle concluding that this is up-to-date?
13:20:09.587 [DEBUG] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Determining if task ':jflex' is up-to-date
13:20:09.602 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire Exclusive lock on cache directory D:\Data\jcreole\.gradle.0-milestone-5\taskArtifacts.
13:20:09.602 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired.
13:20:09.634 [DEBUG] [org.gradle.api.internal.changedetection.DefaultFileCacheListener] Can cache files for directory 'D:\Data\jcreole\src' include 'com/admc/jcreole/*.grammar' exclude '**/.*/**'
13:20:09.649 [DEBUG] [org.gradle.api.internal.changedetection.DefaultFileCacheListener] Can cache files for file 'D:\Data\jcreole\tmp\derived-src\com\admc\jcreole\CreoleScanner.java'
...
[omitting detailed debug prints about cache locking]
13:20:09.727 [INFO] [org.gradle.api.internal.changedetection.DefaultTaskArtifactStateRepository] Skipping task ':jflex' as it is up-to-date.
13:20:09.743 [INFO] [org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter] Skipping task ':jflex' as it is up-to-date
(Removing the exclusion about hidden files, “/.*/”, has no effect).