[英]Define parameter before calling to the depends task in Ant
我想在调用depends任务的目标之前定义参数,例如:
<target name="init">
...
If (mode=true)
Then...
Else...
...
</target>
<target name="Create File" depends="init">
...
...
</target>
我想定义一个名为mode的参数,并给它提供例如true
值,我想在调用depends =“ init”任务之前启动“ Create File”一次,因为我希望Init任务使用此参数
我可以在Ant中做到这一点吗?
谢谢
如果你正在使用你不能做到这一点depends
,但你可以执行init
通过目标antcall任务 。
这是上面链接的一个例子
<target name="Create File">
<antcall target="init">
<param name="param1" value="value"/>
</antcall>
</target>
<target name="init">
<echo message="param1=${param1}"/>
</target>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.