Martmists
11/18/2025, 9:59 PMbuildSrc folder and my-plugin , the latter being included with includeBuild. I have a common.gradle.kts in my buildSrc, but if I try to add plugins { id("my-plugin-id") }, I get Plugin [id: 'my-plugin-id'] was not found in any of the following sources:
How do I fix this? I tried merging my-plugin with it, but because the plugin depends on kapt and kotlin-compiler-embeddable and such it ended up giving all sorts of gradle/kotlin errors. I also couldn't do implementation(project("../my-plugin")) it seems.Vampire
11/18/2025, 10:05 PMbuildSrc results and dependencies are on a parent classloader of the build script class paths, so it most probably simply cannot see the plugin that lives on a child classloader.
You could probably depend on the plugin from buildSrc as dependency so that it also lands on that class loader, or you switch buildSrc to a proper included build, so that it ends up on the same classloader as the other plugin.Martmists
11/18/2025, 10:20 PMbuild-plugin directory, but now all of my plugins require me to specify the plugin version again instead of using the version specified in buildSrc. Is there an easy way to reuse the versions from the now build-plugin folder?Vampire
11/18/2025, 10:25 PMbuildSrc is always a bit special and always a bit awkward in what it does.
It takes all its result and all its dependencies and puts them on a classloader that is the parent of all buildscript classloaders.
With doing so, the content and dependencies are automatically available in all build scripts, but also if you change anything in buildSrc each and every build script will be out-of-date and most probably each and every task.
If you use a proper included build, then it is like with any other dependency / plugin too.
It is only present in the build script of the project where you actually apply a plugin from it or manually add it to the classpath.
So you could for example apply a plugin from it to the root project, or declare in the root project a buildscript dependency on that included build's project, then it and all the dependencies make it to the root project classpath and thus also all other project classpaths.Martmists
11/18/2025, 10:26 PMcommon }` despite nothing else about build-plugin being different from how it was in buildSrcVampire
11/18/2025, 10:29 PMbuildSrc class loader, it is avaiable in a parent classloader and so the accessors are there for all projects.
If you have the plugin in the settings script classpath, it is also a parent of the build script classloaders.
But if you add the plugin to the root project classpath, the accessors are not available in the root project build script.
So easiest is, just use plugins { id("common") }, or add the plugin to a parent classloader if you insist on the accessors.Martmists
11/18/2025, 10:35 PMid("my-plugin-id") even though both are `includeBuild`ed, do I need to move my-plugin as child of build-plugin and include it in a nested settings.gradle.kts?Vampire
11/18/2025, 10:38 PMMartmists
11/18/2025, 10:39 PMVampire
11/18/2025, 10:54 PMincludeBuild the my-plugin in the build-plugin and then declare a dependency as usual.