Add a standalone Android app with the same daily reading and config page
build / build (push) Successful in 4m8s

android/ links engine/src/ and interpreter/src/ via JNI/CMake (real
astronomy.c, not the watch's size-constrained substitute), rendering
through Jetpack Compose with a burger-menu config page mirroring
WatchConfig and a WorkManager-driven daily notification. Independent
of the watch app - neither requires the other.

build-image now bundles the Android SDK/NDK alongside the Pebble SDK
(VERSION bumped to 2), and .gitea/workflows/build.yml/Makefile/
run-image.sh build and publish the APK the same way as the CLI
tarball and .pbw.
This commit is contained in:
ml
2026-07-18 22:41:51 +02:00
parent a3e437277f
commit 3bc1263294
49 changed files with 2530 additions and 43 deletions
+37 -1
View File
@@ -92,7 +92,12 @@ PACKAGE_DIR := $(BUILD_DIR)/package
WATCH_DIR := watch
WATCH_PBW := $(WATCH_DIR)/build/watch.pbw
.PHONY: all test clean images i18n scripts package watchapp
# ---- Android app ----
ANDROID_DIR := android
ANDROID_APK := $(ANDROID_DIR)/app/build/outputs/apk/debug/app-debug.apk
.PHONY: all test clean images i18n scripts package watchapp android
all: $(ENGINE_BINARY) $(INTERP_BINARY) images i18n scripts
@@ -242,3 +247,34 @@ watchapp:
PBW_NAME="deck-in-a-dash-$$V.pbw"; \
cp $(WATCH_PBW) "$(DIST_DIR)/$$PBW_NAME"; \
echo "Wrote $(DIST_DIR)/$$PBW_NAME"
# Builds the Android app (`./gradlew assembleDebug` in android/, via its
# own Gradle/AGP/NDK toolchain - not a plain C toolchain, so this is a
# separate target from `all` rather than one of its prerequisites) and
# copies the resulting debug APK into dist/, versioned the same way
# `package`/`watchapp` above version their own artifacts (current git
# tag, or `make android VERSION=1.2.3` to override). Ships the
# auto-generated debug keystore, not a release signing config - see the
# root CLAUDE.md's Android section for why. Requires the Android SDK/NDK
# (ANDROID_HOME/ANDROID_NDK_HOME set, see android/README.md) - this is
# NOT checked by the root `make`/`make test`, so a machine without them
# can still build/test the CLI (and, separately, the watch app).
android:
cd $(ANDROID_DIR) && ./gradlew assembleDebug
@mkdir -p $(DIST_DIR)
@V="$(VERSION)"; \
if [ -z "$$V" ]; then \
if TAG=$$(git describe --tags --exact-match --match 'v[0-9]*.[0-9]*.[0-9]*' 2>/dev/null); then \
V=$${TAG#v}; \
else \
V="0.0.0-dev+$$(git rev-parse --short HEAD)"; \
echo "WARNING: HEAD is not on a vX.Y.Z tag - building placeholder version $$V (push a tag to drive a real release version)" >&2; \
fi; \
fi; \
case "$$V" in \
[0-9]*.[0-9]*.[0-9]*) ;; \
*) echo "PREFLIGHT FAIL: VERSION '$$V' is not a semantic version (expected X.Y.Z, optionally with a -pre+meta suffix)" >&2; exit 1;; \
esac; \
APK_NAME="deck-in-a-dash-$$V.apk"; \
cp $(ANDROID_APK) "$(DIST_DIR)/$$APK_NAME"; \
echo "Wrote $(DIST_DIR)/$$APK_NAME"