Make F-Droid happy

This commit is contained in:
世界 2024-02-16 13:48:30 +08:00
parent f8ebfaabe2
commit 956867d286
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 21 additions and 3 deletions

View file

@ -21,8 +21,8 @@ android {
applicationId "io.nekohasekai.sfa"
minSdk 21
targetSdk 34
versionCode getProps("VERSION_CODE").toInteger()
versionName getProps("VERSION_NAME")
versionCode getVersionProps("VERSION_CODE").toInteger()
versionName getVersionProps("VERSION_NAME")
setProperty("archivesBaseName", "SFA-" + versionName)
}
@ -79,7 +79,7 @@ android {
variant.outputs.configureEach {
outputFileName = (outputFileName as String).replace("-release", "")
outputFileName = (outputFileName as String).replace("-play", "")
outputFileName = (outputFileName as String).replace("-other", "")
outputFileName = (outputFileName as String).replace("-other", "-foss")
}
}
}
@ -166,4 +166,19 @@ def getProps(String propName) {
} else {
return ""
}
}
def getVersionProps(String propName) {
def propsFile = rootProject.file('version.properties')
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
String value = props[propName]
if (value == null) {
return ""
}
return value
} else {
return ""
}
}

3
version.properties Normal file
View file

@ -0,0 +1,3 @@
VERSION_CODE=260
VERSION_NAME=1.8.6
GO_VERSION=go1.22.0