From 8b52dec6d9c078082fd2896779c24de9578fe382 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 30 Jul 2015 00:52:44 +0300 Subject: Can generate gtkdoc documentation. --- modules/gnome.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'modules/gnome.py') diff --git a/modules/gnome.py b/modules/gnome.py index 7a0ef4b..64e91df 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -16,7 +16,7 @@ functionality such as gobject-introspection and gresources.''' import build -import os +import os, sys import subprocess from coredata import MesonException import mlog @@ -176,6 +176,24 @@ class GnomeModule: target_g = build.CustomTarget(targetname, state.subdir, kwargs) return target_g + def gtkdoc(self, state, args, kwargs): + if len(args) != 1: + raise MesonException('Gtkdoc must have one positional argument.') + modulename = args[0] + if not isinstance(modulename, str): + raise MesonException('Gtkdoc arg must be string.') + if not 'src_dir' in kwargs: + raise MesonException('Keyword argument src_dir missing.') + src_dir = kwargs['src_dir'] + targetname = modulename + '-doc' + command = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../gtkdochelper.py")) + args = [state.environment.get_source_dir(), + state.environment.get_build_dir(), + state.subdir, + os.path.normpath(os.path.join(state.subdir, src_dir)), + modulename] + return build.RunTarget(targetname, command, args, state.subdir) + def gdbus_codegen(self, state, args, kwargs): if len(args) != 2: raise MesonException('Gdbus_codegen takes two arguments, name and xml file.') -- cgit v1.1 From 83cc5ce4c594306f0d37106dfaa829daa6c084a5 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 30 Jul 2015 02:01:47 +0300 Subject: Allow more than one install script and make gtkdoc method return one. --- modules/gnome.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'modules/gnome.py') diff --git a/modules/gnome.py b/modules/gnome.py index 64e91df..ed56989 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -192,7 +192,10 @@ class GnomeModule: state.subdir, os.path.normpath(os.path.join(state.subdir, src_dir)), modulename] - return build.RunTarget(targetname, command, args, state.subdir) + res = [build.RunTarget(targetname, command, args, state.subdir)] + if kwargs.get('install', True): + res.append(build.InstallScript([command] + args)) + return res def gdbus_codegen(self, state, args, kwargs): if len(args) != 2: -- cgit v1.1 From cbc329fc326e437b16b4eb732c6b4fed2c3c7123 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 2 Aug 2015 01:48:24 +0300 Subject: Add sgml main to gtk-doc. --- modules/gnome.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'modules/gnome.py') diff --git a/modules/gnome.py b/modules/gnome.py index ed56989..43c0537 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -184,6 +184,9 @@ class GnomeModule: raise MesonException('Gtkdoc arg must be string.') if not 'src_dir' in kwargs: raise MesonException('Keyword argument src_dir missing.') + main_sgml = kwargs.get('main_sgml', '') + if not isinstance(main_sgml, str): + raise MesonException('Main sgml keyword argument must be a string.') src_dir = kwargs['src_dir'] targetname = modulename + '-doc' command = os.path.normpath(os.path.join(os.path.split(__file__)[0], "../gtkdochelper.py")) @@ -191,6 +194,7 @@ class GnomeModule: state.environment.get_build_dir(), state.subdir, os.path.normpath(os.path.join(state.subdir, src_dir)), + main_sgml, modulename] res = [build.RunTarget(targetname, command, args, state.subdir)] if kwargs.get('install', True): -- cgit v1.1