Fixed android build errors

This commit is contained in:
Anuken 2018-04-25 20:53:32 -04:00
parent 3ed6be1d6d
commit 6244551d69

View File

@ -42,18 +42,26 @@ android {
defaultConfig {
def vfile = file('../core/assets/version.properties')
def props = new Properties()
props.load(new FileInputStream(vfile))
def code = props['androidBuildCode'].toInteger() + 1
props['androidBuildCode'] = code.toString()
props.store(vfile.newWriter(), "Autogenerated file. Do not modify.")
def code = 0
def versionNameResult = "unknown"
if(vfile.exists()){
def props = new Properties()
props.load(new FileInputStream(vfile))
code = (props['androidBuildCode'] == null ? 0 : props['androidBuildCode']).toInteger() + 1
props['androidBuildCode'] = code.toString()
props.store(vfile.newWriter(), "Autogenerated file. Do not modify.")
versionNameResult = "$versionNumber-$versionType-${props['build'].replace(" ", "-")}"
}
applicationId "io.anuke.mindustry"
minSdkVersion 9
targetSdkVersion 26
versionCode code
versionName "$versionNumber-$versionType-${props['build'].replace(" ", "-")}"
versionName versionNameResult
}
compileOptions {