Update build optimizations

This commit is contained in:
David Perez 2026-01-28 13:30:40 -06:00
parent 92ba38c831
commit ba2eda1ad1
No known key found for this signature in database
GPG Key ID: 3E29BD8B1BF090AC
11 changed files with 13 additions and 106 deletions

View File

@ -299,18 +299,6 @@ dependencies {
testImplementation(libs.square.turbine) testImplementation(libs.square.turbine)
} }
tasks.withType<Test>().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 { afterEvaluate {
// Disable Fdroid-specific tasks that we want to exclude // Disable Fdroid-specific tasks that we want to exclude
val fdroidTasksToDisable = tasks.withType<GoogleServicesTask>() + val fdroidTasksToDisable = tasks.withType<GoogleServicesTask>() +

View File

@ -260,18 +260,6 @@ protobuf {
} }
} }
tasks.withType<Test>().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) { private fun renameFile(path: String, newName: String) {
val originalFile = File(path) val originalFile = File(path)
if (!originalFile.exists()) { if (!originalFile.exists()) {

View File

@ -75,15 +75,3 @@ dependencies {
testImplementation(libs.mockk.mockk) testImplementation(libs.mockk.mockk)
testImplementation(libs.square.turbine) testImplementation(libs.square.turbine)
} }
tasks.withType<Test>().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"
}

View File

@ -183,6 +183,18 @@ subprojects {
tasks.withType<JavaCompile>().configureEach { tasks.withType<JavaCompile>().configureEach {
options.isFork = true options.isFork = true
} }
tasks.withType<Test>().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 { afterEvaluate {

View File

@ -68,15 +68,3 @@ kotlin {
jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get()) jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
} }
} }
tasks.withType<Test>().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"
}

View File

@ -63,15 +63,3 @@ dependencies {
testImplementation(libs.kotlinx.coroutines.test) testImplementation(libs.kotlinx.coroutines.test)
testImplementation(libs.mockk.mockk) testImplementation(libs.mockk.mockk)
} }
tasks.withType<Test>().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"
}

View File

@ -73,15 +73,3 @@ dependencies {
testFixturesImplementation(libs.junit.jupiter) testFixturesImplementation(libs.junit.jupiter)
testFixturesImplementation(libs.kotlinx.coroutines.test) testFixturesImplementation(libs.kotlinx.coroutines.test)
} }
tasks.withType<Test>().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"
}

View File

@ -8,7 +8,7 @@ org.gradle.caching=true
org.gradle.configuration-cache=true org.gradle.configuration-cache=true
org.gradle.configuration-cache.parallel=true org.gradle.configuration-cache.parallel=true
org.gradle.configuration-cache.problems=warn 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 org.gradle.parallel=true
# Disable build features that are enabled by default and we do not need # Disable build features that are enabled by default and we do not need

View File

@ -78,15 +78,3 @@ dependencies {
testFixturesImplementation(libs.square.retrofit.kotlinx.serialization) testFixturesImplementation(libs.square.retrofit.kotlinx.serialization)
testFixturesImplementation(libs.square.okhttp.mockwebserver) testFixturesImplementation(libs.square.okhttp.mockwebserver)
} }
tasks.withType<Test>().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"
}

View File

@ -117,15 +117,3 @@ dependencies {
testImplementation(testFixtures(project(":ui"))) testImplementation(testFixtures(project(":ui")))
} }
tasks.withType<Test>().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"
}

View File

@ -115,14 +115,5 @@ kotlin {
} }
tasks.withType<Test>().configureEach { tasks.withType<Test>().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") android.sourceSets["main"].res.srcDirs("src/test/res")
} }