today I've noticed that the hibernate-gradle-plugin causes compile tasks to be always out of date even if nothing changed. This is caused by a Gradle shortcoming described in https://github.com/gradle/gradle/issues/5510.
Essentially lambdas are not allowed in doLast or doFirst configurations on Java, which the plugin uses though. To workaround this issue we can simply extract the lambda to a dedicated Action. I have a branch ready that I'll attach shortly. Before my fix I've seen the following:
After my changes I see the expected output if nothing changed:
In our case this saves us up to 12 seconds on every run where nothing changed in the java main source - e.g. if only tests changed.
Let me know what you think.