From 9908fb1845f9a230fa2da60dda8467bab64de84c Mon Sep 17 00:00:00 2001 From: Chen Zhang <340355960@qq.com> Date: Wed, 13 Oct 2021 17:01:51 +0800 Subject: [PATCH 1/2] Improve GRADLE build Performance --- build.gradle | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build.gradle b/build.gradle index cdd056e0f..f253daede 100644 --- a/build.gradle +++ b/build.gradle @@ -19,6 +19,19 @@ plugins { } allprojects { + tasks.withType(Test).configureEach { + maxParallelForks = 4 + } + + tasks.withType(Test).configureEach { + forkEvery = 100 + } + + tasks.withType(Test).configureEach { + reports.html.required = false + reports.junitXml.required = false + } + repositories { mavenLocal() jcenter() From f94ec273fbfbe12ead81d4595ed44b5bfc83b98a Mon Sep 17 00:00:00 2001 From: ChenZhangg <32891042+ChenZhangg@users.noreply.github.com> Date: Wed, 24 Nov 2021 16:46:17 +0800 Subject: [PATCH 2/2] Update build.gradle --- build.gradle | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index f253daede..04fcd0387 100644 --- a/build.gradle +++ b/build.gradle @@ -20,18 +20,14 @@ plugins { allprojects { tasks.withType(Test).configureEach { - maxParallelForks = 4 - } - - tasks.withType(Test).configureEach { + maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 + if (!project.hasProperty("createReports")) { + reports.html.required = false + reports.junitXml.required = false + } forkEvery = 100 } - tasks.withType(Test).configureEach { - reports.html.required = false - reports.junitXml.required = false - } - repositories { mavenLocal() jcenter()