docs: record that the full Kotlin toolchain now runs under nix

Follow-up to the justfile JAVA_HOME fix. Both AGENTS.md and the Android
dependency-modernization TODO entry still described the pre-fix limitation —
that a machine without Android Studio could compile the app via
build-android-nix but could not run Kotlin unit tests, detekt, or ktfmt.

That is no longer true. Verified on a machine with no local Android toolchain:
`nix develop --command just gradlew test` BUILD SUCCESSFUL in 14m 1s
(testDebugUnitTest executed), `just fmt-kotlin-check` and `just gradlew detekt
--rerun-tasks` both succeed in seconds. Note the asymmetry in AGENTS.md: tasks
depending on buildRustLib pay a full aarch64-linux-android release build first,
detekt/ktfmt do not.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017WEEHetSTuEH5amjXVKPVn
This commit is contained in:
Greg Shuflin
2026-08-05 02:34:18 -07:00
co-authored by Claude Opus 5
parent 96f8b9a139
commit 09a205b142
2 changed files with 21 additions and 20 deletions
+13 -11
View File
@@ -51,17 +51,19 @@ silently produce a different artifact from what CI/other developers build.
- **Android toolchain present**: use `just android-build` / `just gradlew
<task>` (e.g. `just gradlew build`, `just gradlew assembleDebug`,
`just gradlew test`), plus `just lint-kotlin` and `just fmt-kotlin`.
- **No Android toolchain, but Nix**: `just build-android-nix` (`nix develop
--command just android-build`) builds the debug APK hermetically —
`flake.nix`'s devShell supplies the JDK, the SDK/NDK via `androidenv`, and
the Rust toolchain, so this also runs `buildRustLib`/`generateUniffiBindings`
and regenerates the uniffi Kotlin bindings from a hermetically-built `.so`.
**This covers compilation only.** `just gradlew`, `lint-kotlin`, and
`fmt-kotlin` all `export JAVA_HOME=/opt/android-studio/jbr`
unconditionally — unlike `android-build`, which respects an existing
`JAVA_HOME` — so they fail here even inside the devShell, and there is
currently no way to run Kotlin unit tests, detekt, or ktfmt on such a
machine. Say so rather than reporting them as passing or as skipped-but-fine.
- **No Android toolchain, but Nix**: everything above still works, prefixed
with `nix develop --command`. `flake.nix`'s devShell supplies the JDK, the
SDK/NDK via `androidenv`, and the Rust toolchain, and every Kotlin recipe
inherits an existing `JAVA_HOME` rather than forcing the Android Studio
JBR. So `just build-android-nix` (= `nix develop --command just
android-build`) builds the debug APK — also running
`buildRustLib`/`generateUniffiBindings`, regenerating the uniffi Kotlin
bindings from a hermetically-built `.so` — and `nix develop --command just
gradlew test` / `... just lint-kotlin` / `... just fmt-kotlin` run the unit
tests, detekt, and ktfmt. Budget for the first build: anything depending on
`buildRustLib` does a full `--release` cargo build for
`aarch64-linux-android` first (`gradlew test` measured at ~14 min cold,
seconds once warm), whereas `detekt`/`ktfmt` don't and finish in seconds.
- **Neither**: Android/Kotlin changes can't be compiled or verified at all;
say so explicitly rather than guessing whether a change compiles.
- Rust: `just build-synchronicity-lib-android` builds the synchronicity_lib
+8 -9
View File
@@ -448,15 +448,14 @@ track count.
Compose 1.7 → current and Material3 1.3 → current, affecting every screen; this
wants to be its own change with its own verification pass, **not** folded into
feature work.
- **Verification**: the flake runs Gradle inside the devShell rather than a sealed
derivation, so dependency resolution is an ordinary network Gradle resolve —
there is no vendored dependency hash to regenerate for a version bump. But
`just build-android-nix` only runs `assembleDebug`, and `just gradlew` /
`lint-kotlin` / `fmt-kotlin` hardcode `JAVA_HOME=/opt/android-studio/jbr`, so a
machine without Android Studio can compile the bump but cannot run the Kotlin
tests, detekt, or ktfmt against it. Either do this on a machine with the full
toolchain, or first make those recipes respect an existing `JAVA_HOME` the way
`android-build` does (a one-line `${JAVA_HOME:-...}` change each).
- **Verification is fully available without a local Android Studio install**:
the flake runs Gradle inside the devShell rather than a sealed derivation, so
dependency resolution is an ordinary network Gradle resolve — there is no
vendored dependency hash to regenerate for a version bump. `just
build-android-nix` builds the APK, and `nix develop --command just gradlew
test` / `... just lint-kotlin` / `... just fmt-kotlin-check` cover unit tests,
detekt, and formatting. A bump should be checked against all four, since the
Compose/Material3 jump is expected to move behavior across every screen.
- **Depends on**: nothing. Should land *before* the Android half of
`docs/command-palette-and-search.md` (its §9 step 5), so §7.2 can target the
current `SearchBar` API instead of the deprecated one.