mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-03 04:44:24 +07:00
Fixed android build errors
This commit is contained in:
parent
3ed6be1d6d
commit
6244551d69
@ -42,18 +42,26 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
def vfile = file('../core/assets/version.properties')
|
def vfile = file('../core/assets/version.properties')
|
||||||
def props = new Properties()
|
|
||||||
props.load(new FileInputStream(vfile))
|
|
||||||
|
|
||||||
def code = props['androidBuildCode'].toInteger() + 1
|
def code = 0
|
||||||
props['androidBuildCode'] = code.toString()
|
def versionNameResult = "unknown"
|
||||||
props.store(vfile.newWriter(), "Autogenerated file. Do not modify.")
|
|
||||||
|
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"
|
applicationId "io.anuke.mindustry"
|
||||||
minSdkVersion 9
|
minSdkVersion 9
|
||||||
targetSdkVersion 26
|
targetSdkVersion 26
|
||||||
versionCode code
|
versionCode code
|
||||||
versionName "$versionNumber-$versionType-${props['build'].replace(" ", "-")}"
|
versionName versionNameResult
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
Loading…
Reference in New Issue
Block a user