jar target is always dirty if path to source does not match package.
To Reproduce
have a java subdirectory with A.java:
class A {}project('mt', 'java')
jar('out', 'java/A.java')Describe the bug
Meson generates ninja rules under the expectation, the the compiled class will be located at <builddir>/out.jar.p/java/A.class, this however is not the case, as the compiled class will be placed in <builddir>/out.jar.p based on its package declaration. This doesn't have any, so it's just in <builddir>/out.jar.p.
This is a documented limitation (https://github.com/mesonbuild/meson/blob/master/docs/markdown/Java.md?plain=1#L23), I just did not find an issue for it.
Expected behavior
I'd want meson to figure out where javac will write the class, irrespective of the original location of the source file, which admittedly will be kinda nasty, as it'll probably end up requiring meson to peek at the source file.
Relates to: #15582
Source: mesonbuild/meson