Overview

An xsbt plugin to reflect mercurial properties into source code.

It is heavily inspired by https://github.com/ritschwumm/xsbt-reflect.


To build this code, get and install SBT from 
    https://github.com/harrah/xsbt

Build and publish the plugin:
    hg clone https://bitbucket.org/lukas_pustina/xsbt-hginfo
    cd xsbt-hginfo
    sbt publish-local

Add the plugin to your project in project/plugins/build.sbt:
	addSbtPlugin("de.pustina" % "xsbt-hginfo" % "0.0.3")

Include the plugin in you project's build.sbt:

	seq(HgInfoPlugin.allSettings:_*)
	
	hginfoPackage	:= "my.pack"
	
	hginfoClass	:= "HgInfo"
	
	sourceGenerators in Compile <+= hginfo map identity

With this setup, you can access the local version number, global id,
branch name, tags, and a full version from scala as 
my.pack.HgInfo.{version, id, branch, tags, full}


Please feel free to use and adapt the code.