ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael J McGonagle <fnd...@rcnchicago.com>
Subject Re: test environment variable and if statement
Date Tue, 05 Feb 2002 03:24:50 GMT
Diane Holt wrote:
> 
> --- Erik Hatcher <jakarta-ant@ehatchersolutions.com> wrote:
> > Ignore the shell/bat script troll....
> >
> > Ok, from an environment variable:
> >
> >     <property environment="env"/>
> >     <path id="classpath">
> >       <pathelement location="${env.HELPER_JAR}"/>
> >     </path>
> >
> > Better?  No <condition>, no shell script (well, ok, ant.bat/.sh) , nice
> > and simple.
> 
> But you don't really want to rely on environment variables that are just
> (supposedly) set, do you?  IMO, that's even scarier than hard-coding full
> paths in the build-file (which I'm also not altogether for, but it's
> better than going with env vars -- unless they're set in a file somewhere
> that's source-controlled).

This thread is very timely for me, I have been thinking about this, not
so much about using environment variables. I have a GUI for a command
line to a program that has numerous options. I would like to be able to
store the options that the user selects in the GUI in a properties file,
and then call a custom task that reads the properties file and performs
the task based on those properties. I am hoping to be able to store
these "property sets" and use them for templates to using this program.
(I am also kind of enamered with BeanShell, so I was thinking of have
some of the 'values' in the properties be BeanShell scripts which
resolve to what ever the parameter required  for the program).

Ok, now tell me if this is doable with Ant? I seem to remember reading
(skimming) that property files can be loaded and used by tasks as their
parameters.

Thanks,

Mike

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message