/[gentoo-x86]/eclass/java-ant-2.eclass
Gentoo

Diff of /eclass/java-ant-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.35 Revision 1.36
12# and xml-rewrite.py because they were so slow 12# and xml-rewrite.py because they were so slow
13# Petteri Räty (betelgeuse@gentoo.org) 13# Petteri Räty (betelgeuse@gentoo.org)
14# 14#
15# Licensed under the GNU General Public License, v2 15# Licensed under the GNU General Public License, v2
16# 16#
17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.35 2008/06/20 10:32:15 ali_bush Exp $ 17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.36 2008/07/01 19:02:21 betelgeuse Exp $
18 18
19inherit java-utils-2 19inherit java-utils-2
20 20
21# This eclass provides functionality for Java packages which use 21# This eclass provides functionality for Java packages which use
22# ant to build. In particular, it will attempt to fix build.xml files, so that 22# ant to build. In particular, it will attempt to fix build.xml files, so that
238 local output=">/dev/null" 238 local output=">/dev/null"
239 fi 239 fi
240 240
241 # for javadoc target and all in one pass, we need the new rewriter. 241 # for javadoc target and all in one pass, we need the new rewriter.
242 local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py" 242 local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py"
243
244 if [[ ! -f ${rewriter3} ]]; then 243 if [[ ! -f ${rewriter3} ]]; then
245 rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py" 244 rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
246 fi 245 fi
247 246
247 local rewriter4="/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
248
249 if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then
250 [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g"
251 [[ ${JAVA_ANT_ENCODING} ]] && local enc="-e ${JAVA_ANT_ENCODING}"
252 eval echo "cElementTree rewriter" ${output}
253 debug-print "${rewriter4} extra args: ${gcp} ${enc}"
254 ${rewriter4} ${gcp} ${enc} \
255 -c "${JAVA_PKG_BSFIX_SOURCE_TAGS}" source ${want_source} \
256 -c "${JAVA_PKG_BSFIX_TARGET_TAGS}" target ${want_target} \
257 "${@}" || die "build-xml-rewrite failed"
248 if [[ ! -f ${rewriter3} ]]; then 258 elif [[ ! -f ${rewriter3} ]]; then
249 debug-print "Using second generation rewriter" 259 debug-print "Using second generation rewriter"
250 eval echo "Rewriting source attributes" ${output} 260 eval echo "Rewriting source attributes" ${output}
251 eval xml-rewrite-2.py ${files} \ 261 eval xml-rewrite-2.py ${files} \
252 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \ 262 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \
253 -a source -v ${want_source} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 263 -a source -v ${want_source} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}"
390# Makes the available task ignore classes in the system classpath 400# Makes the available task ignore classes in the system classpath
391# @param $1 - the file to rewrite (defaults to build.xml) 401# @param $1 - the file to rewrite (defaults to build.xml)
392# ------------------------------------------------------------------------------ 402# ------------------------------------------------------------------------------
393java-ant_ignore-system-classes() { 403java-ant_ignore-system-classes() {
394 debug-print-function ${FUNCNAME} $* 404 debug-print-function ${FUNCNAME} $*
395 local file="${1}" 405 local file=${1:-build.xml}
396 [[ -z "${1}" ]] && file=build.xml
397 echo "Changing ignoresystemclasses to true for available tasks" 406 echo "Changing ignoresystemclasses to true for available tasks in ${file}"
398 java-ant_xml-rewrite -f "${file}" --change \ 407 java-ant_xml-rewrite -f "${file}" --change \
399 -e available -a ignoresystemclasses -v "true" 408 -e available -a ignoresystemclasses -v "true"
400} 409}
401 410
402# ------------------------------------------------------------------------------ 411# ------------------------------------------------------------------------------

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20