Skip to content

Commit 279ba56

Browse files
Update build optimizations
1 parent 0d0a5cb commit 279ba56

File tree

11 files changed

+13
-106
lines changed

11 files changed

+13
-106
lines changed

app/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -299,18 +299,6 @@ dependencies {
299299
testImplementation(libs.square.turbine)
300300
}
301301

302-
tasks.withType<Test>().configureEach {
303-
useJUnitPlatform()
304-
@Suppress("MagicNumber")
305-
forkEvery = 100
306-
maxHeapSize = "2g"
307-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
308-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
309-
// Explicitly setting the user Country and Language because tests assume en-US
310-
"-Duser.country=US" +
311-
"-Duser.language=en"
312-
}
313-
314302
afterEvaluate {
315303
// Disable Fdroid-specific tasks that we want to exclude
316304
val fdroidTasksToDisable = tasks.withType<GoogleServicesTask>() +

authenticator/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -260,18 +260,6 @@ protobuf {
260260
}
261261
}
262262

263-
tasks.withType<Test>().configureEach {
264-
useJUnitPlatform()
265-
@Suppress("MagicNumber")
266-
forkEvery = 100
267-
maxHeapSize = "2g"
268-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
269-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
270-
// Explicitly setting the user Country and Language because tests assume en-US
271-
"-Duser.country=US" +
272-
"-Duser.language=en"
273-
}
274-
275263
private fun renameFile(path: String, newName: String) {
276264
val originalFile = File(path)
277265
if (!originalFile.exists()) {

authenticatorbridge/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,3 @@ dependencies {
7575
testImplementation(libs.mockk.mockk)
7676
testImplementation(libs.square.turbine)
7777
}
78-
79-
tasks.withType<Test>().configureEach {
80-
useJUnitPlatform()
81-
@Suppress("MagicNumber")
82-
forkEvery = 100
83-
maxHeapSize = "2g"
84-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
85-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
86-
// Explicitly setting the user Country and Language because tests assume en-US
87-
"-Duser.country=US" +
88-
"-Duser.language=en"
89-
}

build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,18 @@ subprojects {
183183
tasks.withType<JavaCompile>().configureEach {
184184
options.isFork = true
185185
}
186+
tasks.withType<Test>().configureEach {
187+
useJUnitPlatform()
188+
@Suppress("MagicNumber")
189+
forkEvery = 500
190+
maxHeapSize = "2g"
191+
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
192+
@Suppress("UselessCallOnNotNull")
193+
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
194+
// Explicitly setting the user Country and Language because tests assume en-US
195+
"-Duser.country=US" +
196+
"-Duser.language=en"
197+
}
186198
}
187199

188200
afterEvaluate {

core/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,3 @@ kotlin {
6868
jvmTarget = JvmTarget.fromTarget(libs.versions.jvmTarget.get())
6969
}
7070
}
71-
72-
tasks.withType<Test>().configureEach {
73-
useJUnitPlatform()
74-
@Suppress("MagicNumber")
75-
forkEvery = 100
76-
maxHeapSize = "2g"
77-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
78-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
79-
// Explicitly setting the user Country and Language because tests assume en-US
80-
"-Duser.country=US" +
81-
"-Duser.language=en"
82-
}

cxf/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,3 @@ dependencies {
6363
testImplementation(libs.kotlinx.coroutines.test)
6464
testImplementation(libs.mockk.mockk)
6565
}
66-
67-
tasks.withType<Test>().configureEach {
68-
useJUnitPlatform()
69-
@Suppress("MagicNumber")
70-
forkEvery = 100
71-
maxHeapSize = "2g"
72-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
73-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
74-
// Explicitly setting the user Country and Language because tests assume en-US
75-
"-Duser.country=US" +
76-
"-Duser.language=en"
77-
}

data/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,3 @@ dependencies {
7373
testFixturesImplementation(libs.junit.jupiter)
7474
testFixturesImplementation(libs.kotlinx.coroutines.test)
7575
}
76-
77-
tasks.withType<Test>().configureEach {
78-
useJUnitPlatform()
79-
@Suppress("MagicNumber")
80-
forkEvery = 100
81-
maxHeapSize = "2g"
82-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
83-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
84-
// Explicitly setting the user Country and Language because tests assume en-US
85-
"-Duser.country=US" +
86-
"-Duser.language=en"
87-
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kotlin.compilerArgs=-Xjspecify-annotations=strict, -Xtype-enhancement-improvemen
77
org.gradle.caching=true
88
org.gradle.configuration-cache=true
99
org.gradle.configuration-cache.parallel=true
10-
org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -Dfile.encoding=UTF-8
10+
org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8
1111
org.gradle.parallel=true
1212

1313
# Disable build features that are enabled by default and we do not need

network/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,3 @@ dependencies {
7878
testFixturesImplementation(libs.square.retrofit.kotlinx.serialization)
7979
testFixturesImplementation(libs.square.okhttp.mockwebserver)
8080
}
81-
82-
tasks.withType<Test>().configureEach {
83-
useJUnitPlatform()
84-
@Suppress("MagicNumber")
85-
forkEvery = 100
86-
maxHeapSize = "2g"
87-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
88-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
89-
// Explicitly setting the user Country and Language because tests assume en-US
90-
"-Duser.country=US" +
91-
"-Duser.language=en"
92-
}

testharness/build.gradle.kts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,3 @@ dependencies {
117117

118118
testImplementation(testFixtures(project(":ui")))
119119
}
120-
121-
tasks.withType<Test>().configureEach {
122-
useJUnitPlatform()
123-
@Suppress("MagicNumber")
124-
forkEvery = 100
125-
maxHeapSize = "2g"
126-
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1)
127-
jvmArgs = jvmArgs.orEmpty() + "-XX:+UseParallelGC" +
128-
// Explicitly setting the user Country and Language because tests assume en-US
129-
"-Duser.country=US" +
130-
"-Duser.language=en"
131-
}

0 commit comments

Comments
 (0)