[vala/switch-to-gir: 25/49] vapigen: Fix marking gir metadata as source.
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 25/49] vapigen: Fix marking gir metadata as source.
- Date: Thu, 10 Mar 2011 21:40:44 +0000 (UTC)
commit dec099ad34215b8a37df30421d8bc823d11b41ed
Author: Luca Bruno <lucabru src gnome org>
Date: Thu Dec 23 14:31:19 2010 +0100
vapigen: Fix marking gir metadata as source.
vapigen/valavapigen.vala | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/vapigen/valavapigen.vala b/vapigen/valavapigen.vala
index 573a3a7..3247aa3 100644
--- a/vapigen/valavapigen.vala
+++ b/vapigen/valavapigen.vala
@@ -122,7 +122,7 @@ class Vala.VAPIGen : Object {
if (context.report.get_errors () > 0) {
return quit ();
}
-
+
foreach (string source in sources) {
if (FileUtils.test (source, FileTest.EXISTS)) {
context.add_source_file (new SourceFile (context, SourceFileType.PACKAGE, source));
@@ -169,10 +169,16 @@ class Vala.VAPIGen : Object {
}
if (file.filename in sources) {
file.file_type = SourceFileType.SOURCE;
- } else if (file.filename.has_suffix (".metadata")) {
- string gir_filename = "%s.gir".printf (file.filename.substring (0, file.filename.length - ".metadata".length));
- if (gir_filename in sources) {
- file.file_type = SourceFileType.SOURCE;
+ if (file.filename.has_suffix (".gir")) {
+ // mark relative metadata as source
+ string? metadata_filename = context.get_metadata_path (file.filename);
+ if (metadata_filename != null) {
+ foreach (SourceFile metadata_file in context.get_source_files ()) {
+ if (metadata_file.filename == metadata_filename) {
+ metadata_file.file_type = SourceFileType.SOURCE;
+ }
+ }
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]