]> xenbits.xensource.com Git - libvirt.git/commitdiff
scripts: apibuild: parse 'Since' for macros
authorVictor Toso <victortoso@redhat.com>
Fri, 22 Apr 2022 19:23:41 +0000 (21:23 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 26 Apr 2022 15:54:27 +0000 (17:54 +0200)
This patch adds 'version' parameter to the generated XML API for
macros

It'll require, for new additions, to add a comment with the version
that the macro was added. An example bellow of code diff and
the change in the generated XML.

Note that the Since tag is removed from the comment as there is a
proper field for it in the XML.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
scripts/apibuild.py

index 116ea9fe5f7615730d33a8e2705bbf26aef60733..c6d63ecff8d84fb91f7786055b76b7a6c51665c1 100755 (executable)
@@ -2266,11 +2266,15 @@ class docBuilder:
             output.write(" string='%s'" % strValue)
         else:
             output.write(" raw='%s'" % escape(rawValue))
+
+        (since, comment) = self.retrieve_comment_tags(name, desc)
+        if len(since) > 0:
+            output.write(" version='%s'" % escape(since))
         output.write(">\n")
 
-        if desc is not None and desc != "":
-            output.write("      <info><![CDATA[%s]]></info>\n" % (desc))
-            self.indexString(name, desc)
+        if comment is not None and comment != "":
+            output.write("      <info><![CDATA[%s]]></info>\n" % (comment))
+            self.indexString(name, comment)
         for arg in args:
             (name, desc) = arg
             if desc is not None and desc != "":