You can do something like:

<condition property="foundErrors">
    <available file="errorFile"> (or maybe some other condition)
</condition>
<antcall target="sendErrorEmail"/>

...

<target name="sendErrorEmail" if="foundErrors">
    ...
</target>

The "if" means the target will only run if foundErrors was set to true.

   --Paul

-----Original Message-----
From: Paul Munsey (pmunsey) <[EMAIL PROTECTED]>
To: 'Ant Users List' <[email protected]>
Sent: Tue, 16 Aug 2005 12:27:49 -0700
Subject: Conditional tasks

I'm trying to figure out how to call a task, conditionally. From what I see
I can set properties with a condition, but how can I traslate that to a
task. For example, I only want to send mail to people if errors were found in the build log file. I'll create my own code for parsing the build log,
but depending on the results I may or may not want to send email.

Paul Munsey
[EMAIL PROTECTED]



----------------------------------------------
Mailblocks - A Better Way to Do Email
http://about.mailblocks.com/info


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to