/[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.10 - (show annotations) (download)
Wed Jan 10 09:59:21 2007 UTC (7 years, 7 months ago) by betelgeuse
Branch: MAIN
Changes since 1.9: +5 -1 lines
Added EANT_FILTER_COMPILER to the default src_compile control variables.

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 # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.9 2007/01/10 09:52:51 betelgeuse Exp $
9
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 # @depend
22 #
23 # Java packages need java-config, and a fairly new release of Portage.
24 #
25 # JAVA_PKG_E_DEPEND is defined in java-utils.eclass.
26 # ------------------------------------------------------------------------------
27 DEPEND="${JAVA_PKG_E_DEPEND}"
28
29 # ------------------------------------------------------------------------------
30 # @rdepend
31 #
32 # Nothing special for RDEPEND... just the same as DEPEND.
33 # ------------------------------------------------------------------------------
34 RDEPEND="${DEPEND}"
35
36 EXPORT_FUNCTIONS pkg_setup src_compile
37
38 # ------------------------------------------------------------------------------
39 # @eclass-pkg_setup
40 #
41 # pkg_setup initializes the Java environment
42 # ------------------------------------------------------------------------------
43 java-pkg-2_pkg_setup() {
44 java-pkg_init
45 java-pkg_ensure-test
46 }
47
48 # ------------------------------------------------------------------------------
49 # @eclass-src_compile
50 #
51 # Default src_compile for java packages
52 # variables:
53 # EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml)
54 # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
55 # EANT_BUILD_TARGET - the ant target/targets to execute (default: jar)
56 # EANT_DOC_TARGET - the target to build extra docs under the doc use flag
57 # (default: the one provided by use_doc in
58 # java-utils-2.eclass)
59 # ------------------------------------------------------------------------------
60 java-pkg-2_src_compile() {
61 if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
62 [[ "${EANT_FILTER_COMPILER}" ]] && \
63 java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
64
65 local antflags="${EANT_BUILD_TARGET:=jar}"
66 hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
67 eant ${antflags} -f "${EANT_BUILD_XML}"
68 else
69 echo "${FUNCNAME}: No build.xml found so nothing to do."
70 fi
71 }
72
73 # ------------------------------------------------------------------------------
74 # @note
75 #
76 # We need to initialize the environment in every function because Portage
77 # will source /etc/profile between phases and trample all over the env.
78 # This is accomplished by phase hooks, which is available with newer versions of
79 # portage.
80 # ------------------------------------------------------------------------------
81
82 pre_pkg_setup() {
83 java-pkg-2_pkg_setup
84 }
85
86 pre_src_unpack() {
87 java-pkg-2_pkg_setup
88 }
89
90 pre_src_compile() {
91 if is-java-strict; then
92 echo "Searching for bundled jars:"
93 java-pkg_find-normal-jars || echo "None found."
94 fi
95 java-pkg-2_pkg_setup
96 }
97
98 pre_src_install() {
99 java-pkg-2_pkg_setup
100 }
101
102 pre_src_test() {
103 java-pkg-2_pkg_setup
104 }
105
106 pre_pkg_preinst() {
107 java-pkg-2_pkg_setup
108 }
109
110 pre_pkg_postinst() {
111 java-pkg-2_pkg_setup
112 }
113
114 # ------------------------------------------------------------------------------
115 # @eclass-end
116 # ------------------------------------------------------------------------------

  ViewVC Help
Powered by ViewVC 1.1.20