almond.launcher.Properties.scala Maven / Gradle / Ivy
package almond.launcher
import java.io.ByteArrayInputStream
import java.util.{Properties => JProperties}
object Properties {
private lazy val path = os.resource / "almond" / "launcher" / "launcher.properties"
private lazy val props = {
val content = os.read.bytes(path)
val p = new JProperties
p.load(new ByteArrayInputStream(content))
p
}
private def prop(name: String) =
Option(props.getProperty(name)).getOrElse {
sys.error(s"$name property not found in $path")
}
lazy val version = prop("version")
lazy val commitHash = prop("commit-hash")
lazy val kernelMainClass = prop("kernel-main-class")
lazy val defaultScalaVersion = prop("default-scala-version")
}