Watching Non-Java Files to Trigger a Java Build

Adding this line to the bottom of your build.gradle.kts:

tasks.named("compileJava") { outputs.upToDateWhen { false }  }

And just running:

 gradle -i -Dconsole=verbose --build-cache -t compileJava

…also worked. No clean required in that case.

After running ...-t compileJava just the one initial time, I was of course then able to make as many changes as I liked to your HTML input file. Each time, the change was regenerated and recompiled into those two files I listed earlier.

1 Like