You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Diane Holt <ho...@yahoo.com> on 2000/10/02 07:54:45 UTC

if/unless at the task level?

Would it be too difficult/weird/impossible to have if/unless available at
the task level instead of only at the target level? Would you be able to
do it in Task.java and have it be available to all the tasks that do
"extends Task" (or MatchingTask), rather than having to go thru and change
each task's .java file?  I've been "pseudo-coding" a large target, and
including if/unless in the tasks that comprise it (just as a reminder for
now), but I'm looking at it, and it'd sure make for a much more compact
(and I think easier to follow) build-file if it was actually workable that
way, instead of having to have a separate target for each task that has a
conditional execution.

Thanks,
Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/

Re: if/unless at the task level?

Posted by Nico Seessle <ni...@seessle.de>.
----- Original Message -----
From: <pj...@cs.latrobe.edu.au>
To: <an...@jakarta.apache.org>
Sent: Monday, October 02, 2000 8:00 AM
Subject: Re: if/unless at the task level?


> I don't think it makes sense conceptually. Targets are units
> of work in building a dependancy system.

And it make sense conceptually to be required to define targets like these?

  <target name="vssHistoryAndLabel" unless="vss.result">
    <antcall target="vssHistoryAndLabel-dummy"/>
  </target>

  <target name="vssHistoryAndLabel-dummy" unless="local">
    <someWorkHere/>
  </target>

These aren't 'units of work', these are ugly hacks to check for two
properties...

Nico



Re: if/unless at the task level?

Posted by pj...@cs.latrobe.edu.au.
On Sun, 1 Oct 2000, Diane Holt wrote:
> Would it be too difficult/weird/impossible to have if/unless available at
> the task level instead of only at the target level? Would you be able to
> do it in Task.java and have it be available to all the tasks that do
> "extends Task" (or MatchingTask), rather than having to go thru and change
> each task's .java file?  I've been "pseudo-coding" a large target, and
> including if/unless in the tasks that comprise it (just as a reminder for
> now), but I'm looking at it, and it'd sure make for a much more compact
> (and I think easier to follow) build-file if it was actually workable that
> way, instead of having to have a separate target for each task that has a
> conditional execution.

I don't think it makes sense conceptually. Targets are units
of work in building a dependancy system. Each unit has many
tasks but how can you tell which tasks are allowable to be
elided via if/unless and which aren't ? Obviously a mkdir
has to occur before a copy but this again puts the
complexity in hands of ant user rather than developer which
is a bad thing IMHO. Similar reasoning why for/while/if/then
constructs are not wanted in core task.

Cheers,

Pete

*--------------------------------------------------*
| Latrobe University,     | Does the name 'Pavlov' |
| Bundoora, Australia     |    ring a bell ?       |
*--------------------------------------------------*