/[gentoo-x86]/eclass/java-pkg-2.eclass
Gentoo

Contents of /eclass/java-pkg-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (hide annotations) (download)
Tue Nov 13 19:36:50 2007 UTC (6 years, 7 months ago) by betelgeuse
Branch: MAIN
Changes since 1.24: +4 -5 lines
Make JAVA_PKG_IUSE work with java-pkg-opt-2 too.

1 nichoj 1.1 # Eclass for Java packages
2     #
3     # Copyright (c) 2004-2005, Thomas Matthijs <axxo@gentoo.org>
4     # Copyright (c) 2004-2005, Gentoo Foundation
5     #
6     # Licensed under the GNU General Public License, v2
7     #
8 betelgeuse 1.25 # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.24 2007/08/05 08:17:05 betelgeuse Exp $
9 nichoj 1.1
10     inherit java-utils-2
11    
12     # -----------------------------------------------------------------------------
13     # @eclass-begin
14     # @eclass-summary Eclass for Java Packages
15     #
16     # This eclass should be inherited for pure Java packages, or by packages which
17     # need to use Java.
18     # -----------------------------------------------------------------------------
19    
20     # ------------------------------------------------------------------------------
21 betelgeuse 1.13 # @IUSE
22     #
23 betelgeuse 1.25 # Use JAVA_PKG_IUSE instead of IUSE for doc, source and examples so that
24     # the eclass can automatically add the needed dependencies for the java-pkg_do*
25     # functions.
26 betelgeuse 1.13 #
27     # ------------------------------------------------------------------------------
28     IUSE="${JAVA_PKG_IUSE}"
29    
30     # ------------------------------------------------------------------------------
31 nichoj 1.1 # @depend
32     #
33     # Java packages need java-config, and a fairly new release of Portage.
34     #
35     # JAVA_PKG_E_DEPEND is defined in java-utils.eclass.
36     # ------------------------------------------------------------------------------
37     DEPEND="${JAVA_PKG_E_DEPEND}"
38    
39     # ------------------------------------------------------------------------------
40     # @rdepend
41     #
42     # Nothing special for RDEPEND... just the same as DEPEND.
43     # ------------------------------------------------------------------------------
44     RDEPEND="${DEPEND}"
45    
46 betelgeuse 1.6 EXPORT_FUNCTIONS pkg_setup src_compile
47 nichoj 1.1
48     # ------------------------------------------------------------------------------
49     # @eclass-pkg_setup
50     #
51     # pkg_setup initializes the Java environment
52     # ------------------------------------------------------------------------------
53     java-pkg-2_pkg_setup() {
54     java-pkg_init
55 betelgeuse 1.5 java-pkg_ensure-test
56 nichoj 1.1 }
57    
58     # ------------------------------------------------------------------------------
59 betelgeuse 1.6 # @eclass-src_compile
60     #
61     # Default src_compile for java packages
62     # variables:
63     # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml)
64 betelgeuse 1.10 # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
65 betelgeuse 1.6 # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
66     # EANT_DOC_TARGET - the target to build extra docs under the doc use flag
67 caster 1.22 # (default: javadoc; declare empty to disable completely)
68 betelgeuse 1.12 # EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass
69 betelgeuse 1.16 # EANT_EXTRA_ARGS - extra arguments to pass to eant
70 betelgeuse 1.17 # EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment
71 betelgeuse 1.15 # param: Parameters are passed to ant verbatim
72 betelgeuse 1.6 # ------------------------------------------------------------------------------
73     java-pkg-2_src_compile() {
74     if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
75 betelgeuse 1.10 [[ "${EANT_FILTER_COMPILER}" ]] && \
76     java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
77 betelgeuse 1.6 local antflags="${EANT_BUILD_TARGET:=jar}"
78 caster 1.22 if hasq doc ${IUSE} && [[ -n "${EANT_DOC_TARGET=javadoc}" ]]; then
79     antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
80     fi
81 betelgeuse 1.20 local tasks
82     [[ ${EANT_ANT_TASKS} ]] && tasks="${ANT_TASKS} ${EANT_ANT_TASKS}"
83 betelgeuse 1.21 ANT_TASKS="${tasks:-${ANT_TASKS}}" \
84 betelgeuse 1.17 eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}"
85 betelgeuse 1.6 else
86 betelgeuse 1.18 echo "${FUNCNAME}: ${EANT_BUILD_XML} not found so nothing to do."
87 betelgeuse 1.6 fi
88     }
89    
90     # ------------------------------------------------------------------------------
91 nichoj 1.1 # @eclass-end
92     # ------------------------------------------------------------------------------

  ViewVC Help
Powered by ViewVC 1.1.20