You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Klara Ward <kl...@appeal.se> on 2003/01/07 17:35:08 UTC

Setting environment variables with ant?

Is it possible to set environment variables with ant?

/klara


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Getting program outputs into ant value?

Posted by Brad Cox <bc...@virtualschool.edu>.
Pardon what must be a newbie question; I'm new to this.

I provide MD5 checksums within the download page for the Java+ 
Preprocessor (http://virtualschool.edu/java+). I've been editing them 
in manually but would like to automatate this step.

I understand I can write this in index.html

	<dt><a href="JavaPlus.tgz">Binary Distribution</a> md5:@md5.bin</dt>

and filtering will patch it in

	<filter token="md5.bin" value="..."/>

But how do I get the output of running md5 on this file into the ... above?

PS: I know about the <checksum> in the latest release. I want to 
stick with 1.4.x for the nonce, and besides, <checksum> puts it in a 
file which leaves me where I started.
-- 

Brad Cox, PhD; bcox@virtualschool.edu 703 361 4751 http://virtualschool.edu
>  For industrial age goods there were checks and credit cards.
>    For everything else there is http://virtualschool.edu/mybank
>  Java Web Application Architecture: http://virtualschool.edu/jwaa
>  Ruby Interactive Learning Environment: http://virtualschool.edu/ile
>  Java+ Preprocessor: http://virtualschool.edu/java+
>  Support Israel and Palestine: http://virtualschool.edu/mideast

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting environment variables with ant?

Posted by Matt Benson <gu...@yahoo.com>.
To be explicit, if you only need to set environment
variables for the duration of the Ant build, you will
presumably be using the
<property environment="prefix" /> task.  Then you can,
in a way, set environment variables for use in the
build.  If you want to override the environment
setting for a property "ABC", for example, merely
specify
<property name="prefix.ABC" value="value" /> prior to
the
<property environment="prefix" /> task.  If you want
the environment setting to take precedence, reverse
that order.  The immutability of properties inherent
in Ant will set precedence accordingly.

-Matt


--- Antoine Levy-Lambert <le...@tiscali-dsl.de>
wrote:
> - In the exec task, it is possible to set
> environment variables as nested
> elements.
>   
>
http://jakarta.apache.org/ant/manual/CoreTasks/exec.html
> 
>  - I don't know if ant can change its own set of
> environment variables while
> running.
> If you are making a build file where a number of
> tasks are going to require
> some environment variables,
> maybe you should make a wrapper shell script for
> your build file which sets
> the environment variables.
> 
> Yours
> 
> ----- Original Message -----
> From: "Klara Ward" <kl...@appeal.se>
> To: "Ant Users List" <an...@jakarta.apache.org>
> Sent: Tuesday, January 07, 2003 5:35 PM
> Subject: Setting environment variables with ant?
> 
> 
> > Is it possible to set environment variables with
> ant?
> >
> > /klara
> >
> >
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting environment variables with ant?

Posted by Antoine Levy-Lambert <le...@tiscali-dsl.de>.
- In the exec task, it is possible to set environment variables as nested
elements.
   http://jakarta.apache.org/ant/manual/CoreTasks/exec.html

 - I don't know if ant can change its own set of environment variables while
running.
If you are making a build file where a number of tasks are going to require
some environment variables,
maybe you should make a wrapper shell script for your build file which sets
the environment variables.

Yours

----- Original Message -----
From: "Klara Ward" <kl...@appeal.se>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Tuesday, January 07, 2003 5:35 PM
Subject: Setting environment variables with ant?


> Is it possible to set environment variables with ant?
>
> /klara
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting environment variables with ant?

Posted by Erik Price <ep...@ptc.com>.

Erik Hatcher wrote:
> Huh?
> 
> Klara asked if it was possible to *set* environment variables with Ant. 
>  That page refers to the environment variables that the Ant wrapper 
> scripts use.

Whoops, my bad.  I had just read the page on environment variables 
yesterday, and read Klara's words faster than my brain could process them.



Erik


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting environment variables with ant?

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
Huh?

Klara asked if it was possible to *set* environment variables with Ant. 
  That page refers to the environment variables that the Ant wrapper 
scripts use.

No, its not really possible to set environment variables within Ant 
that persist outside its execution - at least not in a cross-platform 
way.  But launching programs from within Ant can take on new 
environment variables for the duration of that spawned execution.

	Erik


On Tuesday, January 7, 2003, at 11:38  AM, Erik Price wrote:
> Yes, see this page:
> http://jakarta.apache.org/ant/manual/running.html#envvars
>
>
> Erik
>
> Klara Ward wrote:
>> Is it possible to set environment variables with ant?
>> /klara
>> -- 
>> To unsubscribe, e-mail:   
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Setting environment variables with ant?

Posted by Erik Price <ep...@ptc.com>.
Yes, see this page:
http://jakarta.apache.org/ant/manual/running.html#envvars


Erik

Klara Ward wrote:
> Is it possible to set environment variables with ant?
> 
> /klara
> 
> 
> -- 
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>