ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karsten Wutzke" <kwut...@web.de>
Subject Return from task with BUILD SUCCESSFUL?
Date Fri, 11 Apr 2003 01:17:04 GMT
Hi all!

Is there any way in Ant to return from a target *successfully*, that is without printing "BUILD
FAILED"??? I would like a "BUILD SUCCESSFUL" message instead, so <fail> is no go.

I'm using an ant-contrib <trycatch> construct from inside an <if>, that simply
does some checking, and when an exception is caught, I want to print some information and
return from the task from inside the <catch>. Using <throw> from inside the <catch>
raises an exception in the IfTask class...

  <!-- Start local Tomcat -->
  <target name="start-local" depends="check-reach-local" description="Starts local Tomcat.">
    <if>
      <not>
        <isset property="local.unreachable"/>
      </not>
      <then>
        <trycatch>
          <try>
            <fail message="Intentional fail forced! See message below."/>
          </try>
          <catch>
            <echo message="Local Tomcat already running! Won't restart."/>
            <!--return/--> <!-- HOW? -->
          </catch>
        </trycatch>
      </then>
    </if>

  <echo message="Local Tomcat not running! Starting up..."/>

  <!-- START UP TOMCAT -->

  <echo message="Local Tomcat started up."/>

</target>

Any ideas? Stefan?

Karsten

PS: Maybe an ant-contrib <return> task would help?
PPS: Sorry for the <no subject> mail before, please ignore it


______________________________________________________________________________
UNICEF bittet um Spenden fur die Kinder im Irak! Hier online an
UNICEF spenden: https://spenden.web.de/unicef/special/?mc=021101


Mime
View raw message