Good News: I made a simplified version of this template, check it out
I learn Gradle because I want a simplified syntax to describe a multi-module project, so I payed and learned from Udemy
But I end up with this crazy setup that is 10x more complicated than my current maven multi-module project setup ๐
Definitely overkilled for small, personal, or school projects...
See how I structured my precompiled script plugins
Also, each module is an independent submodule in the gradle/plugins
build source project,
and each module in the same layer will never depend on each other.
This is explicitly designed to boost build performance from gradle parallel execution.
Good News: I made a simplified version of this template, check it out
Thanks for considering my template ๐, just do the following things, and you are good to go:
- Delete these sample submodules begin with
sample-
, and update the logic of including submodules in the rootsettings.gradle.kts
- Modify the project name
rootProject.name
insettings.gradle.kts
to your own project name. - Globally change the group name
poc.cx.glp
to your own group name. The group namepoc.cx.glp
is defined indev-version-constraints
module and is referred in the root plugin and the lib mixin plugin. - Delete everything in mixin plugins folder and convention plugins folder,
and delete everything in the version catalog,
and delete everything in the
constraints
block in thedev-version-constraints
platform- Tips: you can choose to not delete some stuff if you find them useful
- Add your own mixin plugins and convention plugins, and don't forget to archive centralized version management by adding your
own libraries into the version catalog.
- Tip 1: if you want to use version catalog in the
dependencies
block in precompiled script plugins (mixin or convention plugins), put them in theconstraints
block in thedev-version-constraints
platform. Then in precompiled script plugins, declare the library dependency without the version (e.g.implementation("org.springframework.boot:spring-boot-starter")
). This works for Maven bom and Gradle platform as well. - Tip 2: if you want to use version catalog in the
plugins
block in precompiled script plugins (mixin or convention plugins), you instead let thebuild.gradle.kts
(is also the one withkotlin-dsl
applied) that build the precompiled script plugin applies the version catalog. Then in precompiled script plugins, declare the library dependency without the version ((e.g.id("org.springframework.boot")
)
- Tip 1: if you want to use version catalog in the
This template also contains two ways for updating library dependencies automatically,
either by using renovate bot (recommended as it is the only tool that support Gradle version catalog so far),
or running Gradle tasks defined in the root build.gradle.kts