]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Parse included GIR files
authorLuca Bruno <lethalman88@gmail.com>
Sun, 17 Oct 2010 05:46:36 +0000 (22:46 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Mon, 8 Nov 2010 09:43:18 +0000 (01:43 -0800)
vala/valagirparser.vala
vapigen/valavapigen.vala

index a09611eb0516a962d27a947d4376ea7201fe108b..67fc150b286327909c282c8ed744f9ec15c44de2 100644 (file)
@@ -168,6 +168,13 @@ public class Vala.GirParser : CodeVisitor {
 
        void parse_include () {
                start_element ("include");
+               var pkg = reader.get_attribute ("name");
+               var version = reader.get_attribute ("version");
+               if (version != null) {
+                       pkg = "%s-%s".printf (pkg, version);
+               }
+               // add the package to the queue
+               context.add_external_package (pkg);
                next ();
                end_element ("include");
        }
index f16e288db4937d4a66cf39eafdcef83c7e0832b3..58d3ffbc9393e18319091b86633c4f8efd83e6ac 100644 (file)
@@ -122,7 +122,6 @@ class Vala.VAPIGen : Object {
                                Report.error (null, "%s not found".printf (source));
                        }
                }
-               sources = null;
                
                if (context.report.get_errors () > 0) {
                        return quit ();
@@ -157,7 +156,7 @@ class Vala.VAPIGen : Object {
 
                // interface writer ignores external packages
                foreach (SourceFile file in context.get_source_files ()) {
-                       if (!file.filename.has_suffix (".vapi")) {
+                       if (!file.filename.has_suffix (".vapi") && file.filename in sources) {
                                file.file_type = SourceFileType.SOURCE;
                        }
                }