[vala] Add stub dova profile
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Add stub dova profile
- Date: Sat, 13 Mar 2010 19:29:38 +0000 (UTC)
commit 68e238eadcd3ed85c4750da3326cd46a0e100314
Author: Jürg Billeter <j bitron ch>
Date: Sat Mar 13 20:01:08 2010 +0100
Add stub dova profile
compiler/valacompiler.vala | 15 ++++++++++++++-
vala/valaprofile.vala | 5 +++--
2 files changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index d654709..b8614bf 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -1,6 +1,6 @@
/* valacompiler.vala
*
- * Copyright (C) 2006-2009 Jürg Billeter
+ * Copyright (C) 2006-2010 Jürg Billeter
* Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
@@ -241,6 +241,9 @@ class Vala.Compiler {
context.profile = Profile.GOBJECT;
context.add_define ("GOBJECT");
context.add_define ("VALA_0_7_6_NEW_METHODS");
+ } else if (profile == "dova") {
+ context.profile = Profile.DOVA;
+ context.add_define ("DOVA");
} else {
Report.error (null, "Unknown profile %s".printf (profile));
}
@@ -278,6 +281,11 @@ class Vala.Compiler {
if (!add_package (context, "gobject-2.0")) {
Report.error (null, "gobject-2.0 not found in specified Vala API directories");
}
+ } else if (context.profile == Profile.DOVA) {
+ /* default package */
+ if (!add_package (context, "dova-core-0.1")) {
+ Report.error (null, "dova-core-0.1 not found in specified Vala API directories");
+ }
}
context.codegen = new CCodeGenerator ();
@@ -313,6 +321,11 @@ class Vala.Compiler {
var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "GLib", null));
source_file.add_using_directive (ns_ref);
context.root.add_using_directive (ns_ref);
+ } else if (context.profile == Profile.DOVA) {
+ // import the Dova namespace by default (namespace of backend-specific standard library)
+ var ns_ref = new UsingDirective (new UnresolvedSymbol (null, "Dova", null));
+ source_file.add_using_directive (ns_ref);
+ context.root.add_using_directive (ns_ref);
}
context.add_source_file (source_file);
diff --git a/vala/valaprofile.vala b/vala/valaprofile.vala
index c3d5591..5210826 100644
--- a/vala/valaprofile.vala
+++ b/vala/valaprofile.vala
@@ -1,6 +1,6 @@
/* valaprofile.vala
*
- * Copyright (C) 2009 Jürg Billeter
+ * Copyright (C) 2009-2010 Jürg Billeter
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -22,5 +22,6 @@
public enum Vala.Profile {
POSIX,
- GOBJECT
+ GOBJECT,
+ DOVA
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]