Skip to content

Commit

Permalink
Make F-Droid happy
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Feb 16, 2024
1 parent 185fc2b commit 686c415
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
21 changes: 18 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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")
}
}
}
Expand Down Expand Up @@ -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 changes: 3 additions & 0 deletions version.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
VERSION_CODE=260
VERSION_NAME=1.8.6
GO_VERSION=go1.22.0

0 comments on commit 686c415

Please sign in to comment.