Skip to content

Commit 8c165d2

Browse files
committed
Refactor: use scala.util.Properties.isJavaAtLeast()
1 parent b59d6a4 commit 8c165d2

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

project/Build.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ import de.johoop.findbugs4sbt.FindBugs._
2222
import de.johoop.jacoco4sbt._
2323
import JacocoPlugin._
2424
import sbtrelease.ReleasePlugin._
25-
import xerial.sbt.Sonatype._
25+
import scala.util.Properties
26+
2627

2728
object Build extends Build {
2829

@@ -61,10 +62,7 @@ object Build extends Build {
6162
javacOptions in (Compile, compile) ++= Seq("-encoding", "UTF-8", "-Xlint:unchecked", "-Xlint:deprecation", "-source", "1.6", "-target", "1.6"),
6263
javacOptions in doc := {
6364
val opts = Seq("-source", "1.6")
64-
val (major, minor) = System.getProperty("java.version").split('.') match {
65-
case Array(major, minor, _) => (major.toInt, minor.toInt)
66-
}
67-
if ((major == 1 && minor >= 8) || (major > 1))
65+
if (Properties.isJavaAtLeast("1.8"))
6866
opts ++ Seq("-Xdoclint:none")
6967
else
7068
opts

0 commit comments

Comments
 (0)