I have this declaration in my kotlin/js gradle bui...
# kotest
r
I have this declaration in my kotlin/js gradle build:
Copy code
kotlin {
  jvmToolchain(17)
}
but as soon as I add the
id("io.kotest.multiplatform") version "5.5.5"
declaration to my build, gradle fails with:
Copy code
e: .../build.gradle.kts:89:16: The integer literal does not conform to the expected type Action<Any>
I'm pretty sure this is because the kotest gradle plugin is pulling a Kotlin 1.6 version and I'm hitting https://youtrack.jetbrains.com/issue/KT-47924/Remove-annoying-cast-in-toolchain-extension-method-for-Kotlin-DSL with was fixed in 1.7.0. Any ideas on the best workaround?
Commenting out the toolchain completely then results in a different problem:
Copy code
* What went wrong:
Could not determine the dependencies of task ':kotlinNpmInstall'.
> Could not create task ':rootPackageJson'.
   > Could not create task ':client:web:browserTest'.
      > 'org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackCssSupport org.jetbrains.kotlin.gradle.targets.js.webpack.KotlinWebpackConfig.getCssSupport()'
e
I just encountered the same error when trying to use BuildKonfig. I am not sure what version of the Kotlin Gradle plugin I’m using as it’s transitively included but it is probably 1.8.20 which should be recent enough. If I attempt to explicitly include it by running
Copy code
plugins {
 id("org.jetbrains.kotlin.plugin.scripting") version "1.8.22"
}
the compiler complains that
The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so compatibility cannot be checked
edit; I was able to overcome the error once I changed the plugin version to
1.8.21
matching BuildKonfig 0.13.3:
Copy code
buildscript {
    dependencies {
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.21")
    }
}
plugins {
    id("com.codingfeline.buildkonfig") version "0.13.3"
}
@rocketraman can you upgrade to 5.6.2 which uses 1.8.10?
r
That fixed the problem I reported above, thanks @Emre!
Still can't get it to work properly and run all my tests, but that's another issue: https://kotlinlang.slack.com/archives/CT0G9SD7Z/p1692941161344089
406 Views