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";
|
ANDROID_SDK_ROOT = "${androidSdk}/libexec/android-sdk";
|
||||||
JAVA_HOME = "${pkgs.jdk21}";
|
JAVA_HOME = "${pkgs.jdk21}";
|
||||||
|
|
||||||
# Gradle needs a writable home
|
# GRADLE_USER_HOME stays at the default ~/.gradle: Nix attrs are not
|
||||||
GRADLE_USER_HOME = "$PWD/.gradle-home";
|
# shell-expanded, so "$PWD/..." gave every checkout and worktree its
|
||||||
|
# own cache and daemon pool, and idle daemons piled up in RAM.
|
||||||
|
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
echo " HermesControl Android dev shell"
|
echo " HermesControl Android dev shell"
|
||||||
@@ -90,9 +91,6 @@
|
|||||||
# Ensure Android CLI tools and local user binaries are on PATH
|
# Ensure Android CLI tools and local user binaries are on PATH
|
||||||
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$HOME/.local/bin:$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.
|
# 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"
|
hermesAvdConfig="''${ANDROID_AVD_HOME:-''${ANDROID_USER_HOME:-$HOME/.android}/avd}/hermes_dev.avd/config.ini"
|
||||||
if [ -f "$hermesAvdConfig" ]; then
|
if [ -f "$hermesAvdConfig" ]; then
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
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.
|
# Enables Gradle Build Cache.
|
||||||
# See https://docs.gradle.org/current/userguide/build_cache.html
|
# See https://docs.gradle.org/current/userguide/build_cache.html
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|||||||
Reference in new issue
Block a user