Does Gradle expose a util for checking if a versio...
# community-support
a
Does Gradle expose a util for checking if a version range is 1. valid, and 2. contains a given version https://docs.gradle.org/current/userguide/dependency_versions.html
e
Gradle doesn't expose anything publicly but if they're Maven versions then you could use Maven's
org.apache.maven.artifact.versioning.VersionRange
v
That wouldn't work. Gradle has different ordering rules, so just because a version is in a given range in Maven's opinion it is not necessarily in Gradle's and vice versa.
I guess you would need to put the file with the version to investigate in a directory, define a
flatDir
repo on that directory and resolve the dependency with range on that. Them you can check whether it resolves or not.