开发者

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" />
  1. Creating a batch file with all the environment variables. I have something like this in my ANT Build.xml Calling runCompile

Ant: Unable to process environment variables set and working directoy

  1. I then try to call CMAKE

    Ant: Unable to process environment variables set and working directoy

Problems i am facing are:

  1. 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 value

  2. When 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜