/[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.52 Revision 1.53
1# eclass for ant based Java packages 1# eclass for ant based Java packages
2# 2#
3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org> 3# Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org>
4# Copyright (c) 2004-2005, Gentoo Foundation 4# Copyright (c) 2004-2011, Gentoo Foundation
5# Changes: 5# Changes:
6# May 2007: 6# May 2007:
7# Made bsfix make one pass for all things and add some glocal targets for 7# Made bsfix make one pass for all things and add some glocal targets for
8# setting up the whole thing. Contributed by kiorky 8# setting up the whole thing. Contributed by kiorky
9# (kiorky@cryptelium.net). 9# (kiorky@cryptelium.net).
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.52 2011/10/21 11:05:01 caster Exp $ 17# $Header: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v 1.53 2011/12/27 17:55:12 fauli 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
53 53
54# We need some tools from javatoolkit. We also need portage 2.1 for phase hooks 54# We need some tools from javatoolkit. We also need portage 2.1 for phase hooks
55# and ant dependencies constructed above. Python is there for 55# and ant dependencies constructed above. Python is there for
56# java-ant_remove-taskdefs 56# java-ant_remove-taskdefs
57JAVA_ANT_E_DEPEND="${JAVA_ANT_E_DEPEND} 57JAVA_ANT_E_DEPEND="${JAVA_ANT_E_DEPEND}
58 ${ANT_TASKS_DEPEND} 58 ${ANT_TASKS_DEPEND}
59 ${JAVA_PKG_PORTAGE_DEP} 59 ${JAVA_PKG_PORTAGE_DEP}
60 >=dev-java/javatoolkit-0.3.0-r2 60 >=dev-java/javatoolkit-0.3.0-r2
61 >=dev-lang/python-2.4" 61 >=dev-lang/python-2.4"
62 62
63# this eclass must be inherited after java-pkg-2 or java-pkg-opt-2 63# this eclass must be inherited after java-pkg-2 or java-pkg-opt-2
64# if it's java-pkg-opt-2, ant dependencies are pulled based on USE flag 64# if it's java-pkg-opt-2, ant dependencies are pulled based on USE flag
65if has java-pkg-opt-2 ${INHERITED}; then 65if has java-pkg-opt-2 ${INHERITED}; then
66 JAVA_ANT_E_DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_ANT_E_DEPEND} )" 66 JAVA_ANT_E_DEPEND="${JAVA_PKG_OPT_USE}? ( ${JAVA_ANT_E_DEPEND} )"
448 python <<EOF 448 python <<EOF
449import sys 449import sys
450from xml.dom.minidom import parse 450from xml.dom.minidom import parse
451dom = parse("${file}") 451dom = parse("${file}")
452for elem in dom.getElementsByTagName('taskdef'): 452for elem in dom.getElementsByTagName('taskdef'):
453 if (len("${task_name}") == 0 or elem.getAttribute("name") == "${task_name}"): 453 if (len("${task_name}") == 0 or elem.getAttribute("name") == "${task_name}"):
454 elem.parentNode.removeChild(elem) 454 elem.parentNode.removeChild(elem)
455 elem.unlink() 455 elem.unlink()
456f = open("${file}", "w") 456f = open("${file}", "w")
457dom.writexml(f) 457dom.writexml(f)
458f.close() 458f.close()
459EOF 459EOF
460 [[ $? != 0 ]] && die "Removing taskdefs failed" 460 [[ $? != 0 ]] && die "Removing taskdefs failed"

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

  ViewVC Help
Powered by ViewVC 1.1.20