tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin.Manola...@eng.sun.com
Subject Re: Ant
Date Wed, 08 Dec 1999 06:51:04 GMT
> What about something like
>
>  <properties file="ant-${java.os}.properties"/>
>
> instead?

It is ok too.
DefaultProperties is supposed to do the same thing, automatically
( you may have differences between Linux on Sparc and i386 ).
Also, you may have personal settings ( .ant.properties ).

Look at RPM - they use a similar aproach.

The ideea is not only to load some properties from a file, but to
have a common set of definitions for all projects.
( including the datestamp ).


> > - add Property.java task - it will do exactly the same as the <property>
> > hack
>
> You mean making <property> a task? Hmmm, it is not a task. What do you
> accomplish?

<property> is hardcoded in ProjectHelper - it is hard to change it there.
( like setting only for a particular OS, or anything else).
The problem with property is that it makes everything OS-dependent
( I want to put the final build into ftp public dir - that's OS dependent ).

There are similar "tasks" I'll need - like <apache-home> ( a task that
will look for apache in well-known locations and set APACHE_HOME
property). It would be strange to have some property setters as Tasks
and <property> as a special case in ProjectHelper.

> > - Change Project.java: if a "init" target is defined, that will be
> > executed allways
> > before anything else.
> > All <property/> and <defaultProperties/> defines will be here.
> > A good ideea would be to have TaskDef in the init section too ( with a
> > TaskDef task ).
>
> Let's keep things simple. Look at this pseudo-DTD
>
> <!ENTITY % init 'properties|property'>
> <!ELEMENT project ((%init;)*, target+)>
>
> everything that is before the targets gets executed before the target.

The problem is that ProjectHelper needs to be changed to add anything
before target.

You may have more things to do to init - besides setting properties.
( taskdef is one - probably in time we will discover other )

With <target name=init> it is even simpler - you no longer have property
as a special case, everything follow the same pattern ( project=collection of
targets,
each target= collection of actions).

> I like this, but let's keep things simple.

That is the intention. Property in ProjectHelper is not simple.

Another aproach would be to load system properties automatically,
without an explicit <default-properties>.

Costin



Mime
View raw message