diff --git a/app/build.gradle b/app/build.gradle index 89e3f78..40749e0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 "" + } } \ No newline at end of file diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..46b7927 --- /dev/null +++ b/version.properties @@ -0,0 +1,3 @@ +VERSION_CODE=260 +VERSION_NAME=1.8.6 +GO_VERSION=go1.22.0