Arjan van Wieringen
01/21/2023, 8:55 AMAdam S
01/21/2023, 9:02 AMAdam S
01/21/2023, 9:05 AMlibs.versions.toml
), so all the dependencies and versions are in one file
• version platforms (Java Platform Plugin), which is kind of like making your own BOM, so you can define dependencies without versions in projects and the Platform will align them
https://docs.gradle.org/current/userguide/platforms.htmlArjan van Wieringen
01/21/2023, 9:07 AMAdam S
01/21/2023, 9:09 AMmy-convention.gradle.kts
to MyConvention.kt
hfhbd
01/21/2023, 10:14 AMAdam S
01/21/2023, 10:16 AMVampire
01/21/2023, 10:17 AMVampire
01/21/2023, 10:19 AMArjan van Wieringen
01/21/2023, 1:17 PMArjan van Wieringen
01/21/2023, 1:19 PMVampire
01/21/2023, 3:08 PMAh, I have refactored everything to use the libs.version.toml, but sadly this can not be used in a (precompiled) plugin.Well, that's only partly correct. You can use the string-y untyped API to access the version catalog. Or you can use the hack-around I described in the according issue on GitHub.
I think I maybe overcomplicated stuff. My goal was to create a gradle plugin which I can use in a target project which sets up a lot of basic dependencies and plugins to develop a compose desktop application. This means: compose plugin, coroutines dependencies, some serialization plugin, proper Kotlin version etc etc.As I said, that's exactly the idiomatic way and is called convention plugin. Whether you implement it in a standalone project, in an included build, in
buildSrc
, as "real plugin", as precompiled script plugin, ... is not important. 🙂Arjan van Wieringen
01/21/2023, 3:46 PMArjan van Wieringen
01/21/2023, 4:15 PMVampire
01/21/2023, 4:27 PMArjan van Wieringen
01/21/2023, 4:29 PMVampire
01/21/2023, 4:30 PMArjan van Wieringen
01/21/2023, 4:30 PMVampire
01/21/2023, 4:31 PMplugins
block.
But you could probably use the legacy apply
to do it.Adam S
01/21/2023, 4:32 PMdependencies {}
in buildSrc/build.gradle.kts
then when you apply the plugin in the pre-compiled script plugin, it will choose that versionAdam S
01/21/2023, 4:33 PMlibs.versions.toml
in buildSrc/build.gradle.kts
Arjan van Wieringen
01/21/2023, 4:33 PMAdam S
01/21/2023, 4:40 PMVampire
01/21/2023, 4:57 PMStylianos Gakis
01/22/2023, 11:51 PMArjan van Wieringen
01/23/2023, 6:43 PM