Slackbot
11/21/2023, 11:32 PMVampire
11/22/2023, 2:11 AMVampire
11/22/2023, 2:13 AMlibs... accessors. And it is the standard and idiomatic way to do it now.Mike Wacker
11/22/2023, 3:52 AMbuild.gradle(.kts) files
• With version catalogs + TOML files, you basically have to rewrite each dependencies block.
• With gradle-consistent-versions, you only need to remove the versions.
3. easy to setup and use
• You don't have to learn any new concepts for `gradle-consistent-versions`; the versions.props file is about as easy and intuitive as it gets.
◦ To understand how this plugin works, you just need to read the short "Here's how the gradle-consistent-versions plugin rates on those criteria: 1. [...] 2. [...] 3. [...]" blurb from my original post.
• For the "recommended" solution, you have to learn two new concepts: version catalogs and the Gradle TOML file format.
◦ While neither concept is super-hard to learn, it's unnecessary complexity compared to simplicity of versions.props.
◦ There's also a LOT of reading you have to do on that documentation page before you finally learn enough to use the "recommended" solution.
versions.lock is a nice bonus, too: it provides a compact, easy-to-understand representation of your prod classpath.
gradle-consistent-versions is actively developed as well; the authors clearly don't view it as something that was made obsolete by version catalogs and TOML files.
• The latest release, 2.16.0, was released this October.
• Version 2.0.0 was released in July 2021; Gradle 7 existed back then.Vampire
11/22/2023, 4:04 AMrefreshVersions plugin that can add all newer versions of the libraries as comments for you to pick from, other tools being able to simply parse it, not invalidating builds unnecessarily, and so on.
If you don't want all the advantages and only rate for your listed criteria, use whatever makes you most happy. 🙂Mike Wacker
11/22/2023, 4:51 AMversions.props, and after I ran ./gradlew --write-locks, ./gradlew build, it only rebuilt the one module that used said dependency.
Sharing dependency versions is a core problem for essentially every Gradle multi-module build. Only a small subset of those multi-module builds use the refreshVersions plugin. I would prefer something which makes the core user experience better for everyone, vs. something that has an extra bell that only a small subset of that group uses.Mike Wacker
11/22/2023, 5:10 AMversions.props as well, if automated version upgrades is super-important to you. E.g., see https://github.com/palantir/conjure/pull/1468Vampire
11/22/2023, 7:53 AMMike Wacker
11/22/2023, 8:57 AMversions.props file to the root dir. (You'll occasionally need to run ./gradlew --write-locks.)
User: Oh yeah, that's super-easy.
Option 2
Gradle: Well first, let me explain how version catalogs work.
User: Uh...OK....
Gradle: Now let me explain the format of our TOML file.
User: Seems like overkill, maybe I'll just use Palantir's solution.
Gradle: It's super-easy! If you have any questions, you can read 2000+ words of documentation which explains how all this works. (Note: I counted.)
User: Yeah, definitely going with Palantir's solution.
Gradle: But you can get IDE auto-completion with version catalogs!
User: [already finished implementing Palantir's solution] Nah, I'm good.
Option 2 almost reminds me of a mini-. (My thanks to whoever leaked that internal Google video; it's a classic.) "I just want to serve 5 terabytes of data..."Vampire
11/22/2023, 9:11 AMMike Wacker
11/22/2023, 9:47 AMs/Gradle:/???:/g, it's the same lesson regardless of who ??? is. (Missing the forest for the trees again.)
My users' reaction was "wow, that's much nicer, undertandable, and usable than this pesky properties file we had before".Clearly a build engineer trying to masquerade as a user. The typical user actually likes
versions.props because it's a dead-easy, intuitive format for specifying dependency versions. Only build engineers seem to have this strange vendetta against properties files. (Under the hood, gradle-consisent-versions is way more sophisticated and well-engineered than the past properties-based solutions you have in mind, but that detail is more relevant to build engineers.)
She just has to see the simple and intuitive toml file and use the type-safe completion aware accessors.Did you not see the skit? You've already lost the user at this point. The user did not ask for "type-safe completion aware accessors." They just want to share version dependencies between modules. It's really that simple. Feel free to admire the "beauty" of version catalogs and a custom TOML format; I'll take the dead-easy simplicity of that "pesky properties file."
Vampire
11/22/2023, 9:56 AMMike Wacker
11/22/2023, 10:20 AM