Ant: Unable to process environment variables set and working directoy
I need to set some 10 environment variables before my CMAKE can run.开发者_Python百科 This is what I am doing
Top of my build.xml has the following
<property environment="env" />
Creating a batch file with all the environment variables. I have something like this in my ANT Build.xml Calling runCompile
- I then try to call CMAKE
Problems i am facing are:
I am unable to get any of the environment variables ex: when i try to print
${env.CMAKE_COMMAND}
it prints${env.CMAKE_COMMAND}
and not valueWhen i try to goto working directory and execute the batch file, this also does not work.
Any idea how I can achieve the above?
Sorry I am unable to paste the XML code here. Hence attached as image.
Looking at the exec task documentation you will find a hint about the nested element env. With this it should be possible to specify environment variables to pass to the system command, like shown in the example:
<exec executable="emacs">
<env key="DISPLAY" value=":1.0"/>
</exec>
精彩评论