Created
July 9, 2020 02:59
-
-
Save ltvu93/53d502f49a0f8d5a08f7326059721d9e to your computer and use it in GitHub Desktop.
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 tag = 'git describe --tags --always --abbrev=0'.execute().getText().trim() | |
def (versionMajor, versionMinor, versionPatch) = tag.tokenize('.') | |
def buildNumber = System.getenv("BUILD_NUMBER") as Integer ?: 1 | |
def VERSION_NAME = "$versionMajor.$versionMinor.$versionPatch.$buildNumber" | |
def VERSION_CODE = versionMajor.toInteger() * 1000 + versionMinor.toInteger() * 100 + versionPatch.toInteger() * 10 + buildNumber.toInteger() | |
defaultConfig { | |
applicationId "" | |
minSdkVersion 19 | |
targetSdkVersion 28 | |
versionCode VERSION_CODE | |
versionName VERSION_NAME | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment