Has anybody experience with version catalogues? I ...
# gradle
a
Has anybody experience with version catalogues? I wonder if its' possible to declare a version and add
!!
to the version ref if needed.
Copy code
...
[versions]
monorepo="20230101"
...
[libraries]
...
lib1 = { module = "com.lib:lib1", version.ref = "monorepo" }
lib2 = { module = "com.lib:lib2", version.ref = "monorepo"+"!!" }
I didn't find anything in the toml documentation https://toml.io/en/
j
what does
!!
mean ?
a
to enforce this version of lib2 even if another library uses internal another version. With that you can override transitive dependencies
j
check strict
a
E.g. lib1 uses version 1.0.0 of lib2 But you want to overwrite this in your app with version 1.0.1 of lib2
a
But with strict I'm not able to use my declared version ref, right?
j
Copy code
[versions]
my-lib = { strictly = "[1.0, 2.0[", prefer = "1.2" }
v
Besides the verbose syntax Javier showed, you can of course also use the short-hand
!!
syntax. But not like you did it. Declare a second version entry where either the
!!
or the verbose variant is used and then use that in the
version.ref
Aaaand have a look at the channel topic. 😉
j
that is not documented I think
v
What is not documented?
The
!!
or that you can use it in the version catalog?
j
the
!!
in version catalog
v
There is no need to
You can use any version specification in the version catalog that you can also use otherwise.
It is not necessary to mention that explicitly
Noone said that only plain dumb versions are supported in version catalogs
a
Thanks Björn
Declare a second version entry where either the
!!
or the verbose variant is used and then use that in the
version.ref
That's what I already did. But I thought I could avoid the second version entry
Aaaand have a look at the channel topic. 😉
Thanks, you're right