Index: java-pkg-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v retrieving revision 1.5 diff -u -r1.5 java-pkg-2.eclass --- java-pkg-2.eclass 8 Dec 2006 12:12:04 -0000 1.5 +++ java-pkg-2.eclass 17 Dec 2006 16:41:21 -0000 @@ -33,7 +33,7 @@ # ------------------------------------------------------------------------------ RDEPEND="${DEPEND}" -EXPORT_FUNCTIONS pkg_setup +EXPORT_FUNCTIONS pkg_setup src_compile # ------------------------------------------------------------------------------ # @eclass-pkg_setup @@ -46,6 +46,27 @@ } # ------------------------------------------------------------------------------ +# @eclass-src_compile +# +# Default src_compile for java packages +# variables: +# EANT_BUILD_XML - controls the location of the build.xml (default: ./build.xml) +# EANT_BUILD_TARGET - the ant target/targets to execute (default: jar) +# EANT_DOC_TARGET - the target to build extra docs under the doc use flag +# (default: the one provided by use_doc in +# java-utils-2.eclass) +# ------------------------------------------------------------------------------ +java-pkg-2_src_compile() { + if [[ -e "${EANT_BUILD_XML:=build.xml}" ]]; then + local antflags="${EANT_BUILD_TARGET:=jar}" + hasq doc ${IUSE} && antflags="${antflags} $(use_doc ${EANT_DOC_TARGET})" + eant ${antflags} -f ${EANT_BUILD_XML} + else + vecho "${FUNCNAME}: No build.xml found so nothing to do." + fi +} + +# ------------------------------------------------------------------------------ # @note # # We need to initialize the environment in every function because Portage