ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: TaskAdapting something that extends WaitFor
Date Thu, 16 Mar 2006 16:07:12 GMT
Matt Benson wrote:
> --- Steve Loughran <stevel@apache.org> wrote:
> 
>> Matt Benson wrote:
>>> How are you invoking it?
>> as a task:
>>
>>      <sf-faultingwaitfor maxwait="2"
>> message="equality failed">
>>        <equals arg1="a" arg2="b"/>
>>      </sf-faultingwaitfor>
>>
>> Its declared as a task too;  in a properties file I
>> load with taskdef. 
>> When it delegated to waitfor it worked, but now that
>> it subclasses it 
>> doesnt  exec.
> 
> Hmm... this works:
> 
> <project default="bar">
>   <property name="src" value="Foo.java" />
>   <available property="gotsrc" file="${src}" />
> 
>   <target name="write" unless="gotsrc">
>     <echo file="${src}">public class Foo extends
>         org.apache.tools.ant.taskdefs.WaitFor {}
>     </echo>
>   </target>
> 
>   <target name="compile" depends="write">
>     <javac srcdir="${basedir}" includes="${src}" />
>   </target>
> 
>   <target name="foo" depends="compile">
>     <taskdef name="foo" classname="Foo"
>              classpath="${basedir}" />
>     <foo maxwait="5" maxwaitunit="second"
>          timeoutproperty="foo">
>       <or />
>     </foo>
>   </target>
> 
>   <target name="bar" depends="foo" if="foo">
>     <echo>$${foo}=${foo}</echo>
>   </target>
> 
>   <target name="clean">
>     <delete>
>       <fileset dir="${basedir}"
>                includes="${src},*.class" />
>     </delete>
>   </target>
> 
> </project>
> 
> So... I dunno... :|

The tests work for me too. Wierd. Whatever, I can't extend WaitFor 
because it doesnt work with the stuff in the other JAR. Which I can't 
replicate in the simpler test case situation.

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


Mime
View raw message