Filenames are now lists

pull/4547/head
Daniel Mensinger 6 years ago
parent b91c5aad85
commit b034f52656
No known key found for this signature in database
GPG Key ID: 54DD94C131E277D4
  1. 5
      docs/markdown/snippets/introspect_multiple.md
  2. 3
      mesonbuild/build.py
  3. 6
      mesonbuild/mintro.py
  4. 6
      run_unittests.py

@ -11,3 +11,8 @@ Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-new`
were added to print all introspection information in one go, format the
JSON output (the default is still compact JSON) and foce use the new
output format, even if only one introspection command was given.
Additionlly the format of target was changed:
- `filename` is now a list of output filenames
- `install_filename` is now also a list of installed files
- New: the `sources` key. It stores the source files of a target and there compiler parameters

@ -2120,6 +2120,9 @@ class RunTarget(Target):
def get_filename(self):
return self.name
def get_outputs(self):
return [self.name]
def type_suffix(self):
return "@run"

@ -93,11 +93,7 @@ def list_targets(builddata: build.Build, installdata, backend: backends.Backend)
if not isinstance(target, build.Target):
raise RuntimeError('Something weird happened. File a bug.')
fname = target.get_filename()
if isinstance(fname, list):
fname = [os.path.join(target.subdir, x) for x in fname]
else:
fname = os.path.join(target.subdir, fname)
fname = [os.path.join(target.subdir, x) for x in target.get_outputs()]
t = {
'name': target.get_basename(),

@ -1436,7 +1436,7 @@ class AllPlatformTests(BasePlatformTests):
# Get name of static library
targets = self.introspect('--targets')
self.assertEqual(len(targets), 1)
libname = targets[0]['filename']
libname = targets[0]['filename'][0]
# Build and get contents of static library
self.build()
before = self._run(['ar', 't', os.path.join(self.builddir, libname)]).split()
@ -3168,7 +3168,7 @@ recommended as it is not supported on some platforms''')
('name', str),
('id', str),
('type', str),
('filename', str),
('filename', list),
('build_by_default', bool),
('sources', list),
('installed', bool),
@ -4368,7 +4368,7 @@ class LinuxlikeTests(BasePlatformTests):
break
self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + os.path.basename(ifile))
self.assertListEqual(t['filename'], ['gdbus/generated-gdbus-doc-' + os.path.basename(ifile)])
def test_build_rpath(self):
if is_cygwin():

Loading…
Cancel
Save