<@U0BUH9FRD> which feature, `gradle.properties` or...
# spring
l
@sdeleuze which feature,
gradle.properties
or
ext['kotlin.version]
? i’d prefer the latter, since it centralized the kotlinVersion definition
c
actually it's not, if you're using
plugins {}
syntax you do not have access to project properties and will end up declaring it both in
plugins {}
block and in
gradle.properties
.
l
with the
plugins {}
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 script
c
I tend to use
plugins{}
with literal and in other places I just resolve from the plugin:
Copy code
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
}
l
imho, this reads way more complicated, and i’d much prefer the current spring boot gradle script
c
yeah, well, then you have version in two places
l
why? without using
plugins{}
, the version is centralized to the
kotlinVersion
c
For dependencies - yes, for plugin itself - no.
Oh, sorry, without
plugins {}
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.
By the way, by not using
plugins {}
you're tying yourself to legacy method of declaring plugins, which is already being discouraged by gradle team.
l
yeah, myself still prefer using the ‘legacy’ method of applying plugins, at least until the plugins DSL is more powerful or the gradle kotlin-dsl is mature 🙂
@Czar with gradle 4.4 released, the reported kotlin plugin module name seems changed from
kotlin-gradle-plugin
to
org.jetbrains.kotlin.jvm.gradle.plugin
c
Thanks, I'll take this into account when time comes to upgrade. But my next upgrade will probably be to a higher version. I don't do this often, it was 3.5, then 4.0.1, now 4.3.1, so probably I won't upgrade until something like 4.5 or even higher 🙂
l
👍 i was looking at gradle 4.4 only because i heard it supports the settings.gradle.kts