For adding Main-class and/or Automatic-module-name to MANIFEST.MF it
seems better to use "jar" functionality at the end of compilation.
This does the necessary checks and issues warnings in case of duplicate entries.
Closes:
https://bugs.gentoo.org/874924
Signed-off-by: Volkmar W. Pogatzki <
gentoo@pogatzki.net>
---
eclass/java-pkg-simple.eclass | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/eclass/java-pkg-simple.eclass b/eclass/java-pkg-simple.eclass index 7a9582393dd..5f691571e53 100644
--- a/eclass/java-pkg-simple.eclass
+++ b/eclass/java-pkg-simple.eclass
@@ -415,15 +415,6 @@ java-pkg-simple_src_compile() {
fi
# package
- [[ ! -d ${classes}/META-INF ]] && mkdir ${classes}/META-INF
- if [[ -v JAVA_AUTOMATIC_MODULE_NAME ]]; then
- echo "Automatic-Module-Name: ${JAVA_AUTOMATIC_MODULE_NAME}" \
- >> ${classes}/META-INF/MANIFEST.MF || die "adding module name failed"
- fi
- if [[ -v JAVA_MAIN_CLASS ]]; then
- echo "Main-Class: ${JAVA_MAIN_CLASS}" \
- >> ${classes}/META-INF/MANIFEST.MF || die "adding main class failed"
- fi
local jar_args
if [[ -e ${classes}/META-INF/MANIFEST.MF ]]; then
jar_args="cfm ${JAVA_JAR_FILENAME} ${classes}/META-INF/MANIFEST.MF"
@@ -431,6 +422,18 @@ java-pkg-simple_src_compile() {
jar_args="cf ${JAVA_JA