ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Peerman" <cpeer...@mpc-data.co.uk>
Subject Try task
Date Thu, 14 Nov 2002 15:14:31 GMT
I have developed a Try Task which calls another target on a "Build
Exception", I have been using it now to two weeks and it seems to work quite
well.

  <?xml version="1.0"?>

  <project name="TryExample" default="main" basedir=".">
    <!-- Used to load the task -->
    <taskdef name="try" classname="ant.Try"/>

    <!-- Main build method -->
    <target name="main">
      <!-- Try is a wrapper for other tasks. If an error occurs the target
           errorhandler is called
      -->
      <try handler="errorhandler">
        <javac srcdir="." destdir="."/>
      </try>
    </target>

    <target name="errorhandler">
      <echo "error occured"/>
    <target/>
  </project>

I was wondering whether it would be useful in the ANT project.

Yours sincerely,


Christopher Peerman.



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


Mime
View raw message