ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject Re: cvs commit: jakarta-ant/src/main/org/apache/tools/ant/helper ProjectHelperImpl.java
Date Wed, 31 Jul 2002 10:18:49 GMT
From: "Stefan Bodewig" <bodewig@apache.org>

> On Wed, 24 Jul 2002, <costinm@covalent.net> wrote:
> 
> > But I think what we should fix is -projecthelp
> 
> How can you fix it?  You'd still need to execute <import> if you want
> to list the imported targets as well, don't you?
> 

I still do not understand why side issue of -projecthelp has to be the guiding 
principle for how the entire system will behave. In particular, -projecthelp could
use its own different ProjectHelper that executes hardly anything, and live everything
else simple.

> > and make clear that whatever is at top level will be executed after
> > the xml file is read, regardless of the target name to be executed.
> 
> Not nice IMHO.
> 
> > And we should recommend that only 'initialization' tasks 
> > should be at top level
> 
> +1 - together with some examples of what we consider "'initialization'
> tasks".  My list would be all property setting tasks as well as
> taskdef and typedef.  Others?
> 

Any task that can set a property should be in this list. That includes 
<condition> for example, some tasks from some of the VCS systems
that set a property, etc.

> > - however I don't think we should enforce this too strongly,
> 
> Can we at all?

I will try to present a different argument on how to view this problem:
If you take a look at *MAKE* one option they have and we do not is
(I think) -n which allows to run the makefile without executing the commands.

This is easy in MAKE because of the separation between shell lines whose
execution is controlled by this option, and variable declarations and such
still executed by MAKE. What we need is this functionality. With that, we could
have a "-dryrun" option that executes nothing (almost nothing) and it could be
used by the "-projecthelp" option in order to get the behaviour we are fighting about.

So here is my view on how to achive this in ANT1.x:

1) Add a new method to the basic Task definition:

    public void executeDryRun() { /* Defined as do nothing  but could just log something */
}

2) Modify the perform() method to either call "execute()" or "executeDryRun" depending
on the type of execution.

3) Modify things that we think should be evaluated during a dryrun as follows:

    public void executeDryRun() { execute(); }

4) Make -projecthelp implicitly set -dryrun.

With this, I think we can solve all the issues: keep <import> working fine, 
keep the -projecthelp camp happy, get some new useful functionality out of all this,
and it is easy to document ("The <property> task executes on dry runs").1

Makes it very simple and understandable.

Please lets agree on something and move on.

Jose Alberto



--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message