You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by lo...@apache.org on 2012/10/28 01:24:58 UTC

[lucy-commits] git commit: refs/heads/master - Added two new method/binds to the CFC Hierarchy class: -add_source_dir -add_include_dir Wired them in the Rakefile

Updated Branches:
  refs/heads/master bf6174ced -> b7ce587ba


Added two new method/binds to the CFC Hierarchy class:
-add_source_dir
-add_include_dir
Wired them in the Rakefile


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/b7ce587b
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/b7ce587b
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/b7ce587b

Branch: refs/heads/master
Commit: b7ce587ba865e1da799577d83d65861ff91d6e61
Parents: bf6174c
Author: Logan <lo...@gmail.com>
Authored: Sat Oct 27 16:14:49 2012 -0700
Committer: Logan <lo...@gmail.com>
Committed: Sat Oct 27 16:14:49 2012 -0700

----------------------------------------------------------------------
 clownfish/compiler/ruby/Rakefile            |    4 +++
 clownfish/compiler/ruby/ext/Clownfish/CFC.c |   24 +++++++++++++++++++++-
 2 files changed, 27 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/b7ce587b/clownfish/compiler/ruby/Rakefile
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/Rakefile b/clownfish/compiler/ruby/Rakefile
index a917327..72aac98 100644
--- a/clownfish/compiler/ruby/Rakefile
+++ b/clownfish/compiler/ruby/Rakefile
@@ -47,6 +47,10 @@ task :clownfish => [:parse_y_files] do
 
   require_relative 'ext/Clownfish/CFC'
   hierarchy = Clownfish::CFC::Model::Hierarchy.new(:dest => "autogen")
+
+  hierarchy.add_source_dir('../core')
+  #heararchy.add_source_dir('ext')
+  hierarchy.add_source_dir('autogen/source')
   hierarchy.build
   
   core_binding = Clownfish::CFC::Binding::Core.new(:hierarchy => hierarchy, :header => autogen_header, :footer => '')

http://git-wip-us.apache.org/repos/asf/lucy/blob/b7ce587b/clownfish/compiler/ruby/ext/Clownfish/CFC.c
----------------------------------------------------------------------
diff --git a/clownfish/compiler/ruby/ext/Clownfish/CFC.c b/clownfish/compiler/ruby/ext/Clownfish/CFC.c
index 25f7c41..155bbc5 100644
--- a/clownfish/compiler/ruby/ext/Clownfish/CFC.c
+++ b/clownfish/compiler/ruby/ext/Clownfish/CFC.c
@@ -40,7 +40,7 @@ S_CFC_Binding_Core_Init(VALUE self_rb, VALUE params) {
     VALUE header    = rb_hash_aref(params, ID2SYM(rb_intern("header"))); 
     VALUE footer    = rb_hash_aref(params, ID2SYM(rb_intern("footer"))); 
 
-    Data_Get_Struct(hierarchy,CFCHierarchy,hierarchy_obj);
+    Data_Get_Struct(hierarchy, CFCHierarchy, hierarchy_obj);
     Data_Get_Struct(self_rb, CFCBindCore, self);
 
     self = CFCBindCore_new(hierarchy_obj, StringValuePtr(header), StringValuePtr(footer));
@@ -91,6 +91,26 @@ S_CFC_Hierarchy_Init(VALUE self_rb, VALUE params) {
 }
 
 static VALUE
+S_CFC_Hierarchy_Add_Source_Dir(VALUE self_rb, VALUE source_dir) {
+    CFCHierarchy *self;
+
+    Data_Get_Struct(self_rb, CFCHierarchy, self);
+    CFCHierarchy_add_source_dir(self, StringValuePtr(source_dir));
+
+    return Qnil;
+}
+
+static VALUE
+S_CFC_Hierarchy_Add_Include_Dir(VALUE self_rb, VALUE include_dir) {
+    CFCHierarchy *self;
+
+    Data_Get_Struct(self_rb, CFCHierarchy, self);
+    CFCHierarchy_add_include_dir(self, StringValuePtr(include_dir));
+
+    return Qnil;
+}
+
+static VALUE
 S_CFC_Hierarchy_Build(VALUE self_rb) {
     CFCHierarchy *self;
 
@@ -106,6 +126,8 @@ S_init_Hierarchy(void) {
     rb_define_alloc_func(cHierarchy, S_CFC_Hierarchy_Alloc);
     rb_define_method(cHierarchy, "initialize", S_CFC_Hierarchy_Init, 1);
     rb_define_method(cHierarchy, "build", S_CFC_Hierarchy_Build, 0);
+    rb_define_method(cHierarchy, "add_source_dir", S_CFC_Hierarchy_Add_Source_Dir, 1);
+    rb_define_method(cHierarchy, "add_include_dir", S_CFC_Hierarchy_Add_Include_Dir, 1);
 }
 
 void