Created
January 3, 2020 12:46
-
-
Save adamgajzlerowicz/819b793337563ac3162c61218606874b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 { | |
compileSdkVersion rootProject.ext.compileSdkVersion | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
def versionPropsFile = file('version.properties') | |
def code | |
if (versionPropsFile.canRead()) { | |
def Properties versionProps = new Properties() | |
versionProps.load(new FileInputStream(versionPropsFile)) | |
code = versionProps['VERSION_CODE'].toInteger() + 1 | |
if (System.getenv('BUMP_VERSION') == 'yes') { | |
versionProps['VERSION_CODE']=code.toString() | |
versionProps.store(versionPropsFile.newWriter(), null) | |
} | |
} else { | |
throw new GradleException("Could not read version.properties!") | |
} | |
defaultConfig { | |
versionCode 1 | |
applicationId "co.petpit.petpit" | |
minSdkVersion rootProject.ext.minSdkVersion | |
targetSdkVersion rootProject.ext.targetSdkVersion | |
versionName "1.0.2" | |
multiDexEnabled true | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment