commit:     f1fce6210d9d4104738e3fa35214b477486be534
Author:     Volkmar W. Pogatzki <gentoo <AT> pogatzki <DOT> net>
AuthorDate: Wed Jun  5 16:20:04 2024 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Fri Jun 28 08:23:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1fce621

java-utils-2.eclass: allow eant without java-ant-2_src_configure

Packages which can build without BSFIX need not inherit java-ant-2.  To
allow using eant without inheriting java-ant-2 we enhance the eant function
with a condition which controls calling java-ant-2_src_configure.

Signed-off-by: Volkmar W. Pogatzki <gentoo <AT> pogatzki.net>
Closes: 
https://github.com/gentoo/gentoo/pull/37022/commits/6ebf29fc691b6e38c8bf263eec2313d611298d25
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 eclass/java-utils-2.eclass | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 3c2d190c4c15..91f8fba8790b 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -2033,13 +2033,23 @@ java-utils-2_pkg_preinst() {
 eant() {
        debug-print-function ${FUNCNAME} $*
 
-       if [[ ${EBUILD_PHASE} = compile ]]; then
-               java-ant-2_src_configure
-       fi
+       if [[ ${!JAVA_PKG_BSFIX*} ]] \
+               || [[ ${JAVA_ANT_BSFIX_EXTRA_ARGS} ]] \
+               || [[ ${JAVA_ANT_CLASSPATH_TAGS} ]] \
+               || [[ ${JAVA_ANT_JAVADOC_INPUT_DIRS} ]] \
+               || [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] \
+               || [[ ${EANT_BUILD_XML} ]] \
+               || [[ ${!EANT_GENTOO_CLASSPATH*} ]] \
+               || [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]
+       then
+               if [[ ${EBUILD_PHASE} = compile ]]; then
+                       java-ant-2_src_configure
+               fi
 
-       if ! has java-ant-2 ${INHERITED}; then
-               local msg="You should inherit java-ant-2 when using eant"
-               java-pkg_announce-qa-violation "${msg}"
+               if ! has java-ant-2 ${INHERITED}; then
+                       local msg="You should inherit java-ant-2 when using 
eant"
+                       java-pkg_announce-qa-violation "${msg}"
+               fi
        fi
 
        local antflags="-Dnoget=true -Dmaven.mode.offline=true 
-Dbuild.sysclasspath=ignore"

Reply via email to