diff options
author | Krzysztof Pawlik <nelchael@gentoo.org> | 2006-08-06 17:03:26 +0000 |
---|---|---|
committer | Krzysztof Pawlik <nelchael@gentoo.org> | 2006-08-06 17:03:26 +0000 |
commit | 4edb2a5e8002d7d99f906c065777b9c334c129e9 (patch) | |
tree | e75d0c008d8a4e98e4995999e376f253fe92a1f4 /eclass | |
parent | arm/sh stable (diff) | |
download | gentoo-2-4edb2a5e8002d7d99f906c065777b9c334c129e9.tar.gz gentoo-2-4edb2a5e8002d7d99f906c065777b9c334c129e9.tar.bz2 gentoo-2-4edb2a5e8002d7d99f906c065777b9c334c129e9.zip |
New function to rewrite build.xml: adds classpath.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-ant-2.eclass | 28 |
1 files changed, 28 insertions, 0 deletions
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 +} |