Stefano Zanella
08/19/2024, 6:08 PMbuildSrc folder, but it's not a convention plugin (i.e. it's declared using the gradle plugin development plugin). This works but if I declare dependencies inside the buildSrc/build.gradle.kts file then afaiu these dependencies are shared across all plugins I'd declare there. What's the best approach here? Move the plugin to its own separate subproject (and if so, how do I then make it available to the rest of the build as a plugin)? Or rather convert to a convention plugin (in which case, can I then declare and reference classes declared outside the convention build script)? Any suggestions?Vampire
08/19/2024, 6:38 PMbuildSrc. Then you can properly separate your plugins and their dependencies. If they are still in buildSrc you have better structure in your sources, but at runtime still all will be one big bunch as the whole buildSrc result is prepended to the build script classpaths. If you use composite build instead, the plugins are more like usual and only are built when used and only in the classpaths where you use them / add them.Stefano Zanella
08/19/2024, 6:57 PMplugins/python folder:
• how do I make it available as a plugin to the rest of the build? afaik the buildSrc trick does it for you but if it's just another subproject it needs to be available to the build and not the project being built
• sort of unrelated, but is there a way to tell gradle to import "all projects inside a folder"? In this case, if I have multiple plugins, is there a way to have just one declaration in settings.gradle.kts instead of one per plugin? (more of a bikeshedding thing this one, really)Vampire
08/19/2024, 9:42 PMhow do I make it available as a plugin to the rest of the build?What do you mean with "folder"? Do you mean an own project in your build? Do you mean an own build? Do you mean anything else? If the first, then you cannot use it in the same build, that would be chicken-and-egg. If the second, the term you want to look up in the userguide is "composite build". If the third, ... well ...
but is there a way to tell gradle to import "all projects inside a folder"?You have a programming language at hand, just list the directory, and include all if you really want that. Or look for a plugin that does it for you, I guess there are some out there.
Stefano Zanella
08/20/2024, 5:18 AMephemient
08/20/2024, 5:46 AMincludeBuild a project with subprojects, e.g.
// settings.gradle.kts
pluginManagement {
includeBuild("plugins")
}
// plugins/settings.gradle.kts
include(":foo")
include(":bar")
then :plugins:foo and :plugins:bar can declare plugins that can be used in : buildStefano Zanella
08/20/2024, 7:07 AM