Edit .git/config in the [receive] section:
Showing posts with label Git. Show all posts
Showing posts with label Git. Show all posts
I recently seen this blog post and thought it would be really cool if I could integrate git flow into my build scripts. Whats great about this is that because this is a java library it was extremely painless to integrate.
With a little effort this could easily be converted into a plugin for Gradle, but here's my example:
This is only a snippet, so not all of the library is shown, but it works very well as a proof of concept.
With a little effort this could easily be converted into a plugin for Gradle, but here's my example:
This is only a snippet, so not all of the library is shown, but it works very well as a proof of concept.
When creating a release package its nice to maintain a copy of all the metadata. I like to do this using the power of Groovy from within my Gradle build scripts.
import groovy.xml.MarkupBuilder
task xmlGen << {
def tag = "git describe --abbrev=0 --tags".execute().text
def sha = "git rev-parse HEAD".execute().text
def fw = new FileWriter("build_info.xml" )
def xml = new groovy.xml.MarkupBuilder(fw)
xml.build(id:tag){
ProjectName("ORCA")
SHA1(sha)
Date(new Date())
Components("component1, component2, component3")
}
}
And the output is:
<build id="v1.3.0">
<ProjectName>MyProject</ProjectName>
<SHA1>1f661e69797dc23281d2955d6ca2dda3cdd81dc0</SHA1>
<Date>Thu May 02 16:14:33 BST 2013</Date>
<Components>component1, component2, component3</Components>
</build>
Subscribe to:
Posts (Atom)