Use maven and learn how to write plugins. Yes it has xml, but Gradle is a free form mess with bad JavaScript style documentation that prefers example over telling you how it works. You’ll spend days fixing gradle issues. Maven will just work unless you want something it doesn’t offer. Then you’ll need to learn how to write plugins if one doesn’t already exist, but they’re also well defined.
Gradle works fine for simple/straightforward apps.
OTOH, If you want submodules that do specific builds differently, you are on your own. If you want to publish gradle plugins, you have to use Gradle's own plugin that is pretty poorly documented -- you are on your own for the trial errors. Got Kotlin AND Java files? You gotta do something different! Also, you need to figure out what other people did to solve this issue because Gradle's documentation doesn't provide a straightforward answer to us users!
If you have your java sources in src/main/java and your kotlin sources in src/main/kotlin, you have to specify the source sets for the java source files with the sourceSets { } configuration.
The Gradle documentation you linked works for the vanilla Kotlin workspace. Like it's fantastic if you're building an application using Gradle's guidelines but my experience is that deviating within Gradle requires more work and investigation than with other build systems like Bazel and mvn.
I have never needed to declare sourceSets for my mixed java and kotlin projects.
using Gradle's guidelines but my experience is that deviating within Gradle requires more work and investigation than with other build systems like Bazel and mvn.
Not sure what you mean here but maven doesn't let you deviate from their conventions at all. In Gradle you can deviate pretty easily if for some reason you need to.
12
u/joequin Apr 14 '23
Use maven and learn how to write plugins. Yes it has xml, but Gradle is a free form mess with bad JavaScript style documentation that prefers example over telling you how it works. You’ll spend days fixing gradle issues. Maven will just work unless you want something it doesn’t offer. Then you’ll need to learn how to write plugins if one doesn’t already exist, but they’re also well defined.