buildr-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rhett Sutphin <>
Subject Does the SQL ant task work in buildr for anyone else?
Date Tue, 23 Feb 2010 01:03:16 GMT

I've been trying to track down an intermittent failure in my build  
script and I've discovered a repeatable problem with the sql ant task  
in buildr.  When you execute the 'foo:postgresql' task in the  
buildfile below, the "SQL finished" line is never printed.  The SQL  
gets executed, but then buildr just exits.  There's no error and the  
usual "Completed in ..." message isn't printed.

If you use an invalid SQL statement (or database, etc.), you get an  
error from ant which buildr bubbles up, as expected.  The behavior  
seems to be the same with buildr on MRI and JRuby.  The problem isn't  
database-dependent -- I see the same thing with HSQLDB and Oracle.  An  
equivalent ant script behaves as expected.  If I use the src attribute  
and an external file instead of pcdata, I see the same weird behavior.

I use antwrap for other things in my buildfile and none of them act  
like this.  I'll file a bug, but first I wanted to see if 1) anyone  
else uses the sql ant task in buildr and 2) either does or doesn't  
have this problem.


------ Example buildfile ------

require 'buildr'

repositories.remote << ""

define 'foo' do
   task 'postgresql' do
     ant('test') do |ant|
       ant.sql :driver => 'org.postgresql.Driver',
         :classpath => artifact("postgresql:postgresql:jar: 
         # some actual database
         :url => 'jdbc:postgresql:test',
         # and credentials
         :userid => 'rsutphin',
         :password => '',
         # some valid SQL statement for that database
         :pcdata => "UPDATE sites SET name='foo' WHERE name='foo';"
     info "SQL finished"

View raw message