Emmanuel FELLER wrote:
Hi,

I read the archive about the recursive properties and I am not convinced
so i would like to reopen the debate. (Or i may have missed the good
mail, if so correct me).

Excuse the long mail, but i prefer explain all my problem.

I do the all J2EE project build of my firm, the build process is exactly
the same for all the 8 projects on the 3 environnements (execpt
properties). So I did build files that accept param and all the param
are given in a properties file.

Now the dev are finishing and we will include some new environnement
like pre-production, production, debugging.

We cannot stay any more with one properties file for 1(project/env). We
had 24 properties file, now we will have more than 50 (and new projects
are comming).

Some properties are project and environnement independant, others are
project dependant, others are environnement dependant, others are both
project and environnement dependant.

So if i keep multiple file (one per project/env couple), i have multiple
and cross redundancy. And i have no way to define the env properties,
after the project properties and after project/env properties as they
are mixed and cross defined. (i tried without succes).

In this case I do not see what I can do to solve this without recursive
properties resolution.

-have multiple properties files...one per deployment target, one per project, one per local installation.


-use property expansion to decide which properties files to load

e.g. a system would have

system.properties:
deploy.target=chamonix

chamonix:properties
deploy.platform=jboss
deploy.process=ftp


jboss.properties: install.buildfile.name=jboss.xml

build.properties:
build.compiler=jikes
deploy.username=stevo
deploy.password=stevo

the project then does

<property file="build.properties/>
<property enviroment="env" />
<property file="system.properties/>

  //loads chamonix.properties
<property file="${deploy.target}.properties/>
//then app server specific stuff
<property file="${deploy.platform}.properties/>

//finally we can call our install routine
<target name="deploy" depends="makewar">
  <ant dir="." buildfile="${install.buildfile.name}" target="deploy" />
</target>

This gives you: dynamic configuration, and property file control. One propfile/build file per app server platform, one per system with sys config details, one per user with user options.


What do you mind ? Should I develope with for an ant-contrib task as you
reject this for ant2
(http://jakarta.apache.org/ant/ant2/requested-features.html) ?

if ant-contrib tasks work for you, use them.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to