From a4cf0f1487c62d053890fc26beb600f0e1fc3542 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Fri, 23 Feb 2024 00:57:11 +0100 Subject: [PATCH] Update build.sbt --- build.sbt | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/build.sbt b/build.sbt index b70e752f..b04054a8 100644 --- a/build.sbt +++ b/build.sbt @@ -60,7 +60,7 @@ scalaMajorVersion := { } } -val addJava17Tests: Boolean = compareVersions(System.getProperty("java.version"), "17.0.0") >= 0 +val addJava17Tests: Boolean = System.getProperty("java.specification.version").toDouble >= 17 scalacOptions ++= { val additionalSettings = @@ -167,23 +167,3 @@ enablePlugins(ReproducibleBuildsPlugin) enablePlugins(SiteScaladocPlugin) //enablePlugins(GhpagesPlugin) git.remoteRepo := "git@github.com:FasterXML/jackson-module-scala.git" - -def compareVersions(version1: String, version2: String): Int = { - var comparisonResult = 0 - val version1Splits = version1.split("\\.") - val version2Splits = version2.split("\\.") - val maxLengthOfVersionSplits = Math.max(version1Splits.length, version2Splits.length) - var i = 0 - while (comparisonResult == 0 && i < maxLengthOfVersionSplits) { - val v1 = if (i < version1Splits.length) version1Splits(i).toInt - else 0 - val v2 = if (i < version2Splits.length) version2Splits(i).toInt - else 0 - val compare = v1.compareTo(v2) - if (compare != 0) { - comparisonResult = compare - } - i += 1 - } - comparisonResult -}