The Kotlin DSL plugins {} block interpreter bypasses the Kotlin compiler when compiling scripts is required and the plugins {} block is declarative only. This provides substantial performance improvements when preconditions are met.
The first version introduced in Gradle 8.0 only supports a few constructs available in the plugins {} block. For example the usage of version catalog aliases is not supported. In such cases Gradle falls back to invoking the Kotlin compiler.
As part of this we could consider warning if the optimization cannot be applied.
The optimization could also be applied to precompiled scripts.
The Kotlin DSL
plugins {}
block interpreter bypasses the Kotlin compiler when compiling scripts is required and theplugins {}
block is declarative only. This provides substantial performance improvements when preconditions are met.The first version introduced in Gradle 8.0 only supports a few constructs available in the
plugins {}
block. For example the usage of version catalog aliases is not supported. In such cases Gradle falls back to invoking the Kotlin compiler.As part of this we could consider warning if the optimization cannot be applied.
The optimization could also be applied to precompiled scripts.