I have a composite build containing precompiled script plugins. However some code does not compile b...
p
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
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
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
Consider the first word of my answer. 😉
p
I don't like them 😉
v
For a local plugin using Kotlin is great, but you have to use the shipped Kotlin version, fullstop. 🙂
You can submit a PR to Gradle that changes this, but that would most probably a very complex task. 🙂