commit:     5f9b10dea4332283361b38bccb8f7b7ed186fa9e
Author:     Florian Schmaus <flow <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  6 14:48:32 2023 +0000
Commit:     Florian Schmaus <flow <AT> gentoo <DOT> org>
CommitDate: Fri Jan  6 14:48:32 2023 +0000
URL:        https://gitweb.gentoo.org/proj/java.git/commit/?id=5f9b10de

gradle.eclass: update

Signed-off-by: Florian Schmaus <flow <AT> gentoo.org>

 eclass/gradle.eclass | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/eclass/gradle.eclass b/eclass/gradle.eclass
index 09eda636..90e21905 100644
--- a/eclass/gradle.eclass
+++ b/eclass/gradle.eclass
@@ -32,6 +32,17 @@ inherit edo
 # @DESCRIPTION:
 # First gradle version that is not supported.
 
+# @ECLASS_VARIABLE: EGRADLE_EXACT_VER
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# The exactly required gradle version.
+
+# @ECLASS_VARIABLE: EGRADLE_PARALLEL
+# @DESCRIPTION:
+# Set to the 'true', the default, to invoke gradle with --parallel. Set
+# to 'false' to disable parallel gradle builds.
+: ${EGRADLE_PARALLEL=true}
+
 # @ECLASS_VARIABLE: EGRADLE_USER_HOME
 # @DESCRIPTION:
 # Directroy used the user's home directory by gradle.
@@ -69,6 +80,14 @@ gradle-set_EGRADLE() {
                        ver="${BASH_REMATCH[1]}"
                fi
 
+               if [[ -n ${EGRADLE_EXACT_VER} ]]; then
+                       ver_test "${ver}" -ne ${EGRADLE_EXACT_VER} && continue
+
+                       selected="${candidate}"
+                       selected_ver="${ver}"
+                       break
+               fi
+
                if [[ -n ${EGRADLE_MIN} ]] \
                           && ver_test "${ver}" -lt "${EGRADLE_MIN}"; then
                        # Candidate does not satisfy EGRADLE_MIN condition.
@@ -113,12 +132,15 @@ egradle() {
                --stacktrace
                --no-daemon
                --offline
-               --parallel
                --no-build-cache
                --gradle-user-home "${EGRADLE_USER_HOME}"
                --project-cache-dir "${T}/gradle_project_cache"
        )
 
+       if $EGRADLE_PARALLEL; then
+               gradle_args+=( --parallel )
+       fi
+
        local -x JAVA_TOOL_OPTIONS="-Duser.home=\"$T\""
        # TERM needed, otherwise gradle may fail on terms it does not know about
        TERM=xterm \

Reply via email to