Closed JohnLCaron closed 1 year ago
https://discuss.kotlinlang.org/t/specifying-the-kotlin-version-in-gradle-multi-project-builds/23838
create root level build.gradle.kts::
plugins {
java
kotlin("jvm") version "1.7.21" apply false
}
gives error:
org.gradle.internal.exceptions.LocationAwareException: Build file '/home/snake/dev/github/electionguard-kotlin-multiplatform/egklib/build.gradle.kts' line: 10
Error resolving plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.7.21']
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:233)
... 185 more
Caused by: org.gradle.plugin.management.internal.InvalidPluginRequestException: 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.
at org.gradle.plugin.use.resolve.internal.AlreadyOnClasspathPluginResolver.resolve(AlreadyOnClasspathPluginResolver.java:84)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:229)
Part of the problem may be that is that egklib and hacllib use:
kotlin("multiplatform") version "1.7.21"
but webapps uses
kotlin("jvm") version "1.7.21"
Would be nice to put
val kotlinVersion by extra("1.7.21")
in some common place, then use it like
kotlin("multiplatform") version kotlinVersion
putting it in buildSrc/build.gradle.kts doesnt work putting it in build.gradle.kts doesnt work
putting
kotlinVersion=1.7.21
into gradle.properties
and then can use
plugins {
kotlin("multiplatform") version providers.gradleProperty("kotlinVersion").get()
...
but only if theres a
buildscript {
repositories {
}
}
above the plugins (ok to be empty), otherwise you get
/home/snake/dev/github/electionguard-kotlin-multiplatform/hacllib/build.gradle.kts:3:37: Unresolved reference: providers
The usual gradle "ya just gotta know" bullshit
https://discuss.kotlinlang.org/t/specifying-the-kotlin-version-in-gradle-multi-project-builds/23838
Adding this to buildSrc/build.gradle.kts:
gives error:
seems to interfere with the use of dependencyResolutionManagement in settings.gradle.kts