Robert Elliot
04/14/2025, 12:43 PMbuild.gradle
to build.gradle.kts
. The file has been going for 14 years, so there's the inevitable layers of fine-then-bad-practice-now stuff.
I'm wondering how best to prove I have migrated all the tasks and logic identically. In an ideal world I could export the configured model for all the tasks, I guess, and check it hadn't changed. Does anyone have any tips on implementing such a test? It feels very 20th century to just leap in, start changing things and hope I spot what breaks - some of these tasks are run rarely.Adam
04/14/2025, 1:04 PMRobert Elliot
04/14/2025, 1:06 PMAdam
04/14/2025, 1:06 PMbuild/
directory.
So you could checkout the project twice: one with the Groovy DSL and another with Kotlin DSL. For each task, run gradle fooTask
against each project, then verify the build/
dir has the same content.Adam
04/14/2025, 1:08 PMRobert Elliot
04/14/2025, 1:13 PMRobert Elliot
04/14/2025, 1:13 PMAdam
04/14/2025, 1:17 PMAdam
04/14/2025, 1:19 PM./gradlew kotlinDslAccessorsReport
), but that will only reflect the 'public api' of the applied plugins, and not verify the build logic.Adam
04/14/2025, 1:20 PMRobert Elliot
04/14/2025, 1:21 PMdependsOn
and finalizedBy
in it to pieces.Adam
04/14/2025, 1:22 PMVampire
04/14/2025, 1:40 PMI'm sure Vampire would pick all the🤷♂️ 🙂anddependsOn
in it to pieces.finalizedBy
Vampire
04/14/2025, 1:41 PMyeah, unfortunately I've never heard of a way of 'dumping' the Gradle project model - It would be convenient.Wouldn't that be the configuration cache entry? Not really a way to compare those though of course 😄
Robert Elliot
04/16/2025, 2:12 PMProvider.get()
, which seems icky.
4 unchecked casts.
It's currently a pretty direct port of the old build.gradle:
https://github.com/wiremock/wiremock/blob/2ce40503ad90d204f23d26a4dca0deb990d4cd4c/build.gradleAdam
04/17/2025, 5:39 AM