From 096510f5adef7c5ed369a89bcca9a1b8144dc51e Mon Sep 17 00:00:00 2001 From: Guillaume ETHEVE Date: Fri, 6 Nov 2026 00:11:03 +0100 Subject: [PATCH] chore: align Nix build tooling with Android Kotlin requirements --- devenv.nix | 7 ++++++- docs/development-nix.md | 7 +++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/devenv.nix b/devenv.nix index 2dbd18c0..0ce05037 100644 --- a/devenv.nix +++ b/devenv.nix @@ -6,7 +6,8 @@ }; languages.java = { enable = true; - jdk.package = pkgs.jdk17; + jdk.package = pkgs.jdk21; + lsp.enable = false; }; android = { enable = true; @@ -22,6 +23,9 @@ packages = with pkgs; [ git gh curl jq ripgrep python3 pkg-config gnumake gcc unzip zip ]; # Gradle's downloaded aapt2 cannot run directly on NixOS. env.GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${config.env.ANDROID_HOME}/build-tools/35.0.0/aapt2"; + # NativeScript's doctor rejects a valid build-only SDK without an emulator. + # enterTest below checks the actual tools used by our local builds. + env.NS_SKIP_ENV_CHECK = "1"; scripts.faceclaw-setup.exec = "npm ci"; scripts.faceclaw-test.exec = "npm test"; enterShell = '' @@ -32,5 +36,6 @@ java -version test -f "$ANDROID_HOME/platforms/android-35/android.jar" test -x "$ANDROID_HOME/build-tools/35.0.0/aapt2" + test -x "$ANDROID_HOME/platform-tools/adb" ''; } diff --git a/docs/development-nix.md b/docs/development-nix.md index 5c29b52c..e796fe42 100644 --- a/docs/development-nix.md +++ b/docs/development-nix.md @@ -4,14 +4,17 @@ Install Nix with flakes and devenv, then run `devenv shell` in this directory (or `nix run nixpkgs#devenv -- shell`). With direnv, `direnv allow` loads `.envrc`. The committed `devenv.lock` pins the environment inputs. -The environment provides Node 22/npm, Java 17, Android SDK/platform 35, +The environment provides Node 22/npm, Java 21, Android SDK/platform 35, build-tools 35.0.0, NDK 27, CMake, Git/GitHub CLI, Python and build utilities. Android SDK licenses are accepted through `devenv.yaml`. Gradle uses the Nix-patched SDK aapt2. Gradle itself comes from the repository's wrapper. +The emulator and system images are omitted. `NS_SKIP_ENV_CHECK=1` bypasses +NativeScript doctor's mandatory emulator check; `devenv test` checks the actual +SDK/JDK build prerequisites instead. Run `faceclaw-setup` (`npm ci`) once, then `faceclaw-test` (`npm test`), `npm run lint` and `npm run test:kotlin`. `devenv test` checks the environment. -`./build.sh` builds the Android app; it does not install it. On NixOS, any +`bash build.sh` builds the Android app; it does not install it. On NixOS, any additional downloaded native executables may require the host's nix-ld support. iOS builds still require macOS/Xcode and are outside this Linux environment.