| … | |
… | |
| 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-2005, Gentoo Foundation |
| 5 | # |
5 | # |
| 6 | # Licensed under the GNU General Public License, v2 |
6 | # Licensed under the GNU General Public License, v2 |
| 7 | # |
7 | # |
| 8 | # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.21 2007/04/07 12:55:52 betelgeuse Exp $ |
8 | # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.22 2007/05/07 22:10:46 caster Exp $ |
| 9 | |
9 | |
| 10 | inherit java-utils-2 |
10 | inherit java-utils-2 |
| 11 | |
11 | |
| 12 | # ----------------------------------------------------------------------------- |
12 | # ----------------------------------------------------------------------------- |
| 13 | # @eclass-begin |
13 | # @eclass-begin |
| … | |
… | |
| 63 | # variables: |
63 | # variables: |
| 64 | # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml) |
64 | # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml) |
| 65 | # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value |
65 | # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value |
| 66 | # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar) |
66 | # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar) |
| 67 | # EANT_DOC_TARGET - the target to build extra docs under the doc use flag |
67 | # EANT_DOC_TARGET - the target to build extra docs under the doc use flag |
| 68 | # (default: the one provided by use_doc in |
68 | # (default: javadoc; declare empty to disable completely) |
| 69 | # java-utils-2.eclass) |
|
|
| 70 | # EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass |
69 | # EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass |
| 71 | # EANT_EXTRA_ARGS - extra arguments to pass to eant |
70 | # EANT_EXTRA_ARGS - extra arguments to pass to eant |
| 72 | # EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment |
71 | # EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment |
| 73 | # param: Parameters are passed to ant verbatim |
72 | # param: Parameters are passed to ant verbatim |
| 74 | # ------------------------------------------------------------------------------ |
73 | # ------------------------------------------------------------------------------ |
| 75 | java-pkg-2_src_compile() { |
74 | java-pkg-2_src_compile() { |
| 76 | if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then |
75 | if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then |
| 77 | [[ "${EANT_FILTER_COMPILER}" ]] && \ |
76 | [[ "${EANT_FILTER_COMPILER}" ]] && \ |
| 78 | java-pkg_filter-compiler ${EANT_FILTER_COMPILER} |
77 | java-pkg_filter-compiler ${EANT_FILTER_COMPILER} |
| 79 | |
|
|
| 80 | local antflags="${EANT_BUILD_TARGET:=jar}" |
78 | local antflags="${EANT_BUILD_TARGET:=jar}" |
|
|
79 | if hasq doc ${IUSE} && [[ -n "${EANT_DOC_TARGET=javadoc}" ]]; then |
| 81 | hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})" |
80 | antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})" |
|
|
81 | fi |
| 82 | local tasks |
82 | local tasks |
| 83 | [[ ${EANT_ANT_TASKS} ]] && tasks="${ANT_TASKS} ${EANT_ANT_TASKS}" |
83 | [[ ${EANT_ANT_TASKS} ]] && tasks="${ANT_TASKS} ${EANT_ANT_TASKS}" |
| 84 | ANT_TASKS="${tasks:-${ANT_TASKS}}" \ |
84 | ANT_TASKS="${tasks:-${ANT_TASKS}}" \ |
| 85 | eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}" |
85 | eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}" |
| 86 | else |
86 | else |