aboutsummaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorBenjamin Gilbert <bgilbert@backtick.net>2022-12-13 21:12:41 -0500
committerBenjamin Gilbert <bgilbert@backtick.net>2022-12-14 15:37:59 -0500
commit35e230e48ca42f4ccb872d1d01f9280f8015b417 (patch)
treea55a759f1f3a37e6a8d2b1f3ebd4268fc0df57c6 /test cases
parent51c889ddbc8e83a73ef4d1f2556609bae2a046ce (diff)
downloadmeson-35e230e48ca42f4ccb872d1d01f9280f8015b417.zip
meson-35e230e48ca42f4ccb872d1d01f9280f8015b417.tar.gz
meson-35e230e48ca42f4ccb872d1d01f9280f8015b417.tar.bz2
depfixer: silence fix_jar() and make it do something
fix_jar() tries to remove an existing Class-Path entry from the jar manifest by postprocessing the manifest and passing it to `jar -um`. However, `jar -um` can only add/replace manifest entries, not remove them, and it also complains loudly when replacing an entry: Dec 13, 2022 7:11:19 PM java.util.jar.Attributes read WARNING: Duplicate name in Manifest: Manifest-Version. Ensure that the manifest does not have duplicate entries, and that blank lines separate individual sections in both your manifest and in the META-INF/MANIFEST.MF entry in the jar file. Thus fix_jar() produces one such warning for each entry in the manifest and accomplishes nothing else. Use jar -uM instead. This completely removes the manifest from the jar and allows adding it back as a normal zip member, fixing fix_jar() and avoiding the warnings. Fixes: https://github.com/mesonbuild/meson/issues/10491 Fixes: c70a051e93 ("java: remove manifest classpath from installed jar")
Diffstat (limited to 'test cases')
-rw-r--r--test cases/unit/110 classpath/com/mesonbuild/Simple.java7
-rw-r--r--test cases/unit/110 classpath/meson.build14
2 files changed, 21 insertions, 0 deletions
diff --git a/test cases/unit/110 classpath/com/mesonbuild/Simple.java b/test cases/unit/110 classpath/com/mesonbuild/Simple.java
new file mode 100644
index 0000000..325a49a
--- /dev/null
+++ b/test cases/unit/110 classpath/com/mesonbuild/Simple.java
@@ -0,0 +1,7 @@
+package com.mesonbuild;
+
+class Simple {
+ public static void main(String [] args) {
+ System.out.println("Java is working.\n");
+ }
+}
diff --git a/test cases/unit/110 classpath/meson.build b/test cases/unit/110 classpath/meson.build
new file mode 100644
index 0000000..e6b9b84
--- /dev/null
+++ b/test cases/unit/110 classpath/meson.build
@@ -0,0 +1,14 @@
+project('simplejava', 'java')
+
+one = jar('one', 'com/mesonbuild/Simple.java',
+ main_class : 'com.mesonbuild.Simple',
+ install : true,
+ install_dir : get_option('bindir'),
+)
+
+two = jar('two', 'com/mesonbuild/Simple.java',
+ main_class : 'com.mesonbuild.Simple',
+ install : true,
+ install_dir : get_option('bindir'),
+ link_with : one,
+)