Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

target conditional and dependency issue

Eric Wood

2008-08-22

Replies: Find Java Web Hosting

Author LoginPost Reply
I have a target that I only want to execute if a property is set, but it
executes the dependencies regardless.
The code looks like this:

  <target name="cruisecleanup" depends="init, clean, prepare,
_cruisecleanup" if="cruise.logs.dir" />

What I have used as a work around is:

  <target name="cruisecleanup" depends="" if="cruise.logs.dir" />
    <runtarget target="run-cruisecleanup">
  </target>

  <target name="run-cruisecleanup" depends="init, clean, prepare,
_cruisecleanup" />

This works, but it doesn't seem very ANT like. Do folks have a better,
way to perform the conditional execution with a dependency list?

Thanks, Eric

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.