[gobject-introspection] misc: rewrite extract-gobject-sources.sh to use gobject-public-headers.txt



commit 5c99ebf690f71348612c6fff2f414d045179ebc4
Author: Colin Walters <walters verbum org>
Date:   Tue Jun 7 16:28:05 2011 -0400

    misc: rewrite extract-gobject-sources.sh to use gobject-public-headers.txt
    
    Rather than maintaining our own exclusion list, grab the text file
    generated by commit ab0e9dbfa76e056f875e969c0d7b6e133ec75431 in glib.
    
    Also it is now Python for sanity.

 misc/extract-gobject-sources.sh    |   12 ------------
 misc/update-gobject-annotations.py |   26 ++++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 12 deletions(-)
---
diff --git a/misc/update-gobject-annotations.py b/misc/update-gobject-annotations.py
new file mode 100755
index 0000000..47bd1ed
--- /dev/null
+++ b/misc/update-gobject-annotations.py
@@ -0,0 +1,26 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+if __name__ == '__main__':
+    srcdir = sys.argv[1]
+    sources = []
+    projname = 'gobject'
+    subdir = os.path.join(srcdir, projname)
+    headersfile = os.path.join(subdir, projname + '-public-headers.txt')
+    f = open(headersfile)
+    line = f.read()
+    f.close()
+    for headername in line.split(' '):
+        headername = headername.strip()
+        sources.append(os.path.join(subdir, headername))
+    for sourcename in os.listdir(subdir):
+        if sourcename.endswith('.c'):
+            sources.append(os.path.join(subdir, sourcename))
+    os.execv('./g-ir-annotation-tool',
+             ['./g-ir-annotation-tool', '--extract', '-DGOBJECT_COMPILATION',
+              '-I' + srcdir,
+              '-I' + os.path.join(srcdir, 'glib'),
+              '-I' + os.path.join(srcdir, 'gobject'),
+              '-I' + os.path.join(srcdir, 'gmodule')] + sources)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]