sbt / sbt-javaversioncheck   0.1.0

GitHub

sbt plugin to check Java version

Scala versions: 2.12
sbt plugins: 1.0

sbt-javaversioncheck

sbt-javaversioncheck is an sbt plugin to check current Java version. This is taken from activator's JavaVersionCheck written by Havoc in typesafehub/activator@f3a445.

setup

This is an auto plugin, so you need sbt 0.13.5+. Put this in project/javaversion.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")

usage

sbt-javaversioncheck is a triggered plugin that is enabled automatically for all projects that has JvmPlugin. Next rewire javaVersionPrefix in javaVersionCheck to Some("1.6") for Java 6, Some("1.7") for Java 7, and so on.

lazy val fooProj = (project in file("foo")).
  settings(
    javaVersionPrefix in javaVersionCheck := Some("1.6")
  )