/[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.54 Revision 1.55
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.54 2012/06/02 19:16:31 zmedico Exp $ 17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.55 2012/09/14 05:04:50 ferringb Exp $
18 18
19inherit java-utils-2 multilib 19inherit java-utils-2 multilib
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
262 fi 262 fi
263 263
264 files="${files} -f '${file}'" 264 files="${files} -f '${file}'"
265 done 265 done
266 266
267 # Play nice with paludis
268 if [[ $(type -t quiet_mode) = function ]] && quiet_mode; then
269 local output=">/dev/null"
270 fi
271
272 # for javadoc target and all in one pass, we need the new rewriter. 267 # for javadoc target and all in one pass, we need the new rewriter.
273 local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py" 268 local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py"
274 if [[ ! -f ${rewriter3} ]]; then 269 if [[ ! -f ${rewriter3} ]]; then
275 rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py" 270 rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
276 fi 271 fi
278 local rewriter4="/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite" 273 local rewriter4="/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
279 274
280 if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then 275 if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then
281 [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g" 276 [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g"
282 [[ ${JAVA_ANT_ENCODING} ]] && local enc="-e ${JAVA_ANT_ENCODING}" 277 [[ ${JAVA_ANT_ENCODING} ]] && local enc="-e ${JAVA_ANT_ENCODING}"
283 eval echo "cElementTree rewriter" ${output} 278 eval echo "cElementTree rewriter"
284 debug-print "${rewriter4} extra args: ${gcp} ${enc}" 279 debug-print "${rewriter4} extra args: ${gcp} ${enc}"
285 ${rewriter4} ${gcp} ${enc} \ 280 ${rewriter4} ${gcp} ${enc} \
286 -c "${JAVA_PKG_BSFIX_SOURCE_TAGS}" source ${want_source} \ 281 -c "${JAVA_PKG_BSFIX_SOURCE_TAGS}" source ${want_source} \
287 -c "${JAVA_PKG_BSFIX_TARGET_TAGS}" target ${want_target} \ 282 -c "${JAVA_PKG_BSFIX_TARGET_TAGS}" target ${want_target} \
288 "${@}" || die "build-xml-rewrite failed" 283 "${@}" || die "build-xml-rewrite failed"
289 elif [[ ! -f ${rewriter3} ]]; then 284 elif [[ ! -f ${rewriter3} ]]; then
290 debug-print "Using second generation rewriter" 285 debug-print "Using second generation rewriter"
291 eval echo "Rewriting source attributes" ${output} 286 eval echo "Rewriting source attributes"
292 eval xml-rewrite-2.py ${files} \ 287 eval xml-rewrite-2.py ${files} \
293 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \ 288 -c -e ${JAVA_PKG_BSFIX_SOURCE_TAGS// / -e } \
294 -a source -v ${want_source} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 289 -a source -v ${want_source} || _bsfix_die "xml-rewrite2 failed: ${file}"
295 290
296 eval echo "Rewriting target attributes" ${output} 291 eval echo "Rewriting target attributes"
297 eval xml-rewrite-2.py ${files} \ 292 eval xml-rewrite-2.py ${files} \
298 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \ 293 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
299 -a target -v ${want_target} ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 294 -a target -v ${want_target} || _bsfix_die "xml-rewrite2 failed: ${file}"
300 295
301 eval echo "Rewriting nowarn attributes" ${output} 296 eval echo "Rewriting nowarn attributes"
302 eval xml-rewrite-2.py ${files} \ 297 eval xml-rewrite-2.py ${files} \
303 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \ 298 -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
304 -a nowarn -v yes ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 299 -a nowarn -v yes || _bsfix_die "xml-rewrite2 failed: ${file}"
305 300
306 if [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then 301 if [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then
307 eval echo "Adding gentoo.classpath to javac tasks" ${output} 302 eval echo "Adding gentoo.classpath to javac tasks"
308 eval xml-rewrite-2.py ${files} \ 303 eval xml-rewrite-2.py ${files} \
309 -c -e javac -e xjavac -a classpath -v \ 304 -c -e javac -e xjavac -a classpath -v \
310 '\${gentoo.classpath}' \ 305 '\${gentoo.classpath}' \
311 || _bsfix_die "xml-rewrite2 failed" 306 || _bsfix_die "xml-rewrite2 failed"
312 fi 307 fi
313 else 308 else
314 debug-print "Using third generation rewriter" 309 debug-print "Using third generation rewriter"
315 eval echo "Rewriting attributes" ${output} 310 eval echo "Rewriting attributes"
316 local bsfix_extra_args="" 311 local bsfix_extra_args=""
317 # WARNING KEEP THE ORDER, ESPECIALLY FOR CHANGED ATTRIBUTES! 312 # WARNING KEEP THE ORDER, ESPECIALLY FOR CHANGED ATTRIBUTES!
318 if [[ -n ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then 313 if [[ -n ${JAVA_ANT_REWRITE_CLASSPATH} ]]; then
319 local cp_tags="${JAVA_ANT_CLASSPATH_TAGS// / -e }" 314 local cp_tags="${JAVA_ANT_CLASSPATH_TAGS// / -e }"
320 bsfix_extra_args="${bsfix_extra_args} -g -e ${cp_tags}" 315 bsfix_extra_args="${bsfix_extra_args} -g -e ${cp_tags}"
364 --source-attribute source --source-value ${want_source} \ 359 --source-attribute source --source-value ${want_source} \
365 --target-element ${JAVA_PKG_BSFIX_TARGET_TAGS// / --target-element } \ 360 --target-element ${JAVA_PKG_BSFIX_TARGET_TAGS// / --target-element } \
366 --target-attribute target --target-value ${want_target} \ 361 --target-attribute target --target-value ${want_target} \
367 --target-attribute nowarn --target-value yes \ 362 --target-attribute nowarn --target-value yes \
368 ${bsfix_extra_args} \ 363 ${bsfix_extra_args} \
369 ${output} || _bsfix_die "xml-rewrite2 failed: ${file}" 364 || _bsfix_die "xml-rewrite2 failed: ${file}"
370 fi 365 fi
371 366
372 if [[ -n "${JAVA_PKG_DEBUG}" ]]; then 367 if [[ -n "${JAVA_PKG_DEBUG}" ]]; then
373 for file in "${@}"; do 368 for file in "${@}"; do
374 diff -NurbB "${file}.orig" "${file}" 369 diff -NurbB "${file}.orig" "${file}"

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

  ViewVC Help
Powered by ViewVC 1.1.20