Skip to content

Instantly share code, notes, and snippets.

@tartakynov
Created September 5, 2016 06:23
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 tartakynov/751065d7e1f5f561b1a29669a8c51b92 to your computer and use it in GitHub Desktop.
Save tartakynov/751065d7e1f5f561b1a29669a8c51b92 to your computer and use it in GitHub Desktop.
Add public asset with app version (Play Framework)
resourceGenerators in Compile <+= (WebKeys.public in Assets, version).map {
case (dir, v) =>
val file = dir / "version.txt"
val gitCommit = Process("git rev-parse HEAD").lines.head
val content = "version=%s git-commit=%s".format(v, gitCommit)
IO.write(file, content)
Seq(file)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment