I have a composite build containing precompiled script plugins.
However some code does not compile because it can't find
replaceFirstChar
. It seems that gradle (7.3) bundles an older kotlin version. Is it possible to change that version so the new functions are usable?
v
Vampire
11/30/2021, 3:03 PM
No, you have to live with the shipped Kotlin version and take care that your plugins are compatible with the versions shipped in all Gradle versions you target.
That's one of the reasons it is imho a bad idea to write shared Gradle logic in Kotlin.
I like to write Gradle logic that is local to one build in Kotlin, but if I write a plugin that should be compatible with as many Gradle versions as possible, imho the only sane choice is using pure Java 8 (or whatever is the lowest version of Java supported for running by the lowest version of Gradle you want to support)
☝️ 1
p
Paul Woitaschek
11/30/2021, 3:07 PM
Its a local plugin, but I can't even find a way to just force it to use the latest std, not even with implicit kotlin("jvm") 1.6 and the stdlibs applied
v
Vampire
11/30/2021, 3:08 PM
Consider the first word of my answer. 😉
p
Paul Woitaschek
11/30/2021, 3:08 PM
I don't like them 😉
v
Vampire
11/30/2021, 3:08 PM
For a local plugin using Kotlin is great, but you have to use the shipped Kotlin version, fullstop. 🙂
Vampire
11/30/2021, 3:09 PM
You can submit a PR to Gradle that changes this, but that would most probably a very complex task. 🙂