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

au.csiro.pbdava.ssparkle.common.utils.VersionInfo.scala Maven / Gradle / Ivy

The newest version!
package au.csiro.pbdava.ssparkle.common.utils

import java.util.Properties

import scala.collection.JavaConverters._

object VersionInfo {
  lazy val gitProperties: Map[String, String] =
    LoanUtils.withCloseable(
        getClass.getClassLoader.getResourceAsStream("variant-spark.git.properties")) { in =>
      if (in != null) {
        val gitProperties = new Properties()
        gitProperties.load(in)
        gitProperties.asScala.toMap
      } else {
        throw new IllegalStateException("Cannot find 'variant-spark.git.properties'")
      }
    }

  lazy val version: String = gitProperties.getOrElse("git.build.version",
    throw new IllegalStateException("Cannot retrieve version information"))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy