handstandsam
05/09/2022, 2:36 PMkotlin-dsl
Script Plugin out of a gradle.kts
file into a normal .kt
file, I am saving ~55 seconds in the configuration phase under "Building included plugins."
NOTE: This is using the "Multiplatform Plugin" (see below post, but with JVM Only it still saves ~15 seconds)
Code & Gradle Build Scan Links: https://github.com/handstandsam/ShoppingApp/pull/58handstandsam
05/09/2022, 2:38 PMVampire
05/09/2022, 2:43 PM....gradle.kts
files are either called "script plugins" if applied with "apply from", or "precompiled script plugin" if they reside in buildSrc
or an included build.
"convention plugins" are often implemented as "precompiled script plugins", but those are not synonyms.
And that kotlins-dsl
enables precompiled script plugins is just one detail, it does more, so even without precompiled script plugins but with conventional Kotlin plugins it might be useful. πhandstandsam
05/09/2022, 2:55 PMVampire
05/09/2022, 2:57 PMhandstandsam
05/09/2022, 2:57 PMhandstandsam
05/09/2022, 2:59 PMVampire
05/09/2022, 3:03 PMhandstandsam
05/09/2022, 3:06 PMPrecompiled Script Plugin
, but it's being compiled the first time π , so a "not yet compiled pre-compiled script plugin"?Vampire
05/09/2022, 3:08 PMapply from
.
That you probably build on ephemeral build agents and do not use the task output cache is unlucky of course in terms of build time, especially if there is really such a worse performance.handstandsam
05/09/2022, 3:13 PM.kt
a "Precompiled Plugin" then?Vampire
05/09/2022, 3:15 PMclass
file and does not need to be interpreted dynamically each time it is used.Vampire
05/09/2022, 3:18 PMhandstandsam
05/09/2022, 3:27 PM.gradle.kts
but using .kt
instead.
So, not using .gradle.kts
for a Precompile Script Plugin seems like the winner to me.mbonnin
05/09/2022, 3:34 PMhandstandsam
05/09/2022, 3:36 PMVampire
05/09/2022, 3:38 PMmbonnin
05/09/2022, 3:38 PMmbonnin
05/09/2022, 3:38 PMmbonnin
05/09/2022, 3:39 PMhandstandsam
05/09/2022, 3:39 PMhandstandsam
05/09/2022, 3:39 PMJavier
05/09/2022, 4:41 PMhandstandsam
05/09/2022, 5:11 PMVampire
05/09/2022, 5:57 PM