diff options
-rw-r--r-- | docs/markdown/snippets/introspect_breaking_format.md | 5 | ||||
-rw-r--r-- | mesonbuild/mintro.py | 9 | ||||
-rwxr-xr-x | run_unittests.py | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/docs/markdown/snippets/introspect_breaking_format.md b/docs/markdown/snippets/introspect_breaking_format.md index c3ad7fe..c96c82c 100644 --- a/docs/markdown/snippets/introspect_breaking_format.md +++ b/docs/markdown/snippets/introspect_breaking_format.md @@ -2,7 +2,10 @@ All paths used in the meson introspection JSON format are now absolute. This affects the `filename` key in the targets introspection and the output of -`--target-files` and `--buildsystem-files`. +`--buildsystem-files`. Furthermore, the `filename` and `install_filename` keys in the targets introspection are now lists of strings with identical length. + +The `--traget-files` option is now deprecated, since the same information +can be acquired from the `--tragets` introspection API. diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py index b09ea88..233136e 100644 --- a/mesonbuild/mintro.py +++ b/mesonbuild/mintro.py @@ -293,7 +293,8 @@ 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): +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 @@ -309,6 +310,8 @@ def list_target_files(target_name, targets): for i in tgt['target_sources']: result += i['sources'] + i['generated_sources'] + result = list(map(lambda x: os.path.relpath(x, builddata.environment.get_source_dir()), result)) + return result def list_buildoptions(coredata: cdata.CoreData): @@ -379,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): @@ -523,7 +527,8 @@ def run(options): targets_file = os.path.join(infodir, 'intro-targets.json') with open(targets_file, 'r') as fp: targets = json.load(fp) - results += [('target_files', list_target_files(options.target_files, targets))] + builddata = build.load(options.builddir) + results += [('target_files', list_target_files(options.target_files, targets, builddata))] # Extract introspection information from JSON for i in toextract: diff --git a/run_unittests.py b/run_unittests.py index c7a5a7e..5f3181d 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2565,7 +2565,6 @@ int main(int argc, char **argv) { for t in t_intro: id = t['id'] tf_intro = self.introspect(['--target-files', id]) - tf_intro = list(map(lambda x: os.path.relpath(x, testdir), tf_intro)) self.assertEqual(tf_intro, expected[id]) self.wipe() @@ -2580,7 +2579,6 @@ int main(int argc, char **argv) { for t in t_intro: id = t['id'] tf_intro = self.introspect(['--target-files', id]) - tf_intro = list(map(lambda x: os.path.relpath(x, testdir), tf_intro)) self.assertEqual(tf_intro, expected[id]) self.wipe() |