I'd like to define a version constant in guild.gradle.kts
file so that it can be used even in the plugins
block. The plugins
block requires restricted syntax:
«plugin version»
must be constant, literal, strings
Following the restriction I tried to define the a version constant:
const val kotlinVersion = "1.3.72"
plugins {
java
kotlin("jvm") version kotlinVersion
}
However this fails with message
Const 'val' are only allowed on top level or in objects
even though the declaration seem to meet all const requirements. Why cannot be const val
used in build.gradle.kts?