Last active
January 22, 2019 11:56
-
-
Save doc2dev/1ddac83d09fa98896d165bcdfaa417e3 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 versionPropsFile = file('version.properties') | |
if (versionPropsFile.canRead()) { | |
Properties versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
def code = versionProps['VERSION_CODE'].toInteger() + 1 | |
def name = versionProps['VERSION_NAME'] | |
versionProps['VERSION_CODE'] = code.toString() | |
versionProps.store(versionPropsFile.newWriter(), null) | |
defaultConfig { | |
applicationId "com.app.id" | |
minSdkVersion 16 | |
targetSdkVersion 27 | |
versionCode code | |
versionName name + " - " + code | |
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | |
multiDexEnabled true | |
vectorDrawables.useSupportLibrary = true | |
} | |
} else { | |
throw new GradleException("Could not read version.properties!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment