Use literal versionCode/Name for F-Droid compatibility

This commit is contained in:
Egor 2026-03-13 01:59:21 -07:00
parent 47d8cf8330
commit 0d18c58ba1
3 changed files with 6 additions and 9 deletions

View file

@ -48,7 +48,8 @@ release:
$(eval MINOR := $(word 2,$(VERSION_PARTS))) $(eval MINOR := $(word 2,$(VERSION_PARTS)))
$(eval PATCH := $(word 3,$(VERSION_PARTS))) $(eval PATCH := $(word 3,$(VERSION_PARTS)))
$(eval VCODE := $(shell echo $$(($(MAJOR) * 10000 + $(MINOR) * 100 + $(PATCH))))) $(eval VCODE := $(shell echo $$(($(MAJOR) * 10000 + $(MINOR) * 100 + $(PATCH)))))
@echo -n "$(VCODE)" > VERSION_CODE @sed -i 's/versionCode = [0-9]*/versionCode = $(VCODE)/' app/build.gradle.kts
@sed -i 's/versionName = "[^"]*"/versionName = "$(shell cat VERSION)"/' app/build.gradle.kts
$(eval CHANGELOG := fastlane/metadata/android/en-US/changelogs/$(VCODE).txt) $(eval CHANGELOG := fastlane/metadata/android/en-US/changelogs/$(VCODE).txt)
@if [[ ! -f "$(CHANGELOG)" ]]; then \ @if [[ ! -f "$(CHANGELOG)" ]]; then \
$${EDITOR:-nano} "$(CHANGELOG)"; \ $${EDITOR:-nano} "$(CHANGELOG)"; \
@ -58,8 +59,8 @@ release:
rm -f "$(CHANGELOG)"; \ rm -f "$(CHANGELOG)"; \
exit 1; \ exit 1; \
fi fi
git add "$(CHANGELOG)" git add app/build.gradle.kts "$(CHANGELOG)"
git diff --cached --quiet || git commit -m "Add changelog for $(TAG)" git diff --cached --quiet || git commit -m "Release $(TAG)"
@echo "Releasing $(TAG)" @echo "Releasing $(TAG)"
git tag $(TAG) git tag $(TAG)
git push origin $(TAG) git push origin $(TAG)

View file

@ -1 +0,0 @@
10100

View file

@ -28,15 +28,12 @@ android {
compileSdk = 36 compileSdk = 36
val versionString = rootProject.file("VERSION").readText().trim()
val versionCodeInt = rootProject.file("VERSION_CODE").readText().trim().toInt()
defaultConfig { defaultConfig {
applicationId = "app.lonecloud.prism" applicationId = "app.lonecloud.prism"
minSdk = 31 minSdk = 31
targetSdk = 36 targetSdk = 36
versionCode = versionCodeInt versionCode = 10100
versionName = versionString versionName = "1.1.0"
buildConfigField("String", "DEFAULT_API_URL", "\"https://push.services.mozilla.com\"") buildConfigField("String", "DEFAULT_API_URL", "\"https://push.services.mozilla.com\"")
} }