aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2019-01-13 19:50:10 +0200
committerGitHub <noreply@github.com>2019-01-13 19:50:10 +0200
commit49557e15ec62c7db21b3619d957e4f65772660d6 (patch)
treebfab1c95f5e609f67384dc445540dc207e8de390 /mesonbuild/mintro.py
parente02b79dc1e2e154b26a4dd6d4fff324d803b92ed (diff)
parent5c139032b80cda76a111744b745c04dacc17df42 (diff)
downloadmeson-49557e15ec62c7db21b3619d957e4f65772660d6.zip
meson-49557e15ec62c7db21b3619d957e4f65772660d6.tar.gz
meson-49557e15ec62c7db21b3619d957e4f65772660d6.tar.bz2
Merge pull request #4731 from mensinda/introBreak2
mintro: Changes to the introspection API
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index df9fe73..829a05f 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)
@@ -299,6 +294,7 @@ def list_buildoptions_from_source(sourcedir, backend, indent):
print(json.dumps(list_buildoptions(intr.coredata), indent=indent))
def list_target_files(target_name, targets, builddata: build.Build):
+ sys.stderr.write("WARNING: The --target-files introspection API is deprecated. Use --targets instead.\n")
result = []
tgt = None
@@ -314,7 +310,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
@@ -387,6 +382,7 @@ def find_buildsystem_files_list(src_dir):
def list_buildsystem_files(builddata: build.Build):
src_dir = builddata.environment.get_source_dir()
filelist = find_buildsystem_files_list(src_dir)
+ filelist = [os.path.join(src_dir, x) for x in filelist]
return filelist
def list_deps(coredata: cdata.CoreData):
@@ -531,7 +527,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
+ builddata = build.load(options.builddir)
results += [('target_files', list_target_files(options.target_files, targets, builddata))]
# Extract introspection information from JSON