ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Blanc <Sebastien.Bl...@alcatel.com>
Subject Re: Access to Environment Variables other than ANT_HOME of CLASSPATH
Date Wed, 19 Mar 2003 23:28:03 GMT
Hi James !
see inserted.
seb.

James Sinnamon wrote:

> Seb,
>
> On Thu, 20 Mar 2003 09:05, you wrote:
> > <property environment="ejbenv" />
> >
> >  <fileset dir="${ejbenv.JAVA_HOME}/jre/lib">
> >          <include name="rt.jar" />
> > </fileset>
>
> If I set an environment variable such as in the following example:
>
>    export BASE_BOOTIMAGE_COMPILER=1
>    export BASE_RUNTIME_COMPILER=1
>    export NO_GC=1
>    export WITH_CLUSTER=1
>
> ... and then run ant,  will I be able to refer to these variables
> within build.xml?

yes. whatever environment variables are in the shell from witch u launch ANT
are gonna accessible via property environment.

> Basically I am hoping to be able to replace
> some scripts with a few ant targets which use the 'echo' task,
> and will be conditional on the setting of these variables.
> It would be easier to do so if I could do it without having to
> redefine  these environment variables in other files.
>
> > checkout the environment> in doc.
> > seb.
>
> Not sure where to find it.  I have looked at everthing I could find in the
> documentation which is  related to Environment variables in the
> Could you be more specific or show me the URL?
>

go to Core Tasks and then 'basename' or property':
http://ant.apache.org/manual/CoreTasks/basename.html
http://ant.apache.org/manual/CoreTasks/property.html

and - agree with Alexey - this is true that this can be done per
  <property file="${user.home}/.ant-global.properties"/>
which looks like a nicer java way of doing it, then getting rid of ur legacy
shell scripts using configuration variable.

"I am hoping to be able to replace
some scripts with a few ant targets which use the 'echo' task,
and will be conditional on the setting of these variables.
It would be easier to do so if I could do it without having to
redefine  these environment variables in other files."
-> not sure exactly wat u wanna do. can u expand ? are u trying to perform
something different in the script depending on a variable or to just to do
something different in the program u're trying to launch ?

seb.


Mime
View raw message