docs/BUILDING.md

Building and development

The app uses Java 17, AndroidX and Material 3, Gradle/Android Gradle Plugin, JSch for SSH, and Bouncy Castle for Ed25519. The minimum Android version is API 26. The application ID is name.devnull.ezagent.android; the Java library uses name.devnull.ezagent.lib.

Build scripts

The provided container-based scripts use rootless Podman; no host JDK or Android SDK is needed for this build path. The Waydroid install script also requires Waydroid and ADB. The first build downloads the Android SDK and Maven dependencies and accepts Android SDK licenses in the container.

sh
1scripts/check-tools
2scripts/build
3scripts/build :ez-agent-lib:test :app:testDebugUnitTest :app:assembleDebug :app:lintDebug
4scripts/install-waydroid

The build image is localhost/ezagent-android-build. Rebuild it after changing its definition with podman build -t localhost/ezagent-android-build -f Containerfile ..

Persistent build caches

scripts/build runs disposable containers, but keeps their caches in the checkout: .gradle-home/ for Gradle, .android-home/ for Android tools and the debug signing key, and .build-home/ for the shell and Java user home. These directories are ignored by Git and survive container removal.

Robolectric downloads Android framework artifacts separately from Gradle into .build-home/.m2/repository/. The script sets both HOME and Java's user.home (using JAVA_TOOL_OPTIONS, also inherited by test workers), so Robolectric's repository and download lock survive between runs. Setting only HOME or persisting only the Gradle cache is insufficient. Retain .build-home/ between builds; CI must restore/save it alongside .gradle-home/ to avoid downloading large framework jars repeatedly. Do not clear caches as a routine retry step.

This is a standard Maven local repository. If prefetching with mvn, point its -Dmaven.repo.local at the same <checkout>/.build-home/.m2/repository directory. Robolectric reads that repository directly; adding Gradle's mavenLocal() is neither necessary nor a fix for its separate framework downloader.

Gradle's --offline does not disable Robolectric's separate downloader. A cold cache still needs Maven access, and persisting it does not lift an existing server-side download limit. HTTP 429 responses should be diagnosed using their response body and Retry-After header rather than retried in a loop.

Notes

  • Build outputs, Gradle caches, and the persistent debug signing key in .android-home/ are ignored by Git. Retain that local signing key to update a debug installation without uninstalling it.
  • Set ANDROID_SERIAL to select a specific Waydroid ADB target if needed.
  • The Java client library API is documented in ez-agent-lib/README.md.