Change jar() default install dir

The previous install dir seemed incorrect when looking at various Linux
distributions.
pull/10047/head
Tristan Partin 3 years ago committed by Jussi Pakkanen
parent e7b8059f7b
commit 80cb87e7b7
  1. 5
      docs/markdown/snippets/jar_default_install_dir.md
  2. 3
      mesonbuild/build.py
  3. 4
      mesonbuild/environment.py

@ -0,0 +1,5 @@
## JAR default install dir
The previous default for `jar()` was `libdir`. With this release, it has been
changed to `datadir/java`. Please open an issue if this is not a sane default
for your system.

@ -2627,6 +2627,9 @@ class Jar(BuildTarget):
return ['-cp', os.pathsep.join(cp_paths)]
return []
def get_default_install_dir(self, environment: environment.Environment) -> T.Tuple[str, str]:
return environment.get_jar_dir(), '{jardir}'
@dataclass(eq=False)
class CustomTargetIndex(HoldableObject):

@ -814,6 +814,10 @@ class Environment:
return self.get_bindir()
return self.get_libdir()
def get_jar_dir(self) -> str:
"""Install dir for JAR files"""
return f"{self.get_datadir()}/java"
def get_static_lib_dir(self) -> str:
"Install dir for the static library"
return self.get_libdir()

Loading…
Cancel
Save