You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Erik Hatcher <li...@ehatchersolutions.com> on 2002/02/25 01:34:35 UTC

Torque Ant Tasks

I have a recommendation for the Torque Ant tasks.  For attributes that are
for file or directory names, change the parameter type from String to File.

For example...

TorqueSQLTask:
    public void setIdTableXMLFile(String idXmlFile)

I tried running this task from a different directory than the build file
itself (master build using <ant> to call a sub-project build).  It failed
because it was looking for a directory relative to my current working
directory rather than relative to Ant's ${basedir}.  Using File would have
taken care of this.

Is that reasonable?  Any reason not to make this change?  I'd submit a
patch, but I wanted to run it by the list first.

    Erik

p.s. I'm not on the -dev list (I get *way* too much e-mail as it is!) - but
the dev folks are here too it seems.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


[PATCH] Re: Torque Ant Tasks

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "Jason van Zyl" <jv...@zenplex.com>

> > Is that reasonable?  Any reason not to make this change?  I'd submit a
> > patch, but I wanted to run it by the list first.
>
> A patch and verification that the testbed passes and that sounds good to
> me.

Ok, here it is, real simple:

cvs -q diff -u src/java/org/apache/torque/task/TorqueSQLTask.java
Index: src/java/org/apache/torque/task/TorqueSQLTask.java
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-torque/src/java/org/apache/torque/task/Torqu
eSQLTask.java,v
retrieving revision 1.9
diff -u -r1.9 TorqueSQLTask.java
--- src/java/org/apache/torque/task/TorqueSQLTask.java 26 Dec 2001
22:24:43 -0000 1.9
+++ src/java/org/apache/torque/task/TorqueSQLTask.java 25 Feb 2002
02:04:46 -0000
@@ -118,9 +118,9 @@
* by the idbroker method.
* @param xml path to file.
*/
- public void setIdTableXMLFile(String idXmlFile)
+ public void setIdTableXMLFile(File idXmlFile)
{
- idTableXMLFile = idXmlFile;
+ idTableXMLFile = idXmlFile.getAbsolutePath();
}

/**



Just changed String -> File
Added .getAbsolutePath().

This is the only task that bit me so far, so I won't submit patches for the
others just yet. But when refactoring, keep in mind that Ant can deal with
attributes that should be files nicer than just a plain ol' String.  :)

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Torque Ant Tasks

Posted by Jason van Zyl <jv...@zenplex.com>.
On Sun, 2002-02-24 at 19:34, Erik Hatcher wrote:
> I have a recommendation for the Torque Ant tasks.  For attributes that are
> for file or directory names, change the parameter type from String to File.
> 
> For example...
> 
> TorqueSQLTask:
>     public void setIdTableXMLFile(String idXmlFile)
> 
> I tried running this task from a different directory than the build file
> itself (master build using <ant> to call a sub-project build).  It failed
> because it was looking for a directory relative to my current working
> directory rather than relative to Ant's ${basedir}.  Using File would have
> taken care of this.
> 
> Is that reasonable?  Any reason not to make this change?  I'd submit a
> patch, but I wanted to run it by the list first.

A patch and verification that the testbed passes and that sounds good to
me. 

> 
>     Erik
> 
> p.s. I'm not on the -dev list (I get *way* too much e-mail as it is!) - but
> the dev folks are here too it seems.
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>