Skip to content

Instantly share code, notes, and snippets.

@Pyppe
Created February 19, 2014 08:11
Show Gist options
  • Save Pyppe/9087918 to your computer and use it in GitHub Desktop.
Save Pyppe/9087918 to your computer and use it in GitHub Desktop.
// Create BUILD_INFO file showing status about the build in question
unmanagedResources in Compile <++= baseDirectory.map { base =>
val dir = java.nio.file.Files.createTempDirectory("sbt_build_info_").toFile
val buildFile = java.io.File.create(dir, "BUILD_INFO")
buildFile.deleteOnExit
dir.deleteOnExit
val fw = new java.io.FileWriter(buildFile)
fw.write(
s"""|Built by ${System.getProperty("user.name")} @ ${java.net.InetAddress.getLocalHost.getHostName} on ${new java.util.Date}
|===
|""".stripMargin)
fw.close
Process("git", Seq("show", "--summary")) #>> buildFile !;
Process("git", Seq("status", "--short")) #>> buildFile !;
Seq(buildFile)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment