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

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

  ViewVC Help
Powered by ViewVC 1.1.20