ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Corsi <cco...@exceloncorp.com>
Subject Re: Question about properties and ant2
Date Thu, 13 Sep 2001 15:26:42 GMT
> From: Peter Donald <donaldp@apache.org>
> 
> On Wed, 12 Sep 2001 05:34, Claudio Corsi wrote:
> > > From: Peter Donald <donaldp@apache.org>
> > >
> > > sorta. Theres two issues in that. Are properties immutable (ie unable to
> > > be changed) ? and will "configuration" of tasks pick this up? The first
> > > issue (ie making properties mutable rather than immutable) had no clear
> > > consensus IIRC. The second issue is mostly true of current ant *except*
> > > in certain rare occurences (when the same task is executing multiple
> > > times - like from a script but property values have changed). We will
> > > just fix this minor and rare case and thus allow easier manipulation of
> > > ant systems from your favourite scripting language
> > > (javascript/python/whatever).
> >
> > This said, then how would I go about including a variable within the xml
> > file that is immutable and can be used throughout the xml file? If this
> > does not exist, can something like this be implemented? This can be for
> > ant1 or ant2.
> 
> I think you mean mutable (ie changeable) not immutable. 

Yes, I meant mutable. My thoughts do not always get properly transfered into
words.

> The only real way to 
> do this today is via antcall and setting parameters in the antcall. Antcall 
> actually creates a new Project instance and optionally populates it with 
> property values again.
> 

I must admit that ever since I had sent this e-mail. I have noticed the ant
task and have since implemented the required changes. I was able to do what I
had intended in the first place. That was to divide the project into separate
sub-projects, i.e., separate xml files. These sub-projects include projects
that depends on properties being defined. These properties are dynamic and
conform to the condition that they are immutable, i.e., they are defined within
the calling xml file.

After implementing these ideas with the ant task. I was able to do exactly what
I was looking for. This reveals my incomplete understanding of how to use
ant. It always frustrates me when we always lack time to fully understand
something before using it. This is what life is all about.

> > The reason is that I have a project that includes multiple targets that
> > perform the same tasks but that certain variables are different for each
> > task. I thought of creating a single target that is called by the other
> > targets. This target uses properties to determine how to run the given
> > target.
> 
> This is what has been termed templating and ant1.x really doesn't support 
> this well at all. Depending on your specific requirements antcall may work 
> for you.
> 

It seems to me that this might be a good idea but I wonder if this is taking
ant to far?

> > The reason behind the implementation of these targets is that our xml file
> > is starting to become large. I started to refractor the xml file to make it
> > simpler to add new targets without adding too much to the xml file. This is
> > where this idea came from and I really believe that this concept should be
> > added if not already their.
> 
> Support for these functions will be added in time (I have been calling for it 
> for about a year now) but it is unlikely to happen before Ant2.
> 

I guess I have become skeptical because of the fact that this feature can
produce a single build.xml file that will include all the target. While being
forced to use multiple xml files that are called by a top level build.xml file
will enforce the concept of modularity. I must admit that I might not fully
understand what you meant. If that is the case, I would like an
example/clarification of what you propose.

Thanks again for your response and insight.

--Claudio

> -- 
> Cheers,
> 
> Pete
> 
> ----------------------------------------------
> Money is how people with no talent keep score.
> ----------------------------------------------

Mime
View raw message