From 9deb5178742fa96bc7660c2365bdfdbf3e9a4999 Mon Sep 17 00:00:00 2001 From: MCKero Date: Sun, 27 Sep 2026 10:28:37 +0100 Subject: [PATCH] fix(build): configure core domain source sets through container members The second CI round got past the missing configure import but still failed in the same file: bare name accessors inside sourceSets { } (commonMain.dependencies { ... }, commonTest, jvmTest) are kotlin-dsl script syntax generated for .kts files. Plugin source compiled as plain Kotlin has no such accessors on its classpath, so the four dependency blocks failed with receiver type mismatches while every real member call around them - jvmToolchain, jvm(), the ios targets, binaries.framework - already resolved. Configure the source sets through the container API instead: sourceSets.getByName("commonMain").dependencies { ... }. getByName, dependencies and implementation are all members on types that ship with KGP 2.4.10, verified against the gradle plugin jars byte for byte. getByName is safe at this point because jvm() above has just created the jvm source sets synchronously; commonMain and commonTest exist as soon as the multiplatform plugin is applied. --- .../look4sat/convention/CoreDomainPlugin.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/CoreDomainPlugin.kt b/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/CoreDomainPlugin.kt index a132f85c..1bec7c38 100644 --- a/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/CoreDomainPlugin.kt +++ b/build-logic/convention/src/main/java/com/rtbishop/look4sat/convention/CoreDomainPlugin.kt @@ -46,20 +46,22 @@ internal class CoreDomainPlugin : Plugin { isStatic = true } } - sourceSets { - commonMain.dependencies { - implementation(libs.kotlin.coroutines) - implementation(libs.kotlin.serialization) - } - commonTest.dependencies { - implementation(libs.kotlin.test) - implementation(libs.test.coroutines) - } - // JVM-only tests live here: the AndroidManifest check reads the file system, and - // the formatter oracle tests compare against java.lang.String.format. - jvmTest.dependencies { - implementation(libs.test.junit4) - } + // The bare name accessors (commonMain, jvmTest, ...) are script-only syntax; + // plugin source has to resolve through the container members, so configure each + // source set by name. getByName is safe here: jvm() above has just created the + // jvm source sets, the same pattern the local probe build script relies on. + sourceSets.getByName("commonMain").dependencies { + implementation(libs.kotlin.coroutines) + implementation(libs.kotlin.serialization) + } + sourceSets.getByName("commonTest").dependencies { + implementation(libs.kotlin.test) + implementation(libs.test.coroutines) + } + // JVM-only tests live here: the AndroidManifest check reads the file system, and + // the formatter oracle tests compare against java.lang.String.format. + sourceSets.getByName("jvmTest").dependencies { + implementation(libs.test.junit4) } } }