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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.18
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.4 2006/12/03 13:05:06 betelgeuse Exp $ 8# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.18 2007/01/28 19:53:17 betelgeuse Exp $
9 9
10inherit java-utils-2 10inherit java-utils-2
11 11
12# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
13# @eclass-begin 13# @eclass-begin
16# This eclass should be inherited for pure Java packages, or by packages which 16# This eclass should be inherited for pure Java packages, or by packages which
17# need to use Java. 17# need to use Java.
18# ----------------------------------------------------------------------------- 18# -----------------------------------------------------------------------------
19 19
20# ------------------------------------------------------------------------------ 20# ------------------------------------------------------------------------------
21# @IUSE
22#
23# ebuilds using this eclass can set JAVA_PKG_IUSE and then this eclass
24# will automatically add deps for them.
25#
26# ------------------------------------------------------------------------------
27IUSE="${JAVA_PKG_IUSE}"
28
29# ------------------------------------------------------------------------------
21# @depend 30# @depend
22# 31#
23# Java packages need java-config, and a fairly new release of Portage. 32# Java packages need java-config, and a fairly new release of Portage.
24# 33#
25# JAVA_PKG_E_DEPEND is defined in java-utils.eclass. 34# JAVA_PKG_E_DEPEND is defined in java-utils.eclass.
26# ------------------------------------------------------------------------------ 35# ------------------------------------------------------------------------------
27DEPEND="${JAVA_PKG_E_DEPEND}" 36DEPEND="${JAVA_PKG_E_DEPEND}"
28 37
38hasq source ${JAVA_PKG_IUSE} && DEPEND="${DEPEND} source? ( app-arch/zip )"
39
29# ------------------------------------------------------------------------------ 40# ------------------------------------------------------------------------------
30# @rdepend 41# @rdepend
31# 42#
32# Nothing special for RDEPEND... just the same as DEPEND. 43# Nothing special for RDEPEND... just the same as DEPEND.
33# ------------------------------------------------------------------------------ 44# ------------------------------------------------------------------------------
34RDEPEND="${DEPEND}" 45RDEPEND="${DEPEND}"
35 46
36EXPORT_FUNCTIONS pkg_setup 47EXPORT_FUNCTIONS pkg_setup src_compile
37 48
38# ------------------------------------------------------------------------------ 49# ------------------------------------------------------------------------------
39# @eclass-pkg_setup 50# @eclass-pkg_setup
40# 51#
41# pkg_setup initializes the Java environment 52# pkg_setup initializes the Java environment
42# ------------------------------------------------------------------------------ 53# ------------------------------------------------------------------------------
43java-pkg-2_pkg_setup() { 54java-pkg-2_pkg_setup() {
44 java-pkg_init 55 java-pkg_init
56 java-pkg_ensure-test
57}
58
59# ------------------------------------------------------------------------------
60# @eclass-src_compile
61#
62# Default src_compile for java packages
63# variables:
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
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
68# (default: the one provided by use_doc in
69# java-utils-2.eclass)
70# EANT_GENTOO_CLASSPATH - @see eant documention in java-utils-2.eclass
71# EANT_EXTRA_ARGS - extra arguments to pass to eant
72# EANT_ANT_TASKS - modifies the ANT_TASKS variable in the eant environment
73# param: Parameters are passed to ant verbatim
74# ------------------------------------------------------------------------------
75java-pkg-2_src_compile() {
76 if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then
77 if ! hasq java-ant-2 ${INHERITED}; then
78 msg="You should inherit java-ant-2 always when using eant"
79 ewarn ${msg}
80 is-java-strict && die ${msg}
81 fi
82 [[ "${EANT_FILTER_COMPILER}" ]] && \
83 java-pkg_filter-compiler ${EANT_FILTER_COMPILER}
84
85 local antflags="${EANT_BUILD_TARGET:=jar}"
86 hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})"
87 ANT_TASKS="${ANT_TASKS} ${EANT_ANT_TASKS}" \
88 eant ${antflags} -f "${EANT_BUILD_XML}" ${EANT_EXTRA_ARGS} "${@}"
89 else
90 echo "${FUNCNAME}: ${EANT_BUILD_XML} not found so nothing to do."
91 fi
45} 92}
46 93
47# ------------------------------------------------------------------------------ 94# ------------------------------------------------------------------------------
48# @note 95# @note
49# 96#
60pre_src_unpack() { 107pre_src_unpack() {
61 java-pkg-2_pkg_setup 108 java-pkg-2_pkg_setup
62} 109}
63 110
64pre_src_compile() { 111pre_src_compile() {
112 if is-java-strict; then
113 echo "Searching for bundled jars:"
114 java-pkg_find-normal-jars || echo "None found."
115 fi
65 java-pkg-2_pkg_setup 116 java-pkg-2_pkg_setup
66} 117}
67 118
68pre_src_install() { 119pre_src_install() {
69 java-pkg-2_pkg_setup 120 java-pkg-2_pkg_setup

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.18

  ViewVC Help
Powered by ViewVC 1.1.20