You can define the version inside plugins, and then make this version available outside the blog, for example. in the section dependencies.
plugins {
kotlin("jvm").version("1.1.61")
}
//This is necessary to make the version accessible in other places
val kotlinVersion: String? by extra {
buildscript.configurations["classpath"]
.resolvedConfiguration.firstLevelModuleDependencies
.find { it.moduleName == "kotlin-gradle-plugin" }?.moduleVersion
}
dependencies {
compile(kotlin("stdlib", kotlinVersion))
}
for version 1.2+, you will need to replace with kotlin-gradle-plugin org.jetbrains.kotlin.jvm.gradle.plugin
source
share