ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Weintraub <qazw...@gmail.com>
Subject Re: ANT enhancements
Date Mon, 15 Jun 2009 17:27:23 GMT
You might be interested in the AntContrib package. This package allows you
to include full if/else logic inside a target without having to define a
separate targets.

<target name="my.target">
   <if>
     <condition.../>
     <then>
         <yadda, yadda, yadda/>
     </then>
    <else>
        <blah, blah, blah/>
   </else>
  <if>
  <and so on.../>
</target>

The big disadvantage of AntContrib is that you have to install it in
addition to Ant. Yes, AntContrib is just a single Jarfile, but it's an extra
step that many developers simply don't do, and then want to know why your
Ant script doesn't work.

Ant Contrib also contains all sorts of nice to have tasks (such as
try/throw, forloops,

Take a look at <http://ant-contrib.sourceforge.net/tasks/tasks/index.html>.

On Mon, Jun 15, 2009 at 12:56 AM, Shawn Castrianni <
Shawn.Castrianni@halliburton.com> wrote:

> Sometimes I wrestle with ANT target depends.  Sometimes I like that any
> dependent target runs even if the current target will not because of an
> if/unless condition.  Sometimes, I don't.  I think the if/unless
> functionality on a target should be increased:
>
> 1. Allow full boolean expressions to be evaluated for if/unless target
> conditions.  I already have a property with a value inside, why make me
> convert it into yet another property where the value is irrelevant but that
> is or is not set to be used in an if/unless condition?  Why make me create
> another target that this target is dependent on just to perform the boolean
> logic and conversion into this new property when the if/unless could perform
> the evaluation directly?
> 2. Make some new attributes on target that perform an if/unless condition
> on the current target AS WELL AS its dependent targets.  Why make me add
> duplicate if/unless conditions all the way up the hierarchy for all of the
> dependent targets just to prevent them from executing as well?  What if
> those dependent targets already have if/unless conditions, then I must
> perform even more work since if/unless conditions do not support full
> boolean expressions?  (See #1)
>
>
> ---
> Shawn Castrianni
>
> ----------------------------------------------------------------------
> This e-mail, including any attached files, may contain confidential and
> privileged information for the sole use of the intended recipient.  Any
> review, use, distribution, or disclosure by others is strictly prohibited.
>  If you are not the intended recipient (or authorized to receive information
> for the intended recipient), please contact the sender by reply e-mail and
> delete all copies of this message.
>



-- 
David Weintraub
qazwart@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message