Skip to content

Commit

Permalink
Update build.sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Feb 22, 2024
1 parent 27fe6f0 commit a4cf0f1
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -167,23 +167,3 @@ enablePlugins(ReproducibleBuildsPlugin)
enablePlugins(SiteScaladocPlugin)
//enablePlugins(GhpagesPlugin)
git.remoteRepo := "[email protected]: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
}

0 comments on commit a4cf0f1

Please sign in to comment.