How can you apply the serialization plugin in the ...
# gradle
h
How can you apply the serialization plugin in the buildSrc? This results into an error:
Copy code
plugins {
    `kotlin-dsl`
    kotlin("plugin.serialization") version "1.7.0"
}

repositories {
    gradlePluginPortal()
    mavenCentral()
}
1
Okay, stupid error: The plugin version should match the internal Kotlin version: https://docs.gradle.org/current/userguide/compatibility.html
e
FYI
embeddedKotlinVersion
is available in Kotlin build scripts
f
Lately I'm starting to use
embeddedKotlinVersion
everywhere. Sticking with the latest Kotlin makes all things impossible to use in Gradle. 😛
a
Never heard of
embeddedKotlinVersion
before, thanks for the information :)
v
may i know which determines the
embeddedKotlinVersion
how can i change this?
e
https://docs.gradle.org/current/userguide/compatibility.html#kotlin it is fixed in each gradle version; you cannot change it
v
ok... so what is the difference between using this embeddedKotlinVersion and kotlin language version... i'm using serialization libraries with kotlin version 1.7.0 like this...
Copy code
buildscript {
     val kotlinVersion = "1.7.0"
}
...
dependencies {
   classpath("org.jetbrains.kotlin:kotlin-serialization:$kotlinVersion")
}
can i safely replace the kotlinVersion with embeddedKotlinVersion?.. What is the difference between both of them. and what is the usecase of
embeddedKotlinVersion
e
embeddedKotlinVersion
is useful when you need to be compatible with `org.gradle.kotlin.embedded-kotlin`/`org.gradle.kotlin.kotlin-dsl`. if you're not writing a gradle plugin (or something which will be used as a gradle buildscript dependency) then don't worry about it.
v
ok thanks!
201 Views