3.19.10 Release Breaks My Build

38 views
Skip to first unread message

Kevin Jones

unread,
Jun 19, 2024, 4:02:24 AM6/19/24
to jOOQ User Group
Hi Lucas,

I'm using Gradle, which I know you love!

I've just tried to update my build to 3.19.10, literally by changing the JOOQ version number from 3.19.9 to 3.19.10 and the build breaks.

This is a Compose-Desktop app which is using the Kotlin Multiplatform plugin, that uses a couple of source sets, 'destopMain' and 'commonMain' . Notice that there is on no 'main' sourceset. I put my generated code into the 'commonMain; sourceset 

When I synchronize the Gradle build file after updating the JOOQ verrsion to 3.19.10 I get


Could not create task ':ksstats:compileKotlinDesktop'.
> Could not create task ':ksstats:jooqCodegen'.
   > SourceSet with name 'main' not found.


And if I look in the stacjtrace i get:

Caused by: org.gradle.api.UnknownDomainObjectException: SourceSet with name 'main' not found.
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.createNotFoundException(DefaultNamedDomainObjectCollection.java:529)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.named(DefaultNamedDomainObjectCollection.java:385)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.named(DefaultNamedDomainObjectCollection.java:393)
at org.jooq.codegen.gradle.CodegenTask.registerSourceSet(CodegenTask.java:104)
at org.jooq.codegen.gradle.CodegenPlugin.lambda$configureTask$2(CodegenPlugin.java:99)
at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
at org.gradle.api.internal.DefaultMutationGuard$1.execute(DefaultMutationGuard.java:45)
at org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:122)
at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:107)
at org.gradle.internal.ImmutableActionSet$SetWithManyActions.execute(ImmutableActionSet.java:329)
at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:262)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:125)
at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:256)
at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:1011)
... 312 more


Kevin

Lukas Eder

unread,
Jun 19, 2024, 11:06:25 AM6/19/24
to jooq...@googlegroups.com
Hi Kevin

May I tempt you to kindly provide a reproducer

Lukas
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/ee581f48-f50a-404f-9373-f70012d7ab64n%40googlegroups.com.

Lukas Eder

unread,
Jun 19, 2024, 12:06:57 PM6/19/24
to jooq...@googlegroups.com
OK, I get it now.

Before 3.19.10, we just didn't register any source sets at all, if there was no main source set.

I'm assuming, you manually added the output directory to a source set in your case?

To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+...@googlegroups.com.

Lukas Eder

unread,
Jun 19, 2024, 12:10:04 PM6/19/24
to jooq...@googlegroups.com

Kevin Jones

unread,
Jun 19, 2024, 2:58:39 PM6/19/24
to jooq...@googlegroups.com
Hey Lucas, 

thanks for looking into this so quickly.

This is the repo


The line that's causing the issue is in the root build.gradle file:

I have this:

    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>() {
        compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
        dependsOn(tasks["jooqCodegen"])
    }

I want jooqCodeGen to run when I do a compile and it's the 'dependsOn' that's causing the issue

HTH,

Kevin





--
Kevin Jones
KnowledgeSpike

Lukas Eder

unread,
Jun 20, 2024, 4:53:52 AM6/20/24
to jooq...@googlegroups.com
Thanks a lot for the reproducer, Kevin, that certainly helps save time and regression-test this particular case.

At least, until my next wrong assumption about how gradle works is exposed 😅

Lukas Eder

unread,
Jun 20, 2024, 9:36:17 AM6/20/24
to jOOQ User Group
In any case, the workaround should be to explicitly create the main source set in your build script, yes?

Kevin Jones

unread,
Jun 20, 2024, 10:30:51 AM6/20/24
to jooq...@googlegroups.com
That should work. I’ll give it a go when I’m back at my computer,

Kevin Jones
KnowledgeSpike


Lukas Eder

unread,
Jun 24, 2024, 3:20:48 AM6/24/24
to jOOQ User Group
I can confirm, this definitely works around the issue:

sourceSets {
  create("main")
}

In the meantime, https://github.com/jOOQ/jOOQ/issues/16842 has been fixed for 3.20.0 and 3.19.11. Thanks again for your report and reproducer. The reproducer will be helpful in preventing any regressions for kotlin multiplatform use-cases.

Kevin Jones

unread,
Jun 24, 2024, 3:28:10 AM6/24/24
to jooq...@googlegroups.com
Hey Lucas,

Thanks for your quick response, as always,

Kevin Jones
KnowledgeSpike


Reply all
Reply to author
Forward
0 new messages