This message was deleted.
# dependency-management
s
This message was deleted.
v
Try to create instead of named. I'd guess it works.
j
Yeah, I have used
create
and it works, but looks like a bug to me
v
Well, the default is just created if it was not created by the build already. Could well be intentional. But feel free to open a GitHub issue. ๐Ÿ™‚
๐Ÿ‘ 1
g
Isn't default created only when
gradle/libs.versions.toml
file exists? IIRC when it exists create will fail. You could use
maybeCreate("libs").configure { ... }
.
v
Obviously it does not fail. He has that file and just wants to override one version of it for whatever reason.
j
That is the thing it is weird for me, create should fail and named work, but it is the contrary
g
Ahh, I misunderstood. I thought gradle did create/maybeCreate before the settings script is executed but it seems opposite is true if manual create works. With such an ordering I'm not sure if you can truly override version since gradle would override your version from toml later. Of course you can rename a toml file, create libs catalog and import the toml file with from(files(..)) and then override the version.
v
That the from is evaluated later does not mean the version from the toml wins. I'd still expect it to work.
g
Yeah, I would too ,) But need to experiment or look at the code to be sure
j
Yeah, it works, I tested it a few hours ago. The use case is a plugin testing itself with the latest changes
๐Ÿ‘ 1
l
Just to be sure I understand: you use
create
for your use case but do you have to also explicitly do the
from
then? If not, please file an issue as it makes no sense. If you have to do the
from
yourself, then you can see the default
libs
as being a convention, and any change you want to make to it forces your to be fully explicit.
v
You have to use
create
to be able to access / modify even the default
libs
. If you use
create
and also add a
from
you get an exception that you must not call
from
multiple times even if you only called it once and even if you just specify the convention file again (I already opened an issue for this in the past).
โž• 1
j
I think the intuitive things is that libs should be created automatically so I should be able to get it instead of โ€œcreatingโ€ it
๐Ÿ‘ 1