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. 7
      docs/markdown/snippets/introspect_multiple.md
  2. 3
      mesonbuild/build.py
  3. 6
      mesonbuild/mintro.py
  4. 6
      run_unittests.py

@ -10,4 +10,9 @@ compatibility.
Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-new` Furthermore the option `-a,--all`, `-i,--indent` and `-f,--force-new`
were added to print all introspection information in one go, format the 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 JSON output (the default is still compact JSON) and foce use the new
output format, even if only one introspection command was given. 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): def get_filename(self):
return self.name return self.name
def get_outputs(self):
return [self.name]
def type_suffix(self): def type_suffix(self):
return "@run" return "@run"

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

@ -1436,7 +1436,7 @@ class AllPlatformTests(BasePlatformTests):
# Get name of static library # Get name of static library
targets = self.introspect('--targets') targets = self.introspect('--targets')
self.assertEqual(len(targets), 1) self.assertEqual(len(targets), 1)
libname = targets[0]['filename'] libname = targets[0]['filename'][0]
# Build and get contents of static library # Build and get contents of static library
self.build() self.build()
before = self._run(['ar', 't', os.path.join(self.builddir, libname)]).split() 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), ('name', str),
('id', str), ('id', str),
('type', str), ('type', str),
('filename', str), ('filename', list),
('build_by_default', bool), ('build_by_default', bool),
('sources', list), ('sources', list),
('installed', bool), ('installed', bool),
@ -4368,7 +4368,7 @@ class LinuxlikeTests(BasePlatformTests):
break break
self.assertIsInstance(docbook_target, dict) self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0] 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): def test_build_rpath(self):
if is_cygwin(): if is_cygwin():

Loading…
Cancel
Save