Author: toulmean
Date: Fri Jul 16 23:46:24 2010
New Revision: 964983

URL: http://svn.apache.org/viewvc?rev=964983&view=rev
Log:
making sure hibernate works with the ODE build.

Modified:
    buildr/trunk/addon/buildr/hibernate.rb

Modified: buildr/trunk/addon/buildr/hibernate.rb
URL: 
http://svn.apache.org/viewvc/buildr/trunk/addon/buildr/hibernate.rb?rev=964983&r1=964982&r2=964983&view=diff
==============================================================================
--- buildr/trunk/addon/buildr/hibernate.rb (original)
+++ buildr/trunk/addon/buildr/hibernate.rb Fri Jul 16 23:46:24 2010
@@ -117,12 +117,15 @@ module Buildr
     #       fileset(:dir=>compile.sources.first) { include 
:name=>"**/*.hbm.xml" } }
     #     end
     #   end
-    def hibernate_schemaexport(args)
+    def hibernate_schemaexport(args, &block)
       path, arg_names, deps = Rake.application.resolve_args([args])
-      unless Rake::Task.task_defined?(path)
-        class << file(path) ; attr_accessor :ant ; end
-        file(path).enhance { |task| task.ant = 
Hibernate.schemaexport(hib_resolve_classpath) }
-      end
+      file(path).enhance { |task| 
+        unless task.respond_to? :ant #this is a hack. A better way to do the 
job is to create a real task for all this.
+          class << task ; attr_accessor :ant ; end
+          task.ant = Hibernate.schemaexport(hib_resolve_classpath) 
+        end
+      }  
+      
       if block
         file(path).enhance(deps) { |task| block.call task, task.ant }
       else


Reply via email to