aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/build.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/build.py')
-rw-r--r--mesonbuild/build.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 7d071e0..dc14326 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1911,6 +1911,9 @@ class Jar(BuildTarget):
for s in self.sources:
if not s.endswith('.java'):
raise InvalidArguments('Jar source %s is not a java file.' % s)
+ for t in self.link_targets:
+ if not isinstance(t, Jar):
+ raise InvalidArguments('Link target %s is not a jar target.' % t)
self.filename = self.name + '.jar'
self.outputs = [self.filename]
self.java_args = kwargs.get('java_args', [])
@@ -1928,6 +1931,13 @@ class Jar(BuildTarget):
# All jar targets are installable.
pass
+ def is_linkable_target(self):
+ return True
+
+ def get_classpath_args(self):
+ cp_paths = [os.path.join(l.get_subdir(), l.get_filename()) for l in self.link_targets]
+ return ['-cp', os.pathsep.join(cp_paths)]
+
class CustomTargetIndex:
"""A special opaque object returned by indexing a CustomTarget. This object
@@ -1950,7 +1960,6 @@ class CustomTargetIndex:
def get_subdir(self):
return self.target.get_subdir()
-
class ConfigureFile:
def __init__(self, subdir, sourcename, targetname, configuration_data):