[vala/switch-to-gir: 5/34] girparser: Parse included GIR files
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 5/34] girparser: Parse included GIR files
- Date: Mon, 1 Nov 2010 17:27:36 +0000 (UTC)
commit f62eabe5bdee54cc1f8135eab26bd7ba1d951fb7
Author: Luca Bruno <lethalman88 gmail com>
Date: Sat Oct 16 22:46:36 2010 -0700
girparser: Parse included GIR files
vala/valagirparser.vala | 7 +++++++
vapigen/valavapigen.vala | 3 +--
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index a09611e..67fc150 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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");
}
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala
index f16e288..58d3ffb 100644
--- a/vapigen/valavapigen.vala
+++ b/vapigen/valavapigen.vala
@@ -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;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]