Add a fish version of the Android env helper

Only the env helper needs a per-shell variant, since it has to mutate the
calling shell; android-setup.sh is executed rather than sourced and already
works from fish.

The fish version finds NDK/JDK candidates via `find` rather than globs because
fish raises an error on a wildcard matching nothing, and "SDK with no ndk/
directory yet" is a normal state the helper has to report cleanly.

Also switch the bash helper's NDK selection to `find | sort -V` so the two
agree: glob order is lexicographic, which would rank 9.x above 10.x. Verified
both pick the same NDK and JDK on this machine and against a fixture with
9.0.111 / 10.0.222 / 28.2.333 / 30.0.999-beta2 installed.
This commit is contained in:
2026-08-02 13:22:36 -05:00
parent d494f2543b
commit 17c927afa3
3 changed files with 101 additions and 4 deletions

View File

@@ -145,9 +145,16 @@ Every Android command needs `ANDROID_HOME` / `NDK_HOME` / `JAVA_HOME`. Source
the helper once per shell — it auto-detects all three:
```bash
source scripts/android-env.sh
source scripts/android-env.sh # bash / zsh
```
```fish
source scripts/android-env.fish # fish
```
Only the env helper is shell-specific (it has to mutate the calling shell);
`android-setup.sh` is executed rather than sourced, so it works from any shell.
Then, from the project root:
```bash