Created
December 4, 2014 13:33
-
-
Save stepango/1b02cb2ec86747eb547a to your computer and use it in GitHub Desktop.
Version number using gradle and git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Integer getVersionCode() { | |
def sout = new StringBuffer() | |
def proc = 'git rev-list HEAD --count'.execute() | |
proc.consumeProcessOutput(sout, new StringBuffer()) | |
proc.waitForOrKill(1000) | |
return sout.toInteger() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment