fix(nix): share Gradle home so worktree daemons stop piling up (#1339)
This commit is contained in:
2 files changed
+5
-5
No files matched your search
@@ -76,8 +76,9 @@
|
||||
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
|
||||
JAVA_HOME = "${pkgs.jdk21}";
|
||||
|
||||
# Gradle needs a writable home
|
||||
GRADLE_USER_HOME = "$PWD/.gradle-home";
|
||||
# GRADLE_USER_HOME stays at the default ~/.gradle: Nix attrs are not
|
||||
# shell-expanded, so "$PWD/..." gave every checkout and worktree its
|
||||
# own cache and daemon pool, and idle daemons piled up in RAM.
|
||||
|
||||
shellHook = ''
|
||||
echo " HermesControl Android dev shell"
|
||||
@@ -90,9 +91,6 @@
|
||||
# Ensure Android CLI tools and local user binaries are on PATH
|
||||
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$HOME/.local/bin:$PATH"
|
||||
|
||||
# Writable gradle home
|
||||
mkdir -p "$GRADLE_USER_HOME"
|
||||
|
||||
# Enable host keyboard input for the project's existing AVD.
|
||||
hermesAvdConfig="''${ANDROID_AVD_HOME:-''${ANDROID_USER_HOME:-$HOME/.android}/avd}/hermes_dev.avd/config.ini"
|
||||
if [ -f "$hermesAvdConfig" ]; then
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
# Specifies the JVM arguments used for the daemon process.
|
||||
# The setting is particularly useful for tweaking memory settings.
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
# Stop idle daemons after 20 min (default 3 h) so finished builds release their RAM.
|
||||
org.gradle.daemon.idletimeout=1200000
|
||||
# Enables Gradle Build Cache.
|
||||
# See https://docs.gradle.org/current/userguide/build_cache.html
|
||||
org.gradle.caching=true
|
||||
|
||||
Reference in new issue
Block a user