This message was deleted.
# community-support
s
This message was deleted.
v
Not within the TOML. You can do such logic with the settings script DSL for version catalogs. You can there also overwrite certain things coming from the TOML.
i
Yeah, the
.toml
is pretty limited, but Vampire is correct. You can leverage the DSL to add logic: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog-declaration We support both in our project:
.toml
and DSL. We use the DSL for the libraries which require some switch defined in
gradle.properties
Copy code
dependencyResolutionManagement {
    versionCatalogs {
        libs {
            version('someDependency', getDependencyVersion())

            library('someDependency', 'com.maven.coordinates.some-dependency', 'some-dependency').versionRef('someDependency')
        }
    }
}

def getDependencyVersion() {
    def versionSwitch = Boolean.valueOf(getProperties().getOrDefault("dependency.switch", false)
    return versionSwitch ? "2.0" : "1.0"
}