Hello guys, I was reading the gradle documentation, and I saw that is not recomended use cross project configuration to share build logic inside a multi module project.
Instead of subprojects
DSL, the documentation recomends use buildSrc.
My project with buildSrc:
├── settings.gradle.kts
├── buildSrc
│ ├── build.gradle.kts
│ └── shared.settings.gradle.kts
├── app
│ └── build.gradle.kts
├── adapters
│ └── build.gradle.kts
My project using subprojects DSL:
├── settings.gradle.kts
├── build.gradle.kts
├── app
│ └── build.gradle.kts
├── adapters
│ └── build.gradle.kts
where, app module is mainly pure kotlin with some test dependencies, and adapters is my ‘dirty’ module, where I have springboot, database, rest client libs and so on. My questons is, for this application, buildSrc is the best way to share common dependencies (junit for example) and plugins (idea, jacoco, kotlin.jvm, ktlint)? When subproject DSL is preferred instead of buildSrc?
I have been creating a root build.gradle.kts and configured the commons plugins and dependencies using the subprojects
DSL, instead of buildSrc strategy.
Obs: I don’t need a common custom task or a common custom plugin for this project.