ericksli
02/11/2024, 10:17 AMkspJvm
, only have ksp
dependencies {
add("kspJvm", libs.findLibrary("dagger.hilt.compiler").get())
}
It just say build fail and does not have configuration of kspJvm
. However, it works before moving the code into convention plugin:
dependencies {
add("kspJvm", libs.dagger.hilt.compiler)
add("jvmTestImplementation", platform(libs.junit.bom))
add("jvmTestRuntimeOnly", platform(libs.junit.bom))
}
Some dependencies cannot be resolved
Before moving the code into convention plugin:
kotlin {
sourceSets {
jvmTest.dependencies {
compileOnly(libs.junit4)
runtimeOnly(libs.junit.jupiter.engine)
implementation(libs.junit.jupiter)
implementation(libs.junit.jupiter.api)
implementation(libs.junit.jupiter.params)
runtimeOnly(libs.junit.vintage.engine)
implementation(libs.kotest.runnerJunit5)
implementation(libs.mockk)
}
}
}
After moving into convention plugin:
extensions.configure<KotlinMultiplatformExtension> {
with(sourceSets) {
jvmTest.dependencies {
compileOnly(libs.findLibrary("junit4").get())
runtimeOnly(libs.findLibrary("junit.jupiter.engine").get())
implementation(libs.findLibrary("junit.jupiter").get())
implementation(libs.findLibrary("junit.jupiter.api").get())
implementation(libs.findLibrary("junit.jupiter.params").get())
runtimeOnly(libs.findLibrary("junit.vintage.engine").get())
implementation(libs.findLibrary("kotest.runnerJunit5"))
implementation(libs.findLibrary("mockk").get())
}
}
}
Gradle complaints that kotest.runnerJunit5
is not found, but I have no idea as it should have no typo and it works before moving into convention plugin
How to resolve these issue? thanks a lot