Created
April 22, 2015 13:58
-
-
Save mrmike/0fee29e840be6eaae394 to your computer and use it in GitHub Desktop.
Get CommitId in build.gradle
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
def getCommitId() { | |
def output = new ByteArrayOutputStream() | |
exec { | |
commandLine 'git', 'rev-parse', '--short', 'HEAD' | |
standardOutput = output | |
} | |
return output.toString() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment