蚂蚁,对于&LT设置环境变量蚁>任务? [英] Ant, set environmental variable for <ant> task?

查看:174
本文介绍了蚂蚁,对于&LT设置环境变量蚁>任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行其他蚂蚁蚂蚁构建文件和<蚂蚁方式> 任务看上去很适合这个

I want to run another ant build file from ant, and the <ant> task looks perfect for this.

其他构建文件使用环境变量的一对夫妇的事情。有没有一种方法来设置环境变量为孩子蚂蚁进程?

The other build file uses environmental variables for a couple things. Is there a way to set environmental variables for the child ant process?

我看到&LT; EXEC&GT; 任务似乎支持嵌套&LT; ENV&GT; S,但没有类似的&LT;蚂蚁方式&gt;

I see that the <exec> task seems to support nested <env>s, but nothing similar for <ant>.

推荐答案

默认情况下,内部通话蚂蚁继承父属性

by default the inner ant call inherits the parent properties

<ant inheritAll="true" antfile="subproject/subbuild.xml">
  <!--inheritAll="true" is default value, this is unecessary -->

  <property name="myprop" value="foo"/>

  <antcall target="myTarget"></antcall> 
  <ant antfile="myAntFile"></ant>

</ant>

在这种情况下,myTarget和myAntFile所有目标可以得到福为myprop的价值。

In this case, "myTarget" and all targets on "myAntFile" can get "foo" as "myprop" value.

这篇关于蚂蚁,对于&LT设置环境变量蚁&GT;任务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆