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:
+50
-5
@@ -1,7 +1,8 @@
|
||||
# Build environment for deck_in_a_dash release artifacts: a plain C
|
||||
# toolchain for the desktop deck-engine/interpreter-cli binaries (`make
|
||||
# test`, `make package`) plus the Pebble SDK for the watch app (`make
|
||||
# watchapp`), pinned to the versions validated on the maintainer's dev
|
||||
# test`, `make package`), the Pebble SDK for the watch app (`make
|
||||
# watchapp`), and the Android SDK/NDK for the Android app (`make
|
||||
# android`), pinned to the versions validated on the maintainer's dev
|
||||
# machine. Rebuild with ../build-image.sh whenever a version below
|
||||
# changes.
|
||||
#
|
||||
@@ -12,17 +13,28 @@ FROM ubuntu:22.04
|
||||
ARG PEBBLE_TOOL_VERSION=5.0.39
|
||||
ARG PEBBLE_SDK_CORE_VERSION=4.17
|
||||
ARG NODE_VERSION=24.16.0
|
||||
ARG ANDROID_CMDLINE_TOOLS_VERSION=9862592
|
||||
ARG ANDROID_PLATFORM_VERSION=36
|
||||
ARG ANDROID_BUILD_TOOLS_VERSION=36.0.0
|
||||
ARG ANDROID_NDK_VERSION=30.0.14904198
|
||||
ARG ANDROID_CMAKE_VERSION=3.22.1
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
PATH=/root/.local/bin:${PATH}
|
||||
|
||||
# build-essential: gcc/make for the desktop deck-engine/interpreter-cli
|
||||
# binaries (`make test`, `make package`).
|
||||
# binaries (`make test`, `make package`) and for the Android app's JNI
|
||||
# native library (app/src/main/jni/CMakeLists.txt - the NDK's own
|
||||
# toolchain does the actual cross-compiling, but AGP's build needs a
|
||||
# host C toolchain available too).
|
||||
# python3/python3-venv/python3-pip: `pebble sdk install` below creates a
|
||||
# venv per SDK version; Pillow (installed below) is needed at `pebble
|
||||
# build` time by watch/scripts/gen_card_images.py and gen_app_icon.py.
|
||||
# build` time by watch/scripts/gen_card_images.py and gen_app_icon.py,
|
||||
# and by the Android app's android/scripts/gen_card_images.py and
|
||||
# gen_launcher_icon.py.
|
||||
# git/curl/ca-certificates/unzip/tar/xz-utils: checkout, tool downloads,
|
||||
# and `make package`/`make watchapp`'s `git describe --tags` versioning.
|
||||
# and `make package`/`make watchapp`/`make android`'s `git describe
|
||||
# --tags` versioning.
|
||||
# openssh-client: the build workflow's `sftp` publish to dl.ladkau.de.
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential python3 python3-venv python3-pip \
|
||||
@@ -46,4 +58,37 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
|
||||
&& uv tool install "pebble-tool==${PEBBLE_TOOL_VERSION}" \
|
||||
&& pebble sdk install "${PEBBLE_SDK_CORE_VERSION}"
|
||||
|
||||
# Android SDK/NDK: openjdk-17 (Gradle/AGP's own minimum JDK) + the
|
||||
# cmdline-tools' own sdkmanager to install exactly the platform/build-
|
||||
# tools/NDK/CMake versions android/app/build.gradle.kts pins - unlike
|
||||
# the Pebble/CLI build path above, `make android`'s own Gradle build
|
||||
# still needs network access at build time (Gradle/AGP/androidx
|
||||
# dependency resolution against Google's Maven + Maven Central - see the
|
||||
# root CLAUDE.md's Android section for why this is an accepted,
|
||||
# deliberate deviation from this image's otherwise-offline build
|
||||
# philosophy). android/gradlew resolves its own pinned Gradle version -
|
||||
# no Gradle binary is baked into this image.
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends openjdk-17-jdk-headless \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV ANDROID_HOME=/opt/android-sdk \
|
||||
ANDROID_SDK_ROOT=/opt/android-sdk
|
||||
ENV PATH=${ANDROID_HOME}/cmdline-tools/latest/bin:${ANDROID_HOME}/platform-tools:${PATH}
|
||||
|
||||
RUN mkdir -p "${ANDROID_HOME}/cmdline-tools" \
|
||||
&& curl -sSL -o /tmp/cmdline-tools.zip \
|
||||
"https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_CMDLINE_TOOLS_VERSION}_latest.zip" \
|
||||
&& unzip -q /tmp/cmdline-tools.zip -d "${ANDROID_HOME}/cmdline-tools" \
|
||||
&& mv "${ANDROID_HOME}/cmdline-tools/cmdline-tools" "${ANDROID_HOME}/cmdline-tools/latest" \
|
||||
&& rm /tmp/cmdline-tools.zip \
|
||||
&& yes | sdkmanager --licenses >/dev/null \
|
||||
&& sdkmanager --install \
|
||||
"platform-tools" \
|
||||
"platforms;android-${ANDROID_PLATFORM_VERSION}" \
|
||||
"build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
|
||||
"ndk;${ANDROID_NDK_VERSION}" \
|
||||
"cmake;${ANDROID_CMAKE_VERSION}"
|
||||
|
||||
ENV ANDROID_NDK_HOME=${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
Reference in New Issue
Block a user