Skip to content

Commit

Permalink
Show environment info on main
Browse files Browse the repository at this point in the history
  • Loading branch information
jultty committed Nov 14, 2023
1 parent 3f7f605 commit 4bb466f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
16 changes: 15 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,22 @@ lazy val root = project
logLevel := Level.Warn,
run / watchLogLevel := Level.Warn,
test / watchLogLevel := Level.Warn,
Global / onChangedBuildSource := ReloadOnSourceChanges,
test / watchBeforeCommand := Watch.clearScreen,
Global / onChangedBuildSource := ReloadOnSourceChanges,

scalacOptions ++= Seq(
"-unchecked",
"-explain",
"-Xprint-diff",
"-Xprint-diff-del",
"-Xprint-inline",
"-Ycheck-reentrant",
"-Ycook-comments",
"-Yprint-debug",
"-Yprint-pos-syms",
"-Yprint-debug-owners",
"-Yshow-var-bounds",
),

libraryDependencies += "org.scalameta" %% "munit" % "0.7.29" % Test,

Expand Down
18 changes: 14 additions & 4 deletions src/main/scala/Main.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import scala.util.Properties

@main def hello: Unit =
val a_char = ','
val immutable = "Scala"
var mutable = "lo"
println(s"Hel${mutable}es$a_char $immutable!")
println(s"Scala Library version ${Properties.versionNumberString}")
println(s"Development version: " +
s"${Properties.developmentVersion.getOrElse("N/A")} " +
s"Release version: ${Properties.releaseVersion.getOrElse("N/A")}"
)
println(
s"${Properties.javaVmVendor} " +
s"${Properties.javaVmName} " +
s"${Properties.javaVmVersion} " +
s"(${Properties.javaVmInfo})"
)
println(s"JDK Home: ${Properties.jdkHome}")

0 comments on commit 4bb466f

Please sign in to comment.