diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ProjectExtensions.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ProjectExtensions.kt index 3f2afaaf32..6c7e717bbd 100644 --- a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ProjectExtensions.kt +++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ProjectExtensions.kt @@ -94,6 +94,12 @@ internal fun Project.configureTestOptions() { } maxHeapSize = "2g" + // Keep forked test JVMs headless: Robolectric/Compose tests otherwise initialize + // AWT on macOS, spawning a Dock icon per fork and stealing window focus. + // apple.awt.UIElement covers anything that flips headless back off. + systemProperty("java.awt.headless", "true") + jvmArgs("-Dapple.awt.UIElement=true") + // JUnit Jupiter parallel execution within each Gradle fork. // Classes run sequentially ("same_thread") because 19+ ViewModel test classes use // Dispatchers.setMain() — a JVM-global singleton that races when classes execute diff --git a/gradle.properties b/gradle.properties index 94fa8b8916..0f7b4eb87a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,6 +21,9 @@ ksp.project.isolation.enabled=true org.gradle.caching=true org.gradle.configuration-cache=true org.gradle.isolated-projects=true -org.gradle.jvmargs=-Xmx8g -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication -XX:ReservedCodeCacheSize=512m -XX:MaxMetaspaceSize=2g -Xss2m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx8g -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:+UseStringDeduplication -XX:ReservedCodeCacheSize=512m -XX:MaxMetaspaceSize=2g -Xss2m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Djava.awt.headless=true -Dapple.awt.UIElement=true org.gradle.parallel=true +# Run the daemon and its workers at low OS priority so full builds don't starve +# the foreground UI on developer laptops. Negligible on dedicated CI runners. +org.gradle.priority=low org.gradle.welcome=never diff --git a/gradle/build-cache.settings.gradle b/gradle/build-cache.settings.gradle index ebc4a52ab7..688011d8aa 100644 --- a/gradle/build-cache.settings.gradle +++ b/gradle/build-cache.settings.gradle @@ -21,17 +21,13 @@ def getMeshProperty(String key) { def currentDir = settingsDir while (currentDir != null) { - def localFile = new File(currentDir, "local.properties") - if (localFile.exists()) { - def props = new Properties() - localFile.withInputStream { props.load(it) } - if (props.containsKey(key)) return props.getProperty(key) - } - def configFile = new File(currentDir, "config.properties") - if (configFile.exists()) { - def props = new Properties() - configFile.withInputStream { props.load(it) } - if (props.containsKey(key)) return props.getProperty(key) + for (name in ["local.properties", "config.properties", "secrets.properties"]) { + def file = new File(currentDir, name) + if (file.exists()) { + def props = new Properties() + file.withInputStream { props.load(it) } + if (props.containsKey(key)) return props.getProperty(key) + } } currentDir = currentDir.parentFile }