Skip to content

Commit 686c415

Browse files
committed
Make F-Droid happy
1 parent 185fc2b commit 686c415

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

app/build.gradle

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ android {
2121
applicationId "io.nekohasekai.sfa"
2222
minSdk 21
2323
targetSdk 34
24-
versionCode getProps("VERSION_CODE").toInteger()
25-
versionName getProps("VERSION_NAME")
24+
versionCode getVersionProps("VERSION_CODE").toInteger()
25+
versionName getVersionProps("VERSION_NAME")
2626
setProperty("archivesBaseName", "SFA-" + versionName)
2727
}
2828

@@ -79,7 +79,7 @@ android {
7979
variant.outputs.configureEach {
8080
outputFileName = (outputFileName as String).replace("-release", "")
8181
outputFileName = (outputFileName as String).replace("-play", "")
82-
outputFileName = (outputFileName as String).replace("-other", "")
82+
outputFileName = (outputFileName as String).replace("-other", "-foss")
8383
}
8484
}
8585
}
@@ -166,4 +166,19 @@ def getProps(String propName) {
166166
} else {
167167
return ""
168168
}
169+
}
170+
171+
def getVersionProps(String propName) {
172+
def propsFile = rootProject.file('version.properties')
173+
if (propsFile.exists()) {
174+
def props = new Properties()
175+
props.load(new FileInputStream(propsFile))
176+
String value = props[propName]
177+
if (value == null) {
178+
return ""
179+
}
180+
return value
181+
} else {
182+
return ""
183+
}
169184
}

version.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
VERSION_CODE=260
2+
VERSION_NAME=1.8.6
3+
GO_VERSION=go1.22.0

0 commit comments

Comments
 (0)