Björn Mayer
02/21/2021, 8:52 PMKotlinPlatformJvmPlugin
applied.
This is what I tried so far in my root `build.gradle.kts`:
subprojects {
plugins.withType<KotlinPlatformJvmPlugin> {
dependencies {
"testImplementation"(kotlin("test-junit5"))
}
tasks.withType<Test> {
useJUnitPlatform()
}
}
}
and
subprojects {
if (pluginManager.hasPlugin("kotlin-platform-jvm")) {
// dependency
// useJunit blabla
}
}
Both do not work. Is there a way to do this?araqnid
02/21/2021, 9:08 PMBjörn Mayer
02/21/2021, 9:13 PMafterEvaluate {
if (pluginManager.hasPlugin("org.jetbrains.kotlin.jvm")) {
tasks.withType<Test> {
useJUnitPlatform()
}
}
}
Thank you very much 🙂Vampire
02/21/2021, 9:36 PMafterEvaluate
wherever you can and instead use reactive APIs.
Your first example should work fine I think, if the class was the correct one.
Which can easily be the wrong one if you for example use script plugins and so on as the class could come from a different class loader.
So maybe you want to try using plugins.withId("org.jetbrains.kotlin.jvm") { ... }
instead.jbnizet
02/21/2021, 9:41 PM