Skip to content

Commit

Permalink
deps: update dependency org.semver4j:semver4j to v5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate[bot] authored and sschuberth committed Sep 25, 2023
1 parent 0705ede commit 0420946
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion downloader/src/main/kotlin/VersionControlSystem.kt
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,6 @@ abstract class VersionControlSystem(
*/
fun isAtLeastVersion(expectedVersion: String): Boolean {
val actualVersion = Semver.coerce(getVersion())
return actualVersion.isGreaterThanOrEqualTo(Semver.coerce(expectedVersion))
return Semver.coerce(expectedVersion)?.let { actualVersion?.isGreaterThanOrEqualTo(it) } == true
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ retrofit = "2.9.0"
retrofitConverterKotlinxSerialization = "1.0.0"
saxonHe = "12.3"
scanoss = "1.1.6"
semver4j = "5.1.0"
semver4j = "5.2.0"
springCore = "5.3.30"
svnkit = "1.10.11"
sw360Client = "16.0.0-m1"
Expand Down
2 changes: 1 addition & 1 deletion model/src/main/kotlin/PackageCuration.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ data class PackageCuration(
"'${id.version}' is not a valid version range."
}

return Semver.coerce(pkgId.version).satisfies(range)
return Semver.coerce(pkgId.version)?.satisfies(range) == true
}

return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class RequirementsCommand : OrtCommand(
val actualVersion = tool.getVersion()
runCatching {
val isRequiredVersion = tool.getVersionRequirement().let {
Semver.coerce(actualVersion).satisfies(it)
Semver.coerce(actualVersion)?.satisfies(it) == true
}

if (isRequiredVersion) {
Expand Down
2 changes: 1 addition & 1 deletion utils/common/src/main/kotlin/CommandLineTool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ interface CommandLineTool {
val actualVersion = Semver.coerce(getVersion(workingDir))
val requiredVersion = getVersionRequirement()

if (!actualVersion.satisfies(requiredVersion)) {
if (actualVersion?.satisfies(requiredVersion) != true) {
logger.warn {
"The command is required in version $requiredVersion, but you are using version $actualVersion. This " +
"could lead to problems."
Expand Down

0 comments on commit 0420946

Please sign in to comment.