Skip to content

Instantly share code, notes, and snippets.

@xdev-developer
Created July 26, 2014 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xdev-developer/fc454cbd8ca0c153ea66 to your computer and use it in GitHub Desktop.
Save xdev-developer/fc454cbd8ca0c153ea66 to your computer and use it in GitHub Desktop.
Cool app version for deployment (include git branch, commit hash and build time
val branch = "git rev-parse --abbrev-ref HEAD".!!.trim
val commit = "git rev-parse --short HEAD".!!.trim
val buildTime = (new java.text.SimpleDateFormat("yyyyMMdd-HHmmss")).format(new java.util.Date())
version := "%s-%s-%s".format(branch, commit, buildTime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment