You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Raja Nagendra Kumar <Na...@tejasoft.com> on 2008/04/30 17:29:32 UTC

read environment variables set by bat file, which is run by ant exec task

Hi,

Is it possible to read the properties which are set by bat file (this bat
file is run with in ant using exec command. Basically teh bat file should
run in the same process.. tried spam="false" in exec but does not work..

 <exec executable="cmd" spawn="false">
	<arg line="/c ${foundation.root}/common/buildutils/bat/auto.bat"/>
    </exec>

    <property environment="env"/>


The above one should have all the properties as set by auto.bat.


I know it is a bad way.. but for some time, I am looking for such solution..

Regards,
Nagendra
-- 
View this message in context: http://www.nabble.com/read-environment-variables-set-by-bat-file%2C-which-is-run-by-ant-exec-task-tp16985423p16985423.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Re: read environment variables set by bat file, which is run by ant exec task

Posted by Steve Loughran <st...@apache.org>.
Raja Nagendra Kumar wrote:
> Hi,
> 
> Is it possible to read the properties which are set by bat file (this bat
> file is run with in ant using exec command. Basically teh bat file should
> run in the same process.. tried spam="false" in exec but does not work..
> 
>  <exec executable="cmd" spawn="false">
> 	<arg line="/c ${foundation.root}/common/buildutils/bat/auto.bat"/>
>     </exec>
> 
>     <property environment="env"/>
> 
> 
> The above one should have all the properties as set by auto.bat.
> 
> 
> I know it is a bad way.. but for some time, I am looking for such solution..
> 
> Regards,
> Nagendra

doesnt work; environment inheritance rules and the like

What is good is
-echo things out as a .properties file
-load it in
or:
-echo stuff out to the console and parse it somehow

-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

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