Hi,

I'm using Ant. In our development shop, people are allowed to have different machine setups - different install directories for containers, different drive letters, etc.

I'm looking for a simple way to allow these differences to be configurable, but still have defaults. Specifically, I'd like the default to come from the Ant properties file, but be overridden by environment variables, if they exist. This way, if people use the default, they don't have to make any env vars, but if they insist on being different, all they need to do is set the appropriate env var.

We store the properties file in CVS, so it gets overwritten with a full checkout from CVS, so modifying the properties file isn't a good option.

I currently do it by making a dependency target for each property, like this:

<!-- Get the wl.home property from either the environment or properties file -->
<target name="get.wl.home">
<condition property="wl.home" value="${env.WL_HOME}">
<isset property="env.WL_HOME" />
</condition>
<condition property="wl.home" value="${properties.wl.home}">
<isset property="properties.wl.home" />
</condition>
<echo message="WL_HOME property = ${wl.home}"/>
</target>


However, this is a pain because I have to make a custom target like this for each different property.

Is there a more elegant way to approach this problem, preferably in a way that doesn't require a custom task for each different property?

Thanks,
Chad


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



Reply via email to