I'm trying to get koog working with gradle as a pl...
# gradle
a
I'm trying to get koog working with gradle as a plugin (we are trying to write a plugin to perform some AI related tasks for our CI + local builds). However it uses the new experimental
kotlin.uuid.Uuid
API and Gradle cannot find the class. Is there a good way to ensure my gradle daemon uses the right version of Kotlin under the hood + opt into the experimental API?
m
Use Gradle 9.0.0-rc-1, it should embed Kotlin 2
a
Sounds good, I'll take a look into updating it
Perfect, that solved it!
🙌🏻
e
hypothetically you could copy https://github.com/JetBrains/kotlin/blob/2.1.0/libraries/stdlib/src/kotlin/uuid/Uuid.kt into your plugin, which would then provide
kotlin.uuid.Uuid
on older Gradle versions. on newer Gradle versions,
embeddedKotlin
will be in a parent classloader and the class there should take precedence, so as long as Kotlin maintains binary compatibility, it should also work. * I have not actually tested this
👍🏻 1
t
Better solution would be not to use Koog directly in the plugin, but via tasks that uses workers with isolation mode. So Koog runtime is isolated from Gradle Kotlin runtime.
a
Is there anywhere online I can reference this pattern, @tapchicoma?
t
a
I'll read up on it, thank you!
m
I have also been working on Gratatouille to auto generate all that worker ceremony
👍 1