summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetteri Räty <betelgeuse@gentoo.org>2007-02-13 19:52:51 +0000
committerPetteri Räty <betelgeuse@gentoo.org>2007-02-13 19:52:51 +0000
commitc884e1dca33c4f97e7e152554deabbc5cfe27f11 (patch)
tree798a6929fc1400e175f3fd2239cfd653678791a2 /eclass/java-utils-2.eclass
parentFix one broken ChangeLog entry and remove redundant src_compile. (diff)
downloadgentoo-2-c884e1dca33c4f97e7e152554deabbc5cfe27f11.tar.gz
gentoo-2-c884e1dca33c4f97e7e152554deabbc5cfe27f11.tar.bz2
gentoo-2-c884e1dca33c4f97e7e152554deabbc5cfe27f11.zip
* 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.
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass22
1 files 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} "${@}"