java - Adding revision information -
i want add git revision information java application built sbt. i'm using code generation feature described here http://www.scala-sbt.org/0.13/docs/howto-generating-files.html generate class revision
field. servlet class reads field , renders html page revision information. works fine except fact generated file transient , ide (intellij idea in case) reports errors in servlet class. obviously, generate whole servlet class seems bit put in build definition. there way make file "permament" or doing wrong?
could hitting issue: sbt/issues/1664?
if can use generated scala, sbt-buildinfo worth look. add git revision so:
import sbtbuildinfo.{ buildinfokey, buildinfoplugin } import sbtbuildinfo.buildinfokeys._ myproject .enableplugins(buildinfoplugin) .settings( buildinfokeys ++= seq[buildinfokey]( buildinfokey.action("revision") { process("git rev-parse --short head").!!.trim }) }
Comments
Post a Comment