/[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.30 Revision 1.31
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.30 2008/03/05 19:30:29 betelgeuse Exp $ 17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.31 2008/04/15 05:23:24 ali_bush 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 # xml-rewrite will be moving.
244 if [[ ! -f ${rewriter3} ]]; then
245 rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
246 fi
247
243 if [[ ! -f ${rewriter3} ]]; then 248 if [[ ! -f ${rewriter3} ]]; then
244 debug-print "Using second generation rewriter" 249 debug-print "Using second generation rewriter"
245 eval echo "Rewriting source attributes" ${output} 250 eval echo "Rewriting source attributes" ${output}
246 eval xml-rewrite-2.py ${files} \ 251 java-ant_xml-rewrite ${files} \
247 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \ 252 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \
248 -a source -v ${want_source} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 253 -a source -v ${want_source} ${output}
249 254
250 eval echo "Rewriting target attributes" ${output} 255 eval echo "Rewriting target attributes" ${output}
251 eval xml-rewrite-2.py ${files} \ 256 java-ant_xml-rewrite ${files} \
252 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \ 257 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
253 -a target -v ${want_target} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 258 -a target -v ${want_target} ${output}
254 259
255 eval echo "Rewriting nowarn attributes" ${output} 260 eval echo "Rewriting nowarn attributes" ${output}
256 eval xml-rewrite-2.py ${files} \ 261 java-ant_xml-rewrite ${files} \
257 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \ 262 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
258 -a nowarn -v yes ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 263 -a nowarn -v yes ${output}
259 264
260 if [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then 265 if [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then
261 eval echo "Adding gentoo.classpath to javac tasks" ${output} 266 eval echo "Adding gentoo.classpath to javac tasks" ${output}
262 eval xml-rewrite-2.py ${files} \ 267 java-ant_xml-rewrite ${files} \
263 -c -e javac -e xjavac -a classpath -v \ 268 -c -e javac -e xjavac -a classpath -v \
264 '\${gentoo.classpath}' \ 269 '\${gentoo.classpath}'
265 || _bsfix_die "xml-rewrite2 failed"
266 fi 270 fi
267 else 271 else
268 debug-print "Using third generation rewriter" 272 debug-print "Using third generation rewriter"
269 eval echo "Rewriting attributes" ${output} 273 eval echo "Rewriting attributes" ${output}
270 local bsfix_extra_args="" 274 local bsfix_extra_args=""
397# ------------------------------------------------------------------------------ 401# ------------------------------------------------------------------------------
398# @public java-ant_xml-rewrite 402# @public java-ant_xml-rewrite
399# Run the right xml-rewrite binary with the given arguments 403# Run the right xml-rewrite binary with the given arguments
400# ------------------------------------------------------------------------------ 404# ------------------------------------------------------------------------------
401java-ant_xml-rewrite() { 405java-ant_xml-rewrite() {
406 # gen1 is deprecated
402 local gen2="/usr/bin/xml-rewrite-2.py" 407 local gen2="/usr/bin/xml-rewrite-2.py"
403 # gen1 is deprecated 408 #gen2 xml-rewrite will be moving.
409 if [[ ! -x "${gen2}" ]]; then
410 gen2="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-2.py"
411 fi
404 if [[ -x "${gen2}" ]]; then 412 if [[ -x "${gen2}" ]]; then
405 ${gen2} "${@}" || die "${gen2} failed" 413 ${gen2} "${@}" || _bsfix_die "xml-rewrite2 failed : ${@}"
406 else 414 else
407 eerror "No binary for rewriting found." 415 eerror "No binary for rewriting found."
408 eerror "Do you have dev-java/javatoolkit installed?" 416 eerror "Do you have dev-java/javatoolkit installed?"
409 die "xml-rewrite not found" 417 die "xml-rewrite not found"
410 fi 418 fi

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

  ViewVC Help
Powered by ViewVC 1.1.20