From 8ed9c38f10105c461623e7bf0772fd02a2239544 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Petteri=20R=C3=A4ty?= Date: Tue, 13 Feb 2007 19:52:51 +0000 Subject: [PATCH] * Automatically add Junit.present=true to ant properties when in the test phase * Allow multiple atoms in EANT_GENTOO_CLASSPATH * Automatically add junit to gentoo.classpath when EANT_GENTOO_CLASSPATH is defined, ant-junit is in ANT_TASKS and we are in the test phase. --- eclass/java-utils-2.eclass | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index e089580ddc85..1eb1c488c3cb 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -6,7 +6,7 @@ # # Licensed under the GNU General Public License, v2 # -# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.56 2007/01/30 14:12:34 caster Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.57 2007/02/13 19:52:51 betelgeuse Exp $ # ----------------------------------------------------------------------------- @@ -405,7 +405,8 @@ java-pkg_doso() { # otherwise make a symlink to the symlink's origin else # TODO use dosym - ln -s "$(readlink "${lib}")" "${D}${JAVA_PKG_LIBDEST}/$(basename "${lib}")" + ln -s "$(readlink "${lib}")" \ + "${D}${JAVA_PKG_LIBDEST}/$(basename "${lib}")" debug-print "${lib} is a symlink, linking accordanly" fi # otherwise die @@ -1556,6 +1557,7 @@ eant() { fi local antflags="-Dnoget=true -Dmaven.mode.offline=true" + java-pkg_init-compiler_ local compiler="${GENTOO_COMPILER}" @@ -1633,10 +1635,20 @@ eant() { local gcp="${EANT_GENTOO_CLASSPATH}" - if [[ "${gcp}" ]]; then - local cp="$(java-pkg_getjars ${gcp})" + if [[ ${EBUILD_PHASE} = "test" ]]; then + antflags="${antflags} -DJunit.present=true" + [[ ${gcp} && ${ANT_TASKS} = *ant-junit* ]] && gcp="${gcp} junit" + fi + + local cp + + for atom in ${gcp}; do + cp="${cp}:$(java-pkg_getjars ${atom})" + done + + if [[ ${cp} ]]; then # It seems ant does not like single quotes around ${cp} - antflags="${antflags} -Dgentoo.classpath=\"${cp}\"" + antflags="${antflags} -Dgentoo.classpath=\"${cp#:}\"" fi [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}" -- 2.26.2