This message was deleted.
# community-support
s
This message was deleted.
c
There is no such thing as a precompiled init script, they are distributed as the .init.gradle.kts files and require a Gradle version that can process them and is compatible with what they do.
s
c
Those are precompiled script plugins. You asked about init scripts.
s
Yes, this sounded as if also the init script itself could be binary. Anyway, then let's change the scope of my question to the plugin itself: In a Gradle project that only supports Groovy DSL, can I apply a (binary) plugin that has been written in Kotlin DSL via
init.gradle
(which itself is written in Groovy DSL)?
c
No, plug-ins have runtime dependencies that must be present. If the target Gradle version pre-dates Kotlin DSL the plug-in will fail to run.
s
Even is the plugin was a fat JAR (or something similar), bundling all its dependencies?
c
No. Gradle provides the runtime environment for plugins, including the Kotlin environment and Kotlin DSL.
s
Ok, thanks.
v
Are you sure @Chris Lee? Yes, Gradle provides the runtime environment, but if you use Kotlin stdlib in a Gradle version that does not care about Kotlin I'd exepect it to work. And regarding "init script", vs "script plugin", "init scripts" can apply plugins too. And you can pretty well have a
my-foo.init.gradle.kts
precompiled script plugin that then has
Gradle
as target and can be applied to an init script.
Whether it works in a non-Kotlin-aware Gradle you just have to try out. You might also need to then ship the Kotlin DSL part or not use it or something like that.
👍 1