tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: Ant
Date Fri, 10 Dec 1999 11:54:00 GMT
Costin.Manolache@eng.sun.com wrote:
> 
> > Well, I love automatic things, but not those behind my back. This
> > because tomorrow I know I won't remember the syntax of the file
> > _automatically_ called (I never do in UNIX shells) and I have to look
> > them up every time.
> 
> Ok, what about
> <propertiesfile name=xxx >
> with the behavior:
> - load xxx.properties
> - load xxx.OS.ARCH.properties
> - load ~/.xxx.properties  ?
> 
> The ideea is to have a way to use the same build.xml for multiple
> platforms - of course, you can also do
> <propfile name="xxx${java.os}.${java.arch}" />
> 
> About properties name - we should try to have a set of "well-known"
> names:
> 
> - dist directory
> - ftp directory ( or where you put the .ziped package to be pulled out nightly)
> - tstamp and dstamp ( for nightly builds ) ( it can be another tag that sets it,
> but we should use it consistently)
> 
> Also, I am thinking about tags like <apache-home> that will search in well-known
> locations for apache and set the apache_home property ( same for other packages
> we depend on ).

Isn't this getting too much "tomcat-driven"? I totally understand your
problems and your solutions and I think they could be great for a tomcat
builder, but I'm afraid of doing too many things behind my back.

Something like

<propfile name="xxx.properties"/>
<propfile name="xxx-${java.os}-${java.arch}.properties"/>
<propfile name="~/.xxx.properties"/>

  vs.

<propfile name="xxx"/>

the first is more verbose but the second is hidden and given the lack of
docs, I should go straight into the code to see what happens there.
Might get harder to see what's done.

> > Properties are defined in the build.xml file or in external files to
> > reduce verbosity and to allow property-dependent operation. I don't
> > think we need anything else.
> 
> Agree, but some properties have os-dependent value.
> Like ftp home.
> And some are hard to express in build.xml - like TSTAMP.

Hmmm, I wonder... we have tasks and we have properties, what we miss is
a task that generates a property. Something like

 <property name="stamp" type="timestamp" .../>

in general
  
 <property name="(property name)" type="(prop-task to call)" xxx="yyy"
.../>

where we should define a new "property-generator task" which has a
slightly different mapping than for the other tasks but keeps the same
model for introspection with attributes.

What do you think?
 
> > Ok, let's clear things out
> >
> > <project>
> >  <target name="init">
> >   <property name="" value=""/>
> >   <properties file=""/>
> >  </target>
> >
> >  <target>
> >   ...
> >  </target>
> > </project>
> >
> > is this right?
> 
> Yes.
> Also, taskdef will go into init, plus any other task that set properties
> ( like apache-home or coocon-home )

Again, I'm _very_ afraid of going in this direction since we loose focus
on portability. If we had namespace support we could add a sort of
"taglib", but you don't want to get that complex at this point.

I think we should try to reduce the number of elements to a minimum and
increase their power instead of cloning them everytime something
slightly different is needed. In this direction goes the <java> element
I've created to allow you to execute any java code thru reflection
(Xalan, and as soon as I know what's wrong Stylebook).
 
> > > Another aproach would be to load system properties automatically,
> > > without an explicit <default-properties>.
> >
> > I thought system properties were already copied over to Ant? isn't it
> > so?
> 
> Yes, I was thinking about the extra properties we need for building.
> 
> >  <if class="org.apache.xalan.xslt.XSLTProcessor">
> >   <task .../>
> >  </if>
> 
> I like this, but it is very dangerous - people will use ant as a scripting
> language, and that's bad.
> The logic and conditionals should be in tasks code.

True, good point.
 
> What about having a
> <calltarget name="xalan" ifdefined="...." />  ?

Nice, I like this.

Comments anyone?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche



Mime
View raw message