Colton Idle
10/29/2025, 9:31 PMbuildSrc directory in your build
⢠separate included build (can be named build-logic for example
but an included build is also == composite buildMartin
10/29/2025, 9:34 PMMartin
10/29/2025, 9:35 PMprecompiled script plugin and convention pluginMartin
10/29/2025, 9:35 PMcomposite build is a build that includes at least one included buildMartin
10/29/2025, 9:36 PMColton Idle
10/29/2025, 9:36 PMEli Graber
10/29/2025, 9:46 PMall convention plugins are precompiled script pluginNo, you can have a binary convention plugin
Martin
10/29/2025, 9:55 PMEli Graber
10/29/2025, 9:59 PM.m2 directory in my project).Colton Idle
10/29/2025, 10:00 PMplugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
and
android{
kotlinOptions {
jvmTarget = "11"
}
}
between them to reduce duplication. (of course more will likely be shared in the future)
I'm using the docs from
https://docs.gradle.org/current/userguide/pre_compiled_script_plugin_advanced.html#structuring_precompiled_script_plugins
and
https://docs.gradle.org/current/userguide/best_practices_structuring_builds.html#favor_composite_builds
but no matter how much i bang my head against it. i cant get it to work. hence why i started back at the fundamentals of trying to figure out what the heck composite/convention/included builds are.
}Eli Graber
10/29/2025, 10:01 PMMartin
10/29/2025, 10:07 PMThat's only if it's part of your buildDo you have more details about this? If you move your plugins to a separate repo, it just moves the slow part to that separate repo? Or is there more to it?
Eli Graber
10/29/2025, 10:09 PMMartin
10/29/2025, 10:10 PMkotlin-dsl and precompiled scripts plugins is still slower than building it with org.jetbrains.kotlin.jvm and regular binary pluginsEli Graber
10/29/2025, 10:11 PMMartin
10/29/2025, 10:11 PMMartin
10/29/2025, 10:12 PMMartin
10/29/2025, 10:13 PMbuild-logic + org.jetbrains.kotlin.jvm , it's good enough and doesn't require a separate buildEli Graber
10/29/2025, 10:25 PMMartin
10/29/2025, 10:31 PMMartin
10/29/2025, 10:32 PMMartin
10/29/2025, 10:33 PMkotlin-dsl, you'll have to "unlearn" a bit of the Kotlin DSL syntax but I find that this is a feature, not a bug, because you'll need to understand how these things work at some point anyways.Martin
10/29/2025, 10:35 PMplugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
}
You'll have to replace this with something like (untested pseudo code)
class MyPlugin: Plugin<Project> {
override fun apply(project: Project) {
project.pluginManager.apply("com.google.android")
project.pluginManager.apply("org.jetbrains.kotlin.android")
}
}Martin
10/29/2025, 10:37 PMMartin
10/29/2025, 10:37 PMephemient
10/29/2025, 10:52 PMpluginManager as Martin says)ephemient
10/29/2025, 10:55 PMdependencyResolutionManagement { versionCatalogs { create("libs") { from(files("../gradle/libs.versions.toml")) } } } trick in your included build's settings, and then it's just a matter of working around https://github.com/gradle/gradle/issues/35222 to get the plugin versioned in the dependencyephemient
10/29/2025, 10:56 PMColton Idle
10/29/2025, 11:09 PMColton Idle
10/29/2025, 11:10 PMMartin
10/29/2025, 11:12 PMColton Idle
10/29/2025, 11:20 PMColton Idle
10/29/2025, 11:49 PMMartin
10/30/2025, 8:38 AMMartin
10/30/2025, 8:39 AMColton Idle
10/30/2025, 1:33 PM