From: Krzysztof Pawlik Date: Sun, 6 Aug 2006 17:03:26 +0000 (+0000) Subject: New function to rewrite build.xml: adds classpath. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=82a1c0b86a7c6c940d46b1ca6f83bf5cc4e28ca9;p=gentoo.git New function to rewrite build.xml: adds classpath. --- diff --git a/eclass/java-ant-2.eclass b/eclass/java-ant-2.eclass index 2751e9173bc7..001f0bda442d 100644 --- a/eclass/java-ant-2.eclass +++ b/eclass/java-ant-2.eclass @@ -171,3 +171,31 @@ java-ant_bsfix_one() { fi fi } + +# ------------------------------------------------------------------------------ +# @public java-ant_rewrite-classpath +# +# Adds 'classpath="${gentoo.classpath}"' to specified build file. +# ------------------------------------------------------------------------------ +java-ant_rewrite-classpath() { + debug-print-function ${FUNCNAME} $* + + if [ -z "${1}" ]; then + eerror "java-ant_rewrite-classpath needs one argument" + die "java-ant_rewrite-classpath needs one argument" + fi + + local file="${1}" + echo "Adding gentoo.classpath to ${file}" + debug-print "java-ant_rewrite-classpath: ${file}" + + cp "${file}" "${file}.orig" || die "failed to copy ${file}" + + chmod u+w "${file}" + + xml-rewrite.py -f "${file}" --change -e javac -e xjavac -a classpath -v '${gentoo.classpath}' || die "xml-rewrite failed: ${file}" + + if [[ -n "${JAVA_PKG_DEBUG}" ]]; then + diff -NurbB "${file}.orig" "${file}" + fi +}