gdbus_codegen: Guess the output list for docbook generation

We were setting it to a file list that would always be wrong, and
always out of date since it would never exist.

However, the output list is not predictable. It usually has a 1-1
relationship with the input XML files, but it may not.

This must be fixed later with API for users to provide the output
names.

See: https://github.com/mesonbuild/meson/pull/3539
pull/3539/head
Nirbheek Chauhan 7 years ago
parent 7ca2b8caca
commit 86cc4f2707
  1. 6
      mesonbuild/modules/gnome.py
  2. 18
      run_unittests.py
  3. 3
      test cases/frameworks/10 gtk-doc/doc/meson.build

@ -938,9 +938,13 @@ This will become a hard error in the future.''')
docbook_cmd = cmd + ['--output-directory', '@OUTDIR@', '--generate-docbook', docbook, '@INPUT@']
# The docbook output is always ${docbook}-${name_of_xml_file}
output = namebase + '-docbook'
outputs = []
for f in xml_files:
outputs.append('{}-{}'.format(docbook, f))
custom_kwargs = {'input': xml_files,
'output': output,
'output': outputs,
'command': docbook_cmd,
'build_by_default': build_by_default
}

@ -688,8 +688,10 @@ class BasePlatformTests(unittest.TestCase):
cmds = [l[len(prefix):].split() for l in log if l.startswith(prefix)]
return cmds
def introspect(self, arg):
out = subprocess.check_output(self.mintro_command + [arg, self.builddir],
def introspect(self, args):
if isinstance(args, str):
args = [args]
out = subprocess.check_output(self.mintro_command + args + [self.builddir],
universal_newlines=True)
return json.loads(out)
@ -2938,6 +2940,18 @@ class LinuxlikeTests(BasePlatformTests):
gobject_found = True
self.assertTrue(glib_found)
self.assertTrue(gobject_found)
if subprocess.call(['pkg-config', '--exists', 'glib-2.0 >= 2.56.2']) != 0:
raise unittest.SkipTest('glib >= 2.56.2 needed for the rest')
targets = self.introspect('--targets')
docbook_target = None
for t in targets:
if t['name'] == 'generated-gdbus-docbook':
docbook_target = t
break
self.assertIsInstance(docbook_target, dict)
ifile = self.introspect(['--target-files', 'generated-gdbus-docbook@cus'])[0]
self.assertEqual(t['filename'], 'gdbus/generated-gdbus-doc-' + ifile)
def test_build_rpath(self):
if is_cygwin():

@ -5,8 +5,7 @@ version_xml = configure_file(input : 'version.xml.in',
configuration : cdata)
gnome.gtkdoc('foobar',
version_xml,
src_dir : inc,
main_sgml : 'foobar-docs.sgml',
content_files : docbook,
content_files : [docbook, version_xml],
install : true)

Loading…
Cancel
Save