ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <j_a_fernan...@yahoo.com>
Subject RE: how to set environment variable
Date Mon, 14 May 2001 23:13:24 GMT
> From: Peter Vogel [mailto:pvogel@arsin.com]
>
> -----Original Message-----
> From: Peter Vogel
> Sent: Monday, May 14, 2001 10:41 AM
> To: 'ant-user@jakarta.apache.org'
> Subject: RE: how to set environment variable
>
>
> Within a task:
>
> <env name="foo" value="bar">
>
> Will set an environment variable with the name foo and value bar
> in the environment of the task that includes the env element.  The
> documentation and my interpretation of the code seem to disagree as
> to whether the presence of an env tag completely empties the
> environment
> for the process invoked by the tag or not, the docs say it
> does, the code
> seems to suggest a "newenvironment" attribute on tasks that
> would specify
> whether a new environment is needed or not, but I may have missed
> something...
>

The <env> element will add the task to the exvironment, or replace its
original value. Since in most circumstances processes will not even be able
to start without something in the environment, with "something" being OS
dependant, it makes very little sense to ask for an empty environment.

The last version I know of this code will obtain the current environment
from the system and then use those values (with any modifications you make)
to create the new environment).

> Personally, I think environment management is one of those things that
> needs some significant improvement in ant and I began some hacking on
> that very concept on Friday.  Basically, what I'm thinking of right
> now (for ease of implementation) is another attribute on a
> property tag
> called "export" if that property should be exported to the
> environment of
> all processes.  I'll let you know how it goes...
>

This sound like magic/invisible properties to me. Shouldn't this be done
using templates?

Jose Alberto

> -Peter
>
> > -----Original Message-----
> > From: robby [mailto:zengzhon@yahoo.com]
> > Sent: Monday, May 14, 2001 1:25 AM
> > To: ant-user@jakarta.apache.org
> > Subject: how to set environment variable
> >
> >
> > Hi all,
> >
> >      I'm a new user of ant, just want to know what the tag i need
> > to use to set an environment variable in windows. it works just
> > as typing
> >          set a=b
> > in Dos prompt.
> >      Can anyone help me? thanks.
> >
> > robby
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
>


Mime
View raw message