Let's say you have a multi module project, where e...
# gradle
p
Let's say you have a multi module project, where each module has some common build logic. Is it better: A. to extract that logic into a plugin
plugins { id("shared-build") }
) B. or is it also okay apply it
apply(from: "shared-build.gradle.kts")
Does using apply from have any impact on build performance?
c
build-logic composite project is a good starting point.
v
"apply from" should not have significant impact on the build performance, but a major (negative) impact on your quality of life. Such legacy script plugins have many drawbacks and quirks like unintuitive class loader handling leading to hard to diagnose build bugs, the inability to use the
plugins { ... }
DSL, thus also no type-safe accessor for Kotlin DSL, ... Using a convention plugin is the way better way to go as Chris indicated.
g
Exactly what Björn said, script plugins are almost unusable with Kotlin DSL
p
I see, thanks for answers!
e
On huge multimodule builds I use convention plugins and version catalogs to manage shared build logic