eclass/java-utils-2: Sync with Gentoo

It's from Gentoo commit f1fce6210d9d4104738e3fa35214b477486be534.
This commit is contained in:
Flatcar Buildbot 2024-07-01 07:15:07 +00:00 committed by Mathieu Tortuyaux
parent 6054a9fd55
commit 08c00d199a
No known key found for this signature in database
GPG Key ID: AC5CCFB52545D9B8

View File

@ -319,12 +319,15 @@ java-pkg_doexamples() {
# arguments are passed through to find. # arguments are passed through to find.
# #
# @CODE # @CODE
# Parameters:
# $1 - jar file
# $2 - resource tree directory
# $* - arguments to pass to find
#
# Example:
# java-pkg_addres ${PN}.jar resources ! -name "*.html" # java-pkg_addres ${PN}.jar resources ! -name "*.html"
# @CODE # @CODE
# #
# @param $1 - jar file
# @param $2 - resource tree directory
# @param $* - arguments to pass to find
java-pkg_addres() { java-pkg_addres() {
debug-print-function ${FUNCNAME} $* debug-print-function ${FUNCNAME} $*
@ -1134,7 +1137,7 @@ java-pkg_jarfrom() {
} }
# @FUNCTION: java-pkg_getjars # @FUNCTION: java-pkg_getjars
# @USAGE: [--build-only] [--with-dependencies] <package1>[,<package2>...] # @USAGE: [--build-only] [--runtime-only] [--with-dependencies] <package1>[,<package2>...]
# @DESCRIPTION: # @DESCRIPTION:
# Get the classpath provided by any number of packages # Get the classpath provided by any number of packages
# Among other things, this can be passed to 'javac -classpath' or 'ant -lib'. # Among other things, this can be passed to 'javac -classpath' or 'ant -lib'.
@ -1154,6 +1157,7 @@ java-pkg_jarfrom() {
# Parameters: # Parameters:
# --build-only - makes the jar(s) not added into package.env DEPEND line. # --build-only - makes the jar(s) not added into package.env DEPEND line.
# (assumed automatically when called inside src_test) # (assumed automatically when called inside src_test)
# --runtime-only - marks the jar(s) not added into package.env RDEPEND line.
# --with-dependencies - get jars also from requested package's dependencies # --with-dependencies - get jars also from requested package's dependencies
# transitively. # transitively.
# $1 - list of packages to get jars from # $1 - list of packages to get jars from
@ -1162,6 +1166,7 @@ java-pkg_jarfrom() {
java-pkg_getjars() { java-pkg_getjars() {
debug-print-function ${FUNCNAME} $* debug-print-function ${FUNCNAME} $*
local dep_constraint
local build_only="" local build_only=""
local deep="" local deep=""
@ -1170,6 +1175,9 @@ java-pkg_getjars() {
while [[ "${1}" == --* ]]; do while [[ "${1}" == --* ]]; do
if [[ "${1}" = "--build-only" ]]; then if [[ "${1}" = "--build-only" ]]; then
build_only="build" build_only="build"
dep_constraint="build"
elif [[ "${1}" = "--runtime-only" ]]; then
dep_constraint="runtime"
elif [[ "${1}" = "--with-dependencies" ]]; then elif [[ "${1}" = "--with-dependencies" ]]; then
deep="--with-dependencies" deep="--with-dependencies"
else else
@ -1188,7 +1196,7 @@ java-pkg_getjars() {
debug-print "${pkgs}:${jars}" debug-print "${pkgs}:${jars}"
for pkg in ${pkgs//,/ }; do for pkg in ${pkgs//,/ }; do
java-pkg_ensure-dep "${build_only}" "${pkg}" java-pkg_ensure-dep "${dep_constraint}" "${pkg}"
done done
for pkg in ${pkgs//,/ }; do for pkg in ${pkgs//,/ }; do
@ -1637,10 +1645,6 @@ java-pkg_set-current-vm() {
export GENTOO_VM=${1} export GENTOO_VM=${1}
} }
java-pkg_get-current-vm() {
echo ${GENTOO_VM}
}
java-pkg_current-vm-matches() { java-pkg_current-vm-matches() {
has $(java-pkg_get-current-vm) ${@} has $(java-pkg_get-current-vm) ${@}
return $? return $?
@ -1809,7 +1813,6 @@ java-pkg_ant-tasks-depend() {
fi fi
} }
# @FUNCTION: ejunit_ # @FUNCTION: ejunit_
# @INTERNAL # @INTERNAL
# @DESCRIPTION: # @DESCRIPTION:
@ -2030,13 +2033,23 @@ java-utils-2_pkg_preinst() {
eant() { eant() {
debug-print-function ${FUNCNAME} $* debug-print-function ${FUNCNAME} $*
if [[ ${EBUILD_PHASE} = compile ]]; then if [[ ${!JAVA_PKG_BSFIX*} ]] \
java-ant-2_src_configure || [[ ${JAVA_ANT_BSFIX_EXTRA_ARGS} ]] \
fi || [[ ${JAVA_ANT_CLASSPATH_TAGS} ]] \
|| [[ ${JAVA_ANT_JAVADOC_INPUT_DIRS} ]] \
|| [[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] \
|| [[ ${EANT_BUILD_XML} ]] \
|| [[ ${!EANT_GENTOO_CLASSPATH*} ]] \
|| [[ ${EANT_TEST_GENTOO_CLASSPATH} ]]
then
if [[ ${EBUILD_PHASE} = compile ]]; then
java-ant-2_src_configure
fi
if ! has java-ant-2 ${INHERITED}; then if ! has java-ant-2 ${INHERITED}; then
local msg="You should inherit java-ant-2 when using eant" local msg="You should inherit java-ant-2 when using eant"
java-pkg_announce-qa-violation "${msg}" java-pkg_announce-qa-violation "${msg}"
fi
fi fi
local antflags="-Dnoget=true -Dmaven.mode.offline=true -Dbuild.sysclasspath=ignore" local antflags="-Dnoget=true -Dmaven.mode.offline=true -Dbuild.sysclasspath=ignore"
@ -2813,7 +2826,7 @@ java-pkg_die() {
echo "!!! When you file a bug report, please include the following information:" >&2 echo "!!! When you file a bug report, please include the following information:" >&2
echo "GENTOO_VM=${GENTOO_VM} CLASSPATH=\"${CLASSPATH}\" JAVA_HOME=\"${JAVA_HOME}\"" >&2 echo "GENTOO_VM=${GENTOO_VM} CLASSPATH=\"${CLASSPATH}\" JAVA_HOME=\"${JAVA_HOME}\"" >&2
echo "JAVACFLAGS=\"${JAVACFLAGS}\" COMPILER=\"${GENTOO_COMPILER}\"" >&2 echo "JAVACFLAGS=\"${JAVACFLAGS}\" COMPILER=\"${GENTOO_COMPILER}\"" >&2
echo "and of course, the output of emerge --info =${P}" >&2 echo "and of course, the output of emerge --info =${CATEGORY}/${PF}" >&2
} }
@ -2931,7 +2944,7 @@ java-pkg_ensure-dep() {
# if is-java-strict; then # if is-java-strict; then
# die "${dev_error}" # die "${dev_error}"
# else # else
eqawarn "java-pkg_ensure-dep: ${dev_error}" eqawarn "QA Notice: java-pkg_ensure-dep: ${dev_error}"
# eerror "Because you have ${target_pkg} installed," # eerror "Because you have ${target_pkg} installed,"
# eerror "the package will build without problems, but please" # eerror "the package will build without problems, but please"
# eerror "report this to https://bugs.gentoo.org." # eerror "report this to https://bugs.gentoo.org."
@ -2942,7 +2955,7 @@ java-pkg_ensure-dep() {
# if is-java-strict; then # if is-java-strict; then
# die "${dev_error}" # die "${dev_error}"
# else # else
eqawarn "java-pkg_ensure-dep: ${dev_error}" eqawarn "QA Notice: java-pkg_ensure-dep: ${dev_error}"
# eerror "The package will build without problems, but may fail to run" # eerror "The package will build without problems, but may fail to run"
# eerror "if you don't have ${target_pkg} installed," # eerror "if you don't have ${target_pkg} installed,"
# eerror "so please report this to https://bugs.gentoo.org." # eerror "so please report this to https://bugs.gentoo.org."