/[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 - (hide annotations) (download)
Wed Jan 10 09:59:21 2007 UTC (8 years, 2 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 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.10 # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.9 2007/01/10 09:52:51 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     # @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 betelgeuse 1.6 EXPORT_FUNCTIONS pkg_setup src_compile
37 nichoj 1.1
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 betelgeuse 1.5 java-pkg_ensure-test
46 nichoj 1.1 }
47    
48     # ------------------------------------------------------------------------------
49 betelgeuse 1.6 # @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 betelgeuse 1.10 # EANT_FILTER_COMPILER - Calls java-pkg_filter-compiler with the value
55 betelgeuse 1.6 # 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 betelgeuse 1.10 [[ "${EANT_FILTER_COMPILER}" ]] && \
63     java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
64    
65 betelgeuse 1.6 local antflags="${EANT_BUILD_TARGET:=jar}"
66     hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
67 betelgeuse 1.7 eant ${antflags} -f "${EANT_BUILD_XML}"
68 betelgeuse 1.6 else
69 betelgeuse 1.8 echo "${FUNCNAME}: No build.xml found so nothing to do."
70 betelgeuse 1.6 fi
71     }
72    
73     # ------------------------------------------------------------------------------
74 swegener 1.3 # @note
75 nichoj 1.1 #
76 swegener 1.3 # We need to initialize the environment in every function because Portage
77 nichoj 1.1 # 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 caster 1.2 pre_pkg_setup() {
83 nichoj 1.1 java-pkg-2_pkg_setup
84     }
85    
86     pre_src_unpack() {
87     java-pkg-2_pkg_setup
88     }
89    
90     pre_src_compile() {
91 betelgeuse 1.9 if is-java-strict; then
92     echo "Searching for bundled jars:"
93     java-pkg_find-normal-jars || echo "None found."
94     fi
95 nichoj 1.1 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