blob: 338cf2d95e2f639e1da302e6c54b2edb48c3180d (
plain) (
tree)
|
|
import scala.sys.process.Process
object VersionUtil {
def executeScript(scriptName: String) = {
val cmd =
if (System.getProperty("os.name").toLowerCase.contains("windows"))
s"cmd.exe /c scripts\\build\\$scriptName.bat -p"
else s"scripts/build/$scriptName"
Process(cmd).lines.head.trim
}
/** Seven letters of the SHA hash is considered enough to uniquely identify a
* commit, albeit extremely large projects - such as the Linux kernel - need
* more letters to stay unique
*/
def gitHash = executeScript("get-scala-commit-sha").substring(0, 7)
def commitDate = executeScript("get-scala-commit-date")
}
|