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
static def gitVersion() { | |
def result = "git rev-list HEAD --count".execute().text.trim() // unix | |
if (result.empty) result = "PowerShell -Command git rev-list HEAD --count".execute().text.trim() // windows | |
if (result.empty) throw new RuntimeException("Could not generate versioncode on this platform? Cmd output: ${result.text}") | |
return result.toInteger() | |
} | |
android { | |
defaultConfig { | |
versionCode gitVersion() |