ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: Location in non-Task tasks
Date Wed, 13 Sep 2006 20:36:28 GMT
Matt Benson wrote:
> --- Steve Loughran <stevel@apache.org> wrote:
>> Or to have a ConditionTaskBase extends Task. not
>> having condition base 
>> extends task causes lots of fun whenever you have
>> any component that 
>> takes a ref to a nested task with an addTask(Task)
>> thing.
>>
> 
> Steve, I was just reading back through the archives
> and this leapt out at me.  Under what circumstances do
> you have this "lots of fun"?  Does the component
> mentioned implement TaskContainer?  That should be all
> it needs to do, right?  Example:
> 
> <project>
>   <echo file="Foo.java">
> public class Foo{public void
> execute(){System.out.println("foo");}}</echo>
>   <javac srcdir="${basedir}" includes="Foo.java" />
>   <taskdef name="foo" classname="Foo"
> classpath="${basedir}" />
>   <sequential>
>     <foo />
>   </sequential>
> </project>
> 
> output:
> 
> Buildfile: build.xml
>     [javac] Compiling 1 source file
>       [foo] foo
> 
> BUILD SUCCESSFUL
> Total time: 1 second
> 
> This illustrates that there is no special handling for
> the condition task; because Sequential implements
> TaskContainer, <foo> is adapted with no problem.
> 
> What is different about your scenario?

Rummaging through my docs, the trouble comes at the java level, when you 
want to add a subclass of <waitfor> to a sequence.

http://smartfrog.cvs.sourceforge.net/smartfrog/core/extras/ant/src/org/smartfrog/tools/ant/FaultingWaitForTask.java?view=markup
http://smartfrog.cvs.sourceforge.net/smartfrog/core/extras/ant/src/org/smartfrog/tools/ant/FunctionalTestTask.java?view=markup

<functionaltest> is very slick; lets you start something, spins till it 
is running, then runs your tests or other code. And it does cleanup even 
if the test sequence fails.

http://smartfrog.cvs.sourceforge.net/smartfrog/core/extras/ant/test/files/functionaltest.xml?view=markup



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


Mime
View raw message