I am trying to configure the build.gradle.kts
for a simple Kotlin Multiplatform library with no dependencies that has only common code but the kotlin gradle plugin reports "Please initialize at least one Kotlin target in ..."
.
This is the build.gradle.kts
:
plugins {
kotlin("multiplatform") version "1.9.22"
}
kotlin {
jvm()
mingwX64()
linuxX64()
applyDefaultHierarchyTemplate()
sourceSets {
commonMain
commonTest {
dependencies {
implementation(kotlin("test"))
}
}
}
}
Can you help me? Do you see any issue here or might the issue actually be in another file?
> Configure project :
e: Please initialize at least one Kotlin target in 'mylibrary (:)'.
Read more https://kotl.in/set-up-targets
w: The following Kotlin source sets were configured but not added to any Kotlin compilation:
* commonMain
* commonTest
You can add a source set to a target's compilation by connecting it with the compilation's default source set using 'dependsOn'.
See https://kotl.in/connecting-source-sets