Slackbot
01/03/2024, 11:06 AMVampire
01/03/2024, 11:26 AMVampire
01/03/2024, 11:53 AMcompileJava task has to execute before the sourcesJar task to trigger the error (of course without having an ordering constraint or the error would not happen).
If you run gw :gradle-plugin:compileJava :gradle-plugin:sourcesJar with the compileKotlin task up-to-date, the compileJava should be done before sourcesJar and then the error also locally reproduces properly. But if the compileKotlin task is run, it probably uses the worker API and thus the sourcesJar task can run in parallel and finish before the compileJava task is executed which hides the error.
This is actually a bit pointless, because if the compileJava task runs second it would exactly be the main problem caused by the overlapping outputs that should be prevented with this check.Vampire
01/03/2024, 11:54 AMbuild/generated/ as output directory of createVersionsKtFile which causes overlapping output with compileJava which has a subdirectory of that for annotation processor generated sources.
By giving the createVersionsKtFile a dedicated output directory that does not overlap with other tasks, you did exactly the right thing to fix the problem.Brais Gabín Moreira
01/03/2024, 11:58 AMcompileJava is executed before sourcesJar. But it would be nice a way to always detect this issues and no just hope to be lucky with the code execution.Vampire
01/03/2024, 12:03 PMVampire
01/03/2024, 12:28 PMVampire
01/03/2024, 12:35 PMBrais Gabín Moreira
01/03/2024, 1:19 PM