aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts6
1 files changed, 6 insertions, 0 deletions
diff --git a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
index cff7eb3e..c5b90e81 100644
--- a/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
+++ b/build-logic/src/main/kotlin/org/jetbrains/conventions/base-java.gradle.kts
@@ -22,6 +22,12 @@ java {
tasks.withType<Test>().configureEach {
useJUnitPlatform()
+ maxParallelForks = if (System.getenv("GITHUB_ACTIONS") != null) {
+ Runtime.getRuntime().availableProcessors()
+ } else {
+ (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
+ }
+
javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(dokkaBuild.testJavaLauncherVersion)
})