Giuseppe Barbieri
04/14/2025, 7:36 AMGiuseppe Barbieri
04/14/2025, 7:41 AMcompileJava.options.generatedSourceOutputDirectoryGiuseppe Barbieri
04/14/2025, 8:07 AMsourceSets.main.java {
srcDir(compileJava.options.generatedSourceOutputDirectory.get())
}
this creates a circular dependency though
Circular dependency between the following tasks:
radio commonradio-common-json:compileJava
\--- radio commonradio-common-json:compileJava (*)What's the proper way to solve this?
Giuseppe Barbieri
04/14/2025, 8:07 AMsourceSets.main.java {
srcDir(compileJava.options.generatedSourceOutputDirectory.get())
}
sourcesJar.dependsOn(compileJava)
delombok.dependsOn(compileJava)Thomas Broyer
04/14/2025, 8:17 AMsourceSets.main.output.generatedSourcesDirs instead (at least for sourcesJar)Giuseppe Barbieri
04/14/2025, 8:19 AMsrcDir then it's fine, but this introduce those further issues
> delombok should probably do that by default
it seems it hasnt, gradle warned me to fix that implicit dependencyThomas Broyer
04/14/2025, 8:21 AMGiuseppe Barbieri
04/14/2025, 8:21 AMassemble then I get unresolved classThomas Broyer
04/14/2025, 8:36 AMidea plugin in the Gradle build (not by adding the generated sources as sources to the source set that will generate them š š„ )
⢠Gradle should have task wiring OK so that ./gradle assemble "just works", unless some plugins are buggy (if you're using io.freefair.lombok, then the delombok should already be configured to take advantage of the generated sources, but won't delombok them as they shouldn't contain any lombok-isms: https://github.com/freefair/gradle-plugins/blob/cd47ebf3ed7a8741ebef5a780df8345ab3[ā¦]c/main/java/io/freefair/gradle/plugins/lombok/LombokPlugin.java); then you can possibly re-configure some tasks, e.g. the sourcesJar to add those generated sources (e.g. tasks.sourcesJar { from(sourceSets.main.output.generatedSourcesDirs) }.