[vala/switch-to-gir] vapigen: Don't hardcode missing --library, the option must always be set.
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir] vapigen: Don't hardcode missing --library, the option must always be set.
- Date: Mon, 23 Aug 2010 18:11:21 +0000 (UTC)
commit 1f9c1b2b9a8dee21bd9f0ff5b96edeaf7aef5bba
Author: Luca Bruno <lethalman88 gmail com>
Date: Mon Aug 23 20:08:21 2010 +0200
vapigen: Don't hardcode missing --library, the option must always be set.
vapigen/valavapigen.vala | 27 ++++++---------------------
1 files changed, 6 insertions(+), 21 deletions(-)
---
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala
index 0a2c993..e5e80aa 100644
--- a/vapigen/valavapigen.vala
+++ b/vapigen/valavapigen.vala
@@ -168,31 +168,16 @@ class Vala.VAPIGen : Object {
return quit ();
}
- if (library == null && girparser.get_package_names () != null) {
- var names = girparser.get_package_names ();
-
- if (names.length != 1) {
- Report.error (null, "multiple packages encountered and no library name given");
- return quit ();
+ // interface writer ignores external packages
+ foreach (SourceFile file in context.get_source_files ()) {
+ if (!file.filename.has_suffix (".vapi")) {
+ file.external_package = false;
}
-
- library = names[0];
}
- if (library != null) {
- // interface writer ignores external packages
- foreach (SourceFile file in context.get_source_files ()) {
- if (!file.filename.has_suffix (".vapi")) {
- file.external_package = false;
- }
- }
-
- var interface_writer = new CodeWriter ();
- interface_writer.write_file (context, "%s.vapi".printf (library));
+ var interface_writer = new CodeWriter ();
+ interface_writer.write_file (context, "%s.vapi".printf (library));
- library = null;
- }
-
return quit ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]