diff options
author | Manuel Mommertz <manuel.mommertz@desy.de> | 2024-01-17 14:24:16 +0100 |
---|---|---|
committer | Miroslav Šulc <fordfrog@gentoo.org> | 2024-01-19 13:43:46 +0100 |
commit | 6b8564a70b0914325d4b41039012d6e639511e5d (patch) | |
tree | 1508e2af8c5b1f60a5f646e2f3876dc3fac05144 /eclass | |
parent | java-pkg-simple.eclass: cut possible prefix to allow integer comparison (diff) | |
download | gentoo-6b8564a70b0914325d4b41039012d6e639511e5d.tar.gz gentoo-6b8564a70b0914325d4b41039012d6e639511e5d.tar.bz2 gentoo-6b8564a70b0914325d4b41039012d6e639511e5d.zip |
java-pkg-simple.eclass: improve decision when to use --module-path
Closes: https://bugs.gentoo.org/922157
Signed-off-by: Manuel Mommertz <manuel.mommertz@desy.de>
Closes: https://github.com/gentoo/gentoo/pull/34866
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-pkg-simple.eclass | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 990b09f73c00..1a4bcb1b0a63 100644 --- a/eclass/java-pkg-simple.eclass +++ b/eclass/java-pkg-simple.eclass @@ -370,10 +370,10 @@ java-pkg-simple_src_compile() { local target="$(java-pkg_get-target)" if [[ ${target#1.} -lt 9 ]]; then find "${JAVA_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${sources} - moduleinfo=$(find "${JAVA_SRC_DIR[@]}" -name module-info.java) else find "${JAVA_SRC_DIR[@]}" -name \*.java > ${sources} fi + moduleinfo=$(find "${JAVA_SRC_DIR[@]}" -name module-info.java) # create the target directory mkdir -p ${classes} || die "Could not create target directory" @@ -383,7 +383,7 @@ java-pkg-simple_src_compile() { java-pkg-simple_getclasspath java-pkg-simple_prepend_resources ${classes} "${JAVA_RESOURCE_DIRS[@]}" - if [[ -n ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then + if [[ -z ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then ejavac -d ${classes} -encoding ${JAVA_ENCODING}\ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${sources} else @@ -393,7 +393,7 @@ java-pkg-simple_src_compile() { fi # handle module-info.java separately as it needs at least JDK 9 - if [[ -n ${moduleinfo} ]]; then + if [[ -n ${moduleinfo} ]] && [[ ${target#1.} -lt 9 ]]; then if java-pkg_is-vm-version-ge "9" ; then local tmp_source=${JAVA_PKG_WANT_SOURCE} tmp_target=${JAVA_PKG_WANT_TARGET} @@ -532,14 +532,14 @@ java-pkg-simple_src_test() { local target="$(java-pkg_get-target)" if [[ ${target#1.} -lt 9 ]]; then find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java ! -name module-info.java > ${test_sources} - moduleinfo=$(find "${JAVA_TEST_SRC_DIR[@]}" -name module-info.java) else find "${JAVA_TEST_SRC_DIR[@]}" -name \*.java > ${test_sources} fi + moduleinfo=$(find "${JAVA_TEST_SRC_DIR[@]}" -name module-info.java) # compile if [[ -s ${test_sources} ]]; then - if [[ -n ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then + if [[ -z ${moduleinfo} ]] || [[ ${target#1.} -lt 9 ]]; then ejavac -d ${classes} -encoding ${JAVA_ENCODING}\ ${classpath:+-classpath ${classpath}} ${JAVAC_ARGS} @${test_sources} else @@ -550,7 +550,7 @@ java-pkg-simple_src_test() { fi # handle module-info.java separately as it needs at least JDK 9 - if [[ -n ${moduleinfo} ]]; then + if [[ -n ${moduleinfo} ]] && [[ ${target#1.} -lt 9 ]]; then if java-pkg_is-vm-version-ge "9" ; then local tmp_source=${JAVA_PKG_WANT_SOURCE} tmp_target=${JAVA_PKG_WANT_TARGET} |