Question... I want to migrate to gradle version ca...
# refreshversions
c
Question... I want to migrate to gradle version catalogs first. then after using it for some time, then we'll update to refresh versions. For the time being... we want to use refreshversions for doing the migration to gradle version catalogs, but it seems like it will always generate a version.properties. Is there anyway to just use refreshVersions for the actual upgrade to version catalogs?
I think it’s ``./gradlew refreshVersionsMigrate --mode=VersionCatalogAndVersionProperties` I’m launching my own company so it’s hard to maintain things right now
c
Yeah, I did that, but it still generates a version.properties in addition to the toml
v
It always will
c
even with VersionCatalogOnly it still does
v
Yes, it always will
c
but yeah. this is so close to what i need. im surprised theres not a proper converter to version catalogs. but maybe im just naive
v
I forgot why, but there was some situation where you would still need it. If you don't, you can configure it to be created in a volatile spot
One moment, I'll show you what I did
Copy code
conditionalRefreshVersions {
    // work-around for <https://github.com/jmfayard/refreshVersions/issues/662>
    file("build/tmp/refreshVersions").mkdirs()
    // work-around for <https://github.com/jmfayard/refreshVersions/issues/640>
    versionsPropertiesFile = file("build/tmp/refreshVersions/versions.properties")
}
Ah, the linked issue mentions the case. If you use the dependency notations coming with the plugin, they are defined with
_
version and thus need the
version.properties
.
c
Hm. not exactly sure where that leaves me. but i suppose i will just try to do this manually instead.
v
Those: https://jmfayard.github.io/refreshVersions/dependency-notations/ If you use them, you need the
version.properties
. If you don't use them (I don't), you can configure away the file.
c
oh. so I can use the configuration block of refreshVersions to not use those. let me try that!
v
Other way around. If you don't use them, you don't need the version properties file and thus can configure it to be generated in the tmp directory where it does not disturb.
c
Yeah, but it still updates all of my build files to use them. e.g. My build files now use Android.xyz instead of libs.xyz
c
I just
.gitignore
the empty version.properties file
v
Also a possibility, but I prefer it to not clutter my view. :-D
Yeah, but it still updates all of my build files to use them.
Even with
VersionCatalogOnly
? I didn't use the migration so far.
c
Yep
v
Then I would say, that is a bug:
``` Mode.VersionCatalogOnly -> {
"Use the default versions catalog for all the dependencies and their versions, " +
"ignoring built-in dependency notations."
} ```
c
Cool. Thought it was just me.