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
android { | |
... | |
def versionFile = file('version.properties') | |
Properties prop = new Properties() | |
if (versionFile.canRead()) { | |
prop.load(new FileInputStream(versionFile)) | |
} | |
else { | |
prop['VERSION_CODE']='0' | |
} | |
def code = prop['VERSION_CODE'].toInteger() + 1 | |
prop['VERSION_CODE']=code.toString() | |
prop.store(versionFile.newWriter(), null) | |
defaultConfig { | |
... | |
versionCode code | |
versionName "1.0" | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment