From ba2eda1ad1b184c3b346060154aa5651388c37b5 Mon Sep 17 00:00:00 2001 From: David Perez Date: Wed, 28 Jan 2026 13:30:40 -0600 Subject: [PATCH] Update build optimizations --- app/build.gradle.kts | 12 ------------ authenticator/build.gradle.kts | 12 ------------ authenticatorbridge/build.gradle.kts | 12 ------------ build.gradle.kts | 12 ++++++++++++ core/build.gradle.kts | 12 ------------ cxf/build.gradle.kts | 12 ------------ data/build.gradle.kts | 12 ------------ gradle.properties | 2 +- network/build.gradle.kts | 12 ------------ testharness/build.gradle.kts | 12 ------------ ui/build.gradle.kts | 9 --------- 11 files changed, 13 insertions(+), 106 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 94ac528596..739644385e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -299,18 +299,6 @@ dependencies { testImplementation(libs.square.turbine) } -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} - afterEvaluate { // Disable Fdroid-specific tasks that we want to exclude val fdroidTasksToDisable = tasks.withType() + diff --git a/authenticator/build.gradle.kts b/authenticator/build.gradle.kts index 672fc27b06..08a1fec40a 100644 --- a/authenticator/build.gradle.kts +++ b/authenticator/build.gradle.kts @@ -260,18 +260,6 @@ protobuf { } } -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} - private fun renameFile(path: String, newName: String) { val originalFile = File(path) if (!originalFile.exists()) { diff --git a/authenticatorbridge/build.gradle.kts b/authenticatorbridge/build.gradle.kts index 2f10b8a3da..e99f8527fb 100644 --- a/authenticatorbridge/build.gradle.kts +++ b/authenticatorbridge/build.gradle.kts @@ -75,15 +75,3 @@ dependencies { testImplementation(libs.mockk.mockk) testImplementation(libs.square.turbine) } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/build.gradle.kts b/build.gradle.kts index 72dda1e76e..46a810847b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -183,6 +183,18 @@ subprojects { tasks.withType().configureEach { options.isFork = true } + tasks.withType().configureEach { + useJUnitPlatform() + @Suppress("MagicNumber") + forkEvery = 500 + maxHeapSize = "2g" + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + @Suppress("UselessCallOnNotNull") + jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + + // Explicitly setting the user Country and Language because tests assume en-US + "-Duser.country=US" + + "-Duser.language=en" + } } afterEvaluate { diff --git a/core/build.gradle.kts b/core/build.gradle.kts index c4f19e8ac4..ba604ec8ba 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -68,15 +68,3 @@ kotlin { jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get()) } } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/cxf/build.gradle.kts b/cxf/build.gradle.kts index 01554521e6..2f26a90a9c 100644 --- a/cxf/build.gradle.kts +++ b/cxf/build.gradle.kts @@ -63,15 +63,3 @@ dependencies { testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.mockk.mockk) } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 7cf4be91a6..4cff087a22 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -73,15 +73,3 @@ dependencies { testFixturesImplementation(libs.junit.jupiter) testFixturesImplementation(libs.kotlinx.coroutines.test) } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/gradle.properties b/gradle.properties index 65a70b92ca..441a2fad08 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ org.gradle.caching=true org.gradle.configuration-cache=true org.gradle.configuration-cache.parallel=true org.gradle.configuration-cache.problems=warn -org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8 org.gradle.parallel=true # Disable build features that are enabled by default and we do not need diff --git a/network/build.gradle.kts b/network/build.gradle.kts index ebce1b33a0..fcccb0feba 100644 --- a/network/build.gradle.kts +++ b/network/build.gradle.kts @@ -78,15 +78,3 @@ dependencies { testFixturesImplementation(libs.square.retrofit.kotlinx.serialization) testFixturesImplementation(libs.square.okhttp.mockwebserver) } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/testharness/build.gradle.kts b/testharness/build.gradle.kts index 69772be822..c569e20738 100644 --- a/testharness/build.gradle.kts +++ b/testharness/build.gradle.kts @@ -117,15 +117,3 @@ dependencies { testImplementation(testFixtures(project(":ui"))) } - -tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" -} diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts index c2f6f03cc9..9c129f07ed 100644 --- a/ui/build.gradle.kts +++ b/ui/build.gradle.kts @@ -115,14 +115,5 @@ kotlin { } tasks.withType().configureEach { - useJUnitPlatform() - @Suppress("MagicNumber") - forkEvery = 100 - maxHeapSize = "2g" - maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) - jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" + - // Explicitly setting the user Country and Language because tests assume en-US - "-Duser.country=US" + - "-Duser.language=en" android.sourceSets["main"].res.srcDirs("src/test/res") }