ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marius Scurtescu <mar...@multiactive.com>
Subject Re: TimeStamp dependent target execution
Date Fri, 07 Jul 2000 00:40:54 GMT
glennm@ca.ibm.com wrote:
> 
> The feel I've gotten over the past couple of months is that many of the
> main developers on this project don't want Ant to become another programing
> language with all the attendant "if/else", "while", etc. constructs and
> complexities.  To that end, they are trying to encourage people to write
> very declarative build files, rather than conditional ones.  The
> conditional parts of the builds should happen inside a task, so the task
> only does what it has to and no more.  So we get the statements like "write
> your own task and do it yourself."  They feel, and not unjustly, that
> clarity and simplicity outweigh the advantages offered by adding all the
> trappings of a full blow language.

I was not proposing a full blown language. There are conditionals already
in the syntax, I just taught it would be really useful to have the
time stamp conditional.

What does "declarative" mean anyway? Correct me if I am wrong but my
understanding is that you are supposed to say (declare) what you want
and not how to get it. This does not prevent the use of if statements.

What are the advantages of not having the time stamp conditional:
- simplicity - if you need it and you will have to code it anyhow then
this simplicity is useless
- cleaner build files - the fact that you hide some dependencies
inside a custom task will just make things worse

By not having the time stamp conditional you prevent an easy migration
from make files to ANT and you won't get a broad acceptance.

Marius

> 
> I can't say that I've always agreed with every decision the commiters have
> made, but they are usually willing to discuss the rationale behind their
> decisions.  If you are convincing enough, they will even change their minds
> if it helps the overall goals of the project.  And they are trying to stick
> to their guns, to keep things clean and simple.  For that, I give them a
> +1.
> 
> Glenn McAllister
> TID - Software Developer - VisualAge for Java
> IBM Toronto Lab, (416) 448-3805
> "An approximate answer to the right question is better than the
> right answer to the wrong question." - John W. Tukey
> 
> Please respond to ant-dev@jakarta.apache.org
> 
> To:        ant-dev@jakarta.apache.org
> cc:
> Subject:        TimeStamp dependent target execution
> 
> [IMAGE]
> Hi,
> 
> Quite a few people new to ANT asked if it is possible to
> execute a target/task only if some files are obsolete.
> 
> The standard answer to this is "write your own task and do
> it yourself".
> 
> While this approach may be somewhat OK for a Java programmer
> familiar with the source code of ANT it is not acceptable for
> the general user. Even for a dye hard ANT programmer it would
> be a waste of time to code the same behavior over and over
> again.
> 
> I am new to this mailing list and I am not even close to
> having a good understanding of ANT's architecture. If there
> is a fundamental misunderstanding here it would be nice to
> put an explanation in the documentation so people checking
> out ANT will know what to expect.
> 
> I created a task that will check the time stamps on two
> sets of files, one called source and the other destination.
> If any of the source files is newer than one of the
> destination files or if one of the destination files is
> missing then a property is set. Subsequently a target
> can be executed only if that property is set (using the
> "if" attribute).
> 
> I attached the source file called Obsolete.java to this
> message. Also I attached the build file I am using so
> you get an idea of how you are supposed to use it.
> The main trick is that you have to execute the "obsolete"
> task just before the corresponding target.
> 
> There is room for improvement. The comma separated lists of
> file names don't accept wild cards at this point. Also more
> sophisticated methods of selecting the source and
> destination file sets can be imagined.
> 
> Using this task is not an elegant solution to the
> time stamp problem, it is a hack. It would have been nice
> to include it in the original design.
> 
> Cheers,
> Marius
>

Mime
View raw message