eclass/java-utils-2: Sync with Gentoo

It's from Gentoo commit b4de2efc298df6cee8c443bb5a1b6ae999a19592.
This commit is contained in:
Flatcar Buildbot 2024-09-16 07:13:37 +00:00 committed by Krzesimir Nowak
parent 0e1b2c1de4
commit 804544d23c

View File

@ -17,14 +17,18 @@
# that have optional Java support. In addition you can inherit java-ant-2 for # that have optional Java support. In addition you can inherit java-ant-2 for
# Ant-based packages. # Ant-based packages.
case ${EAPI} in
6|7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
_JAVA_UTILS_2_ECLASS=1 _JAVA_UTILS_2_ECLASS=1
case ${EAPI} in
6)
ewarn "${CATEGORY}/${PF}: ebuild uses ${ECLASS} with deprecated EAPI ${EAPI}!"
ewarn "${CATEGORY}/${PF}: Support will be removed on 2024-10-08. Please port to newer EAPI."
;;
7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier EAPIs. # EAPI 7 has version functions built-in. Use eapi7-ver for all earlier EAPIs.
# Keep versionator inheritance in case consumers are using it implicitly. # Keep versionator inheritance in case consumers are using it implicitly.
[[ ${EAPI} == 6 ]] && inherit eapi7-ver eqawarn multilib versionator [[ ${EAPI} == 6 ]] && inherit eapi7-ver eqawarn multilib versionator
@ -2250,29 +2254,6 @@ java-pkg_force-compiler() {
JAVA_PKG_FORCE_COMPILER="$@" JAVA_PKG_FORCE_COMPILER="$@"
} }
# @FUNCTION: use_doc
# @DESCRIPTION:
#
# Helper function for getting ant to build javadocs. If the user has USE=doc,
# then 'javadoc' or the argument are returned. Otherwise, there is no return.
#
# The output of this should be passed to ant.
# @CODE
# Parameters:
# $@ - Option value to return. Defaults to 'javadoc'
#
# Examples:
# build javadocs by calling 'javadoc' target
# eant $(use_doc)
#
# build javadocs by calling 'apidoc' target
# eant $(use_doc apidoc)
# @CODE
# @RETURN string - Name of the target to create javadocs
use_doc() {
use doc && echo ${@:-javadoc}
}
# @FUNCTION: java-pkg_init # @FUNCTION: java-pkg_init
# @INTERNAL # @INTERNAL