leodeng
11/27/2017, 2:04 PMgradle.properties
or ext['kotlin.version]
? i’d prefer the latter, since it centralized the kotlinVersion definitionCzar
11/27/2017, 2:27 PMplugins {}
syntax you do not have access to project properties and will end up declaring it both in plugins {}
block and in gradle.properties
.leodeng
11/27/2017, 3:13 PMplugins {}
syntax, the version has to be literal, so it won’t accept any variable anyways. and with ext['kotlin.versino']
it at least works with the current spring boot gradle scriptCzar
11/27/2017, 4:28 PMplugins{}
with literal and in other places I just resolve from the plugin:
plugins {
val kotlinVersion = "1.1.61"
java
id("org.jetbrains.kotlin.jvm") version kotlinVersion
id("org.jetbrains.kotlin.plugin.jpa") version kotlinVersion
}
val kotlinVersion: String? by extra {
buildscript.configurations["classpath"]
.resolvedConfiguration.firstLevelModuleDependencies
.find { it.moduleName == "kotlin-gradle-plugin" }?.moduleVersion
}
leodeng
11/27/2017, 7:14 PMCzar
11/27/2017, 8:05 PMleodeng
11/28/2017, 12:05 AMplugins{}
, the version is centralized to the kotlinVersion
Czar
11/28/2017, 7:27 AMCzar
11/28/2017, 7:29 AMplugins {}
I actually don't know, but I doubt spring plugin can control kotlin plugin's version even with apply plugin
syntax. Again, I'm not sure, so best check.Czar
11/28/2017, 7:30 AMplugins {}
you're tying yourself to legacy method of declaring plugins, which is already being discouraged by gradle team.leodeng
11/28/2017, 2:20 PMleodeng
12/06/2017, 11:25 AMkotlin-gradle-plugin
to org.jetbrains.kotlin.jvm.gradle.plugin
Czar
12/06/2017, 11:27 AMleodeng
12/06/2017, 11:34 AM