does anyone know of any OSS projects out there tha...
# gradle
s
does anyone know of any OSS projects out there that can serve as a good example for a monorepo of Gradle plugin projects? So a Gradle project itself that has a bunch of individual gradle plugin projects and which supports the common build logic for them via precompiled script plugins. Feels like there’s a few gotchas in that space, like applying the kotlin-dsl plugin inside a precompiled script plugin, that seems like the wrong approach (versus adding the kotlin DSL dependency directly) since it also applies some other plugins implicitly.
c
I just started working on moving the
buildSrc
logic for my libraries to an included build. The included build repo has everything I need as script plugins, and hopefully can help with what you’re looking for. The repo also has a version catalog file to help me maintain the same dependency versions across all my libraries. The included build repo is not currently set up as a monorepo, but I don’t think too much would need to be changed if you were to try and break it out into smaller submodules rather than the single big one that I currently use. Here’s the included build repo, which gets checked into the library repos as a Git submodule, and included into the library’s Gradle build like this. I can then include each script plugin however I need by their
id("script-plugin-name")
, which is needed because accessors don’t seem to be generated for these script plugins like they would have been from
buildSrc
j
This is something I created based on a non-open-source project (so it's a toy project, but based on a real setup): • https://github.com/jjohannes/gradle-project-setup-howto/tree/kotlin Other projects: • https://github.com/android/nowinandroid (also an example but with real App - uses Kotlin for convention plugins) • https://github.com/spring-projects/spring-boot (Uses Java for convention plugins) • https://github.com/gradle/gradle (Gradle itself, which has some more complex requirements in some places, but uses Kotlin DSL)
c
Here's another example, where custom plugins are in
gradle/conventions
: https://gitlab.com/opensavvy/pedestal It's inspired by https://github.com/jjohannes/idiomatic-gradle
Oh, hey @jendrik! Didn't link the two together. Thanks a lot for your repositories, I was really lost before seeing them.