All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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")

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy