Skip to content

Commit

Permalink
scalacReleaseOption and javacReleaseOption
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Feb 2, 2023
1 parent 7e09826 commit 08627b7
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ lazy val commonSettings = Seq(
case Some((2, 11)) => Seq()
case _ => sys.error("Unsupported scala version")
}
},
} ++ scalacReleaseOption,
javacOptions ++= javacReleaseOption,
resolvers += Resolver.sonatypeRepo("public"),
licenses := Seq("CC0" -> url("https://creativecommons.org/publicdomain/zero/1.0/legalcode")),
homepage := Some(url("https://github.com/ScorexFoundation/sigmastate-interpreter")),
Expand Down Expand Up @@ -55,6 +56,22 @@ lazy val commonSettings = Seq(
),
)

def scalacReleaseOption = {
if (System.getProperty("java.version").startsWith("1."))
// java <9 "-release" is not supported
Seq()
else
Seq("-release", "8") // this is passed to javac as `javac -release 8`
}

def javacReleaseOption = {
if (System.getProperty("java.version").startsWith("1."))
// java <9 "--release" is not supported
Seq()
else
Seq("--release", "8")
}

// suffix version with "-SNAPSHOT" for builds without a git tag
dynverSonatypeSnapshots in ThisBuild := true
// use "-" instead of default "+"
Expand Down

0 comments on commit 08627b7

Please sign in to comment.