It fails for me with Ant 1.7.1 but works with 1.8.0 so I'd be inclined to point the finger towards Ant. I didn't look in the Ant sql task code although I wouldn't be surprised to see a System.exit() somewhere in there given the abrupt termination behavior.
alex On Mon, Feb 22, 2010 at 5:03 PM, Rhett Sutphin <[email protected]>wrote: > Hi, > > 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. > > Thanks, > Rhett > > ------ Example buildfile ------ > > require 'buildr' > > repositories.remote << "http://repo1.maven.org/maven2" > > define 'foo' do > task 'postgresql' do > ant('test') do |ant| > ant.sql :driver => 'org.postgresql.Driver', > :classpath => > artifact("postgresql:postgresql:jar:8.2-504.jdbc3").to_s, > # 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';" > end > info "SQL finished" > end > end >
