i have a simple buildSrc configuration for dependency versions
a buildSrc/gradle.build.kts:
repositories {
jcenter()
}
plugins {
`kotlin-dsl`
}
dependencies {
implementation(kotlin("script-runtime"))
}
I would like to point out that my kotlin script wouldnt work at all without the script-runtime dependency and I have never seen any documentation saying its required but once i added it an error went away:
"No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies."
Then i have a simple object script buildSrc/src/main/java/Versions.kts
object Versions {
val kotlin = "1.3.61"
val kotlinFrontentPlugin = "0.0.45"
}
Doesnt get much simpler.
Then in my root project i have: build.gradle.kts:
buildscript {
repositories {
google()
mavenCentral()
jcenter()
maven("https://plugins.gradle.org/m2/")
maven("https://dl.bintray.com/kotlin/kotlin-eap")
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}")
classpath("org.jetbrains.kotlin:kotlin-frontend-plugin:${Versions.kotlinFrontendPlugin}")
}
}
This is all just straight up copy and paste. but all i can get is:
Line 12: classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.kotlin}") ^ Unresolved reference: kotlin
Line 13: classpath("org.jetbrains.kotlin:kotlin-frontend-plugin:${Versions.kotlinFrontendPlugin}") ^ Unresolved reference: kotlinFrontendPlugin
Does buildSrc just no longer work in builds anymore or is there yet some other undocumented setting or action i need to take?
Found the issue. I accidentally named my object as a script Versions.kts when it needed to be Versions.kt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With