]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add stub dova profile
authorJürg Billeter <j@bitron.ch>
Sat, 13 Mar 2010 19:01:08 +0000 (20:01 +0100)
committerJürg Billeter <j@bitron.ch>
Sat, 13 Mar 2010 19:08:50 +0000 (20:08 +0100)
compiler/valacompiler.vala
vala/valaprofile.vala

index d6547091460671310b0bdfb17a654fc2e43c2291..b8614bf3720819385a04060207f16c04589ad5cb 100644 (file)
@@ -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);
index c3d55914f07dd38bd29a7c05904c8deb062f29db..52108266ec67b2cbdc872fde2fc19a0ed9c09bbe 100644 (file)
@@ -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
 }