/[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.45 Revision 1.46
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.45 2009/02/15 01:24:59 betelgeuse Exp $ 17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.46 2009/11/08 20:39:30 caster 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
449 eerror "No binary for rewriting found." 449 eerror "No binary for rewriting found."
450 eerror "Do you have dev-java/javatoolkit installed?" 450 eerror "Do you have dev-java/javatoolkit installed?"
451 die "xml-rewrite not found" 451 die "xml-rewrite not found"
452 fi 452 fi
453} 453}
454
455# ------------------------------------------------------------------------------
456# @public java-ant_rewrite-bootclasspath
457#
458# Adds bootclasspath to javac-like tasks in build.xml filled with jars of a
459# bootclasspath package of given version.
460#
461# Affected by:
462# JAVA_PKG_BSFIX_TARGET_TAGS - the tags of javac tasks
463#
464# @param $1 - the version of bootclasspath (e.g. 1.5), 'auto' for bootclasspath
465# of the current JDK
466# @param $2 - path to desired build.xml file, defaults to 'build.xml'
467# @param $3 - (optional) what to prepend the bootclasspath with (to override)
468# @param $4 - (optional) what to append to the bootclasspath
469# ------------------------------------------------------------------------------
470
471java-ant_rewrite-bootclasspath() {
472 local version="${1}"
473 local file="${2-build.xml}"
474 local extra_before="${3}"
475 local extra_after="${4}"
476
477 local bcp
478 case "${version}" in
479 auto)
480 bcp="$(java-config -g BOOTCLASSPATH)"
481 ;;
482 1.5)
483 bcp="$(java-pkg_getjars --build-only gnu-classpath-0.98)"
484 ;;
485 *)
486 eerror "unknown parameter of java-ant_rewrite-bootclasspath"
487 die "unknown parameter of java-ant_rewrite-bootclasspath"
488 ;;
489 esac
490 if [[ -n "${extra_before}" ]]; then
491 bcp="${extra_before}:${bcp}"
492 fi
493 if [[ -n "${extra_after}" ]]; then
494 bcp="${bcp}:${extra_after}"
495 fi
496
497 java-ant_xml-rewrite -f "${file}" -c -e ${JAVA_PKG_BSFIX_TARGET_TAGS// / -e } \
498 -a bootclasspath -v "${bcp}"
499}

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.20