diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-07 01:02:03 +0100 |
---|---|---|
committer | Daniel Mensinger <daniel@mensinger-ka.de> | 2019-01-07 22:35:56 +0100 |
commit | 5c139032b80cda76a111744b745c04dacc17df42 (patch) | |
tree | 90a59d79657a4e4373cb2c2efd58a5a65cc434e6 | |
parent | 29dd57dcbf248e66ef5ed37c3f5a5cdead0e4817 (diff) | |
download | meson-5c139032b80cda76a111744b745c04dacc17df42.zip meson-5c139032b80cda76a111744b745c04dacc17df42.tar.gz meson-5c139032b80cda76a111744b745c04dacc17df42.tar.bz2 |
Deprecated --target-files API
-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() |