aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2023-01-06 15:48:32 +0100
committerFlorian Schmaus <flow@gentoo.org>2023-01-06 15:48:32 +0100
commit5f9b10dea4332283361b38bccb8f7b7ed186fa9e (patch)
treec3823f7f71222ff8ee1ee77d4bc8f4cf22b47613
parentdev-util/ghidra: import from ::pentoo, modified to use gradle.eclass (diff)
downloadjava-5f9b10dea4332283361b38bccb8f7b7ed186fa9e.tar.gz
java-5f9b10dea4332283361b38bccb8f7b7ed186fa9e.tar.bz2
java-5f9b10dea4332283361b38bccb8f7b7ed186fa9e.zip
gradle.eclass: update
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rw-r--r--eclass/gradle.eclass24
1 files changed, 23 insertions, 1 deletions
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 \