This message was deleted.
# community-support
s
This message was deleted.
v
Gradle should always be strict about this and also fail consistently locally.
Hm, ok, this is unlucky and might be worth an issue report. The
compileJava
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.
But your fix should be fine. Before you had the whole
build/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.
❤️ 1
b
Should I create an issue for this? Because as you said this issue is detected only when
compileJava
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.
v
Yes, as I said, I personally consider this a bug in the detection. I have no idea whether it is intentional, or whether there is a technical limitation, or whether it worked before. But anyway I think it is worth a bug report, yes, then we see what the Gradle folks think about it.
Please also post the link here after posting for followup
👍 1
With configuration cache enabled it is even worse, as there all tasks can run in parallel. With that I was not yet able to reproduce the error at all
b
https://github.com/gradle/gradle/issues/27576 I linked this conversation and I also mentioned you there to give credit for all the research 😉 Thank you
👌 1