From 4e66b492e53840a6320616a5f30e4255d568a41d Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Sat, 23 Mar 2019 09:16:33 -0700 Subject: [PATCH 1/2] Singularize java version in welcome banner --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index f08ed2186..4376296fc 100644 --- a/build.sbt +++ b/build.sbt @@ -130,7 +130,7 @@ lazy val sbtRoot: Project = (project in file(".")) |""".stripMargin + (if (sys.props("java.specification.version") != "1.8") s"""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - | Java versions is ${sys.props("java.specification.version")}. We recommend 1.8. + | Java version is ${sys.props("java.specification.version")}. We recommend 1.8. |!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""".stripMargin else "") }, From cd744b2c354c86f458f84385e959797917390d00 Mon Sep 17 00:00:00 2001 From: Ethan Atkins Date: Sat, 23 Mar 2019 09:31:22 -0700 Subject: [PATCH 2/2] Print consistent version Java has dropped the leading "1." from the specification version in later versions. No one really refers to java 1.8, so it makes sense to strip the "1." from the suggested version. --- build.sbt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index 4376296fc..0d223c21b 100644 --- a/build.sbt +++ b/build.sbt @@ -121,6 +121,7 @@ lazy val sbtRoot: Project = (project in file(".")) buildLevelSettings, minimalSettings, onLoadMessage := { + val version = sys.props("java.specification.version") """ __ __ | _____/ /_ / /_ | / ___/ __ \/ __/ @@ -128,9 +129,9 @@ lazy val sbtRoot: Project = (project in file(".")) | /____/_.___/\__/ |Welcome to the build for sbt. |""".stripMargin + - (if (sys.props("java.specification.version") != "1.8") + (if (version != "1.8") s"""!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - | Java version is ${sys.props("java.specification.version")}. We recommend 1.8. + | Java version is $version. We recommend java 8. |!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!""".stripMargin else "") },