Skip to content

Instantly share code, notes, and snippets.

@vincekennedy
Created May 5, 2015 21:55
Show Gist options
  • Save vincekennedy/ce0e2ca8126922eb4390 to your computer and use it in GitHub Desktop.
Save vincekennedy/ce0e2ca8126922eb4390 to your computer and use it in GitHub Desktop.
Newest git tag for Android build versioning with gradle
def releaseTag = 'git tag'.execute()
def serr = new StringBuffer()
def sout = new StringBuffer()
releaseTag.consumeProcessOutput(sout, serr)
releaseTag.waitForOrKill(1000)
String[] lines = sout.toString().split("\\n")
def tag = lines[lines.length-1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment