Add a standalone Android app with the same daily reading and config page
build / build (push) Successful in 4m8s
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:
+19
-12
@@ -1,12 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Runs `make test package watchapp` inside the local build-image
|
||||
# Runs `make test package watchapp android` inside the local build-image
|
||||
# container, mirroring what the Gitea Actions build workflow does -
|
||||
# useful for testing build-image changes locally before pushing
|
||||
# anything to cr.ladkau.de.
|
||||
#
|
||||
# Usage: ./run-image.sh [VERSION]
|
||||
# VERSION is passed through to `make` (see the Makefile's `package`/
|
||||
# `watchapp` targets); omit it for their own git-tag-based default.
|
||||
# `watchapp`/`android` targets); omit it for their own git-tag-based
|
||||
# default.
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
@@ -36,22 +37,28 @@ VERSION="${1:-${VERSION:-}}"
|
||||
|
||||
# CI always starts from a fresh checkout, but this script bind-mounts the
|
||||
# live host repo — so build output left over from a previous local run
|
||||
# (build/, dist/, watch/build, and the generated watch resources below)
|
||||
# would make this run skip work a real fresh checkout wouldn't, silently
|
||||
# hiding bugs that only show up in CI. Wipe them first so every run
|
||||
# exercises a true from-scratch build, same as CI.
|
||||
# (build/, dist/, watch/build, the generated watch resources below, and
|
||||
# the Android app's own build/generated-resource dirs) would make this
|
||||
# run skip work a real fresh checkout wouldn't, silently hiding bugs that
|
||||
# only show up in CI. Wipe them first so every run exercises a true
|
||||
# from-scratch build, same as CI.
|
||||
echo "== Cleaning generated build artifacts for a fresh build =="
|
||||
rm -rf \
|
||||
"$ROOT/build" "$ROOT/dist" "$ROOT/watch/build" \
|
||||
"$ROOT/watch/resources/img" "$ROOT/watch/resources/app_icon.png" \
|
||||
"$ROOT/watch/src/c/i18n_tables.auto.c"
|
||||
"$ROOT/watch/src/c/i18n_tables.auto.c" \
|
||||
"$ROOT/android/build" "$ROOT/android/app/build" "$ROOT/android/app/.cxx" \
|
||||
"$ROOT/android/app/src/main/assets/i18n" "$ROOT/android/app/src/main/res/drawable-nodpi" \
|
||||
"$ROOT/android/app/src/main/res"/mipmap-mdpi "$ROOT/android/app/src/main/res"/mipmap-hdpi \
|
||||
"$ROOT/android/app/src/main/res"/mipmap-xhdpi "$ROOT/android/app/src/main/res"/mipmap-xxhdpi \
|
||||
"$ROOT/android/app/src/main/res"/mipmap-xxxhdpi
|
||||
|
||||
echo "== Running make test package watchapp inside $IMAGE =="
|
||||
echo "== Running make test package watchapp android inside $IMAGE =="
|
||||
# The container runs as root (needed for the toolchain baked into the
|
||||
# image), so anything it writes into this bind mount — dist/, build/,
|
||||
# watch/build, etc. — would otherwise come back owned by root, leaving
|
||||
# the host repo unusable without sudo. Chown everything back to the host
|
||||
# user on exit, whether the build succeeds or fails.
|
||||
# watch/build, android/.gradle, etc. — would otherwise come back owned
|
||||
# by root, leaving the host repo unusable without sudo. Chown everything
|
||||
# back to the host user on exit, whether the build succeeds or fails.
|
||||
docker run --rm \
|
||||
-v "$ROOT:/workspace" \
|
||||
-w /workspace \
|
||||
@@ -62,7 +69,7 @@ docker run --rm \
|
||||
bash -c '
|
||||
git config --global --add safe.directory /workspace
|
||||
trap "chown -R \"$HOST_UID:$HOST_GID\" /workspace" EXIT
|
||||
make test package watchapp
|
||||
make test package watchapp android
|
||||
'
|
||||
|
||||
echo "== Done — artifacts in dist/ =="
|
||||
|
||||
Reference in New Issue
Block a user