ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: scripting tips
Date Tue, 28 Oct 2003 09:30:26 GMT
On Monday, October 27, 2003, at 05:49  PM, Stirling, Scott wrote:
> Anyone know of a site or resources (beyond the Hatcher/Loughran book) 
> for scripting tips with the Ant <script> task?

What?!  You need more?!  :))

> <script> is proving to be a great way to prototype new Ant tasks, but 
> there's a real art to it.  One recurring problem for me as I get the 
> hang of it is learning/remembering you have to know the actual 
> argument type for task setters.

Ant 1.6 has <scriptdef> now.... and this is how I'll be starting Ant 
tasks from now on.

> So, e.g., <unzip src="foo" dest="bar"> corresponds to 
> setSrc()/setDest() methods on the Extract task that take 
> java.io.Files, not Strings.

When does the type information become a problem for you?  It's just the 
initial headache of crafting a call to setSrc, right?   But once you 
match up the types all is well, I'm guessing.

I think this is just going to be a manual type of thing (unless you 
wrote some type detector that morphed strings to the expected type) 
because of the loosely typed language calling into a strongly typed 
language.  Although, Ant itself is doing the String->type conversions 
for regular XML specified tasks, so you could go through that mechanism 
somehow using IntrospectionHelper stuff.

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message