aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-01-02 16:05:19 +0100
committerDaniel Mensinger <daniel@mensinger-ka.de>2019-01-07 22:24:49 +0100
commita1d8c1d3e93974bde114743c8b624221b776cb16 (patch)
tree9019edb85db5cd28425c41fafc9449a200798172 /mesonbuild/mintro.py
parent3bf2ca483e9ca80ee81ee0a07d5f5c9f36817bb3 (diff)
downloadmeson-a1d8c1d3e93974bde114743c8b624221b776cb16.zip
meson-a1d8c1d3e93974bde114743c8b624221b776cb16.tar.gz
meson-a1d8c1d3e93974bde114743c8b624221b776cb16.tar.bz2
Changed introspection target format
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py19
1 files changed, 5 insertions, 14 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index b183d2a..b09ea88 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -117,6 +117,7 @@ def list_installed(installdata):
def list_targets(builddata: build.Build, installdata, backend: backends.Backend):
tlist = []
+ build_dir = builddata.environment.get_build_dir()
# Fast lookup table for installation files
install_lookuptable = {}
@@ -128,24 +129,18 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend)
if not isinstance(target, build.Target):
raise RuntimeError('The target object in `builddata.get_targets()` is not of type `build.Target`. Please file a bug with this error message.')
- # TODO Change this to the full list in a seperate PR
- fname = [os.path.join(target.subdir, x) for x in target.get_outputs()]
- if len(fname) == 1:
- fname = fname[0]
-
t = {
'name': target.get_basename(),
'id': idname,
'type': target.get_typename(),
- 'filename': fname,
+ 'filename': [os.path.join(build_dir, target.subdir, x) for x in target.get_outputs()],
'build_by_default': target.build_by_default,
'target_sources': backend.get_introspection_data(idname, target)
}
if installdata and target.should_install():
t['installed'] = True
- # TODO Change this to the full list in a seperate PR
- t['install_filename'] = [install_lookuptable.get(x, None) for x in target.get_outputs()][0]
+ t['install_filename'] = [install_lookuptable.get(x, None) for x in target.get_outputs()]
else:
t['installed'] = False
tlist.append(t)
@@ -298,7 +293,7 @@ def list_buildoptions_from_source(sourcedir, backend, indent):
mlog.enable()
print(json.dumps(list_buildoptions(intr.coredata), indent=indent))
-def list_target_files(target_name, targets, builddata: build.Build):
+def list_target_files(target_name, targets):
result = []
tgt = None
@@ -314,9 +309,6 @@ def list_target_files(target_name, targets, builddata: build.Build):
for i in tgt['target_sources']:
result += i['sources'] + i['generated_sources']
- # TODO Remove this line in a future PR with other breaking changes
- result = list(map(lambda x: os.path.relpath(x, builddata.environment.get_source_dir()), result))
-
return result
def list_buildoptions(coredata: cdata.CoreData):
@@ -531,8 +523,7 @@ def run(options):
targets_file = os.path.join(infodir, 'intro-targets.json')
with open(targets_file, 'r') as fp:
targets = json.load(fp)
- builddata = build.load(options.builddir) # TODO remove this in a breaking changes PR
- results += [('target_files', list_target_files(options.target_files, targets, builddata))]
+ results += [('target_files', list_target_files(options.target_files, targets))]
# Extract introspection information from JSON
for i in toextract: