From 68e238eadcd3ed85c4750da3326cd46a0e100314 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrg=20Billeter?= Date: Sat, 13 Mar 2010 20:01:08 +0100 Subject: [PATCH] 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 d65470914..b8614bf37 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 c3d55914f..52108266e 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 } -- 2.47.3