The shell provides JDK 21, Gradle 8, Node 22, Android SDK 35 with build-tools 35.0.0, and the libraries Compose Desktop and Java Sound need. The Android license is accepted in the shell config; documented in the README.
This commit is contained in:
1 parent
7fb41b5ad4
commit
9cdbb3702e
2 files changed
+75
No files matched your search
@@ -50,6 +50,14 @@ composeApp/
|
|||||||
|
|
||||||
Requirements: JDK 21, Android SDK 35 for the app target, Node (Kotlin downloads its own for web).
|
Requirements: JDK 21, Android SDK 35 for the app target, Node (Kotlin downloads its own for web).
|
||||||
|
|
||||||
|
With Nix, everything is provided by `shell.nix` (JDK 21, Gradle 8, Node 22, Android SDK 35 with build-tools 35.0.0, and the desktop runtime libraries):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix-shell
|
||||||
|
```
|
||||||
|
|
||||||
|
The shell accepts the unfree Android SDK license for you; see the comment at the top of `shell.nix`. Without Nix, point `ANDROID_HOME` at an SDK containing platform 35 and build-tools 35.0.0.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export ANDROID_HOME=/opt/android-sdk
|
export ANDROID_HOME=/opt/android-sdk
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
{ pkgs ? import <nixpkgs> {
|
||||||
|
# The Android SDK is unfree and requires accepting Google's license.
|
||||||
|
# Setting this here asserts that you accept it for this dev shell.
|
||||||
|
config = {
|
||||||
|
allowUnfree = true;
|
||||||
|
android_sdk.accept_license = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
jdk = pkgs.jdk21;
|
||||||
|
gradle = pkgs.gradle_8;
|
||||||
|
node = pkgs.nodejs_22;
|
||||||
|
|
||||||
|
androidPackages = pkgs.androidenv.composeAndroidPackages {
|
||||||
|
platformVersions = [ "35" ];
|
||||||
|
buildToolsVersions = [ "35.0.0" ];
|
||||||
|
includeEmulator = false;
|
||||||
|
includeSystemImages = false;
|
||||||
|
includeNDK = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
androidSdk = "${androidPackages.androidsdk}/libexec/android-sdk";
|
||||||
|
|
||||||
|
desktopLibs = with pkgs; [
|
||||||
|
libGL
|
||||||
|
xorg.libX11
|
||||||
|
xorg.libXext
|
||||||
|
xorg.libXrender
|
||||||
|
fontconfig
|
||||||
|
freetype
|
||||||
|
alsa-lib
|
||||||
|
];
|
||||||
|
in
|
||||||
|
pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
jdk
|
||||||
|
gradle
|
||||||
|
node
|
||||||
|
zip
|
||||||
|
unzip
|
||||||
|
git
|
||||||
|
curl
|
||||||
|
python3
|
||||||
|
] ++ desktopLibs;
|
||||||
|
|
||||||
|
JAVA_HOME = jdk.home;
|
||||||
|
ANDROID_HOME = androidSdk;
|
||||||
|
ANDROID_SDK_ROOT = androidSdk;
|
||||||
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath desktopLibs;
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH"
|
||||||
|
echo "AudioManager client dev shell"
|
||||||
|
echo " Java: $(java -version 2>&1 | head -1)"
|
||||||
|
echo " Gradle: $(gradle --version | grep '^Gradle' | head -1)"
|
||||||
|
echo " Node: $(node --version)"
|
||||||
|
echo " Android SDK: $ANDROID_HOME"
|
||||||
|
echo ""
|
||||||
|
echo "Build:"
|
||||||
|
echo " gradle :composeApp:desktopTest"
|
||||||
|
echo " gradle :composeApp:assembleDebug"
|
||||||
|
echo " gradle :composeApp:run"
|
||||||
|
echo " gradle :composeApp:wasmJsBrowserDevelopmentExecutableDistribution"
|
||||||
|
'';
|
||||||
|
}
|
||||||
Reference in new issue
Block a user