From 6f4bc204be50d43554c337cdb9bf5649af354cb7 Mon Sep 17 00:00:00 2001 From: Chen Zhang <340355960@qq.com> Date: Mon, 18 Oct 2021 16:34:01 +0800 Subject: [PATCH 1/2] Improve GRADLE build Performance --- build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/build.gradle b/build.gradle index aa0f2da..f0b3a1e 100644 --- a/build.gradle +++ b/build.gradle @@ -30,3 +30,19 @@ def gitDescribe() { def static gitVersion() { '0.10.1' } + +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 + } + +} From 7af11d60ef0441a3630d4a1f690e6263317387b1 Mon Sep 17 00:00:00 2001 From: ChenZhangg <32891042+ChenZhangg@users.noreply.github.com> Date: Wed, 24 Nov 2021 18:55:15 +0800 Subject: [PATCH 2/2] Update build.gradle --- build.gradle | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index f0b3a1e..2aac6b5 100644 --- a/build.gradle +++ b/build.gradle @@ -33,16 +33,11 @@ def static gitVersion() { 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 - } - }