ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: TaskAdapting something that extends WaitFor
Date Wed, 15 Mar 2006 16:05:23 GMT
--- 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... :|

-Matt

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message