我试图用Ant做到这一点:
<property name="test" value="123"/>
<target name="helloworld" depends="${test}"/>
Run Code Online (Sandbox Code Playgroud)
但是我收到错误"这个项目中不存在Target $ {test}."
所以我猜我能做到这一点?
您可以使用AntCall任务在另一个任务中调用任务.
<project>
<target name="asdf">
<property name="prop" value="qwer" />
<antcall target="${prop}" />
</target>
<target name="qwer">
<echo message="in qwer" />
</target>
</project>
Run Code Online (Sandbox Code Playgroud)
要使一个依赖另一个,您可以在从属任务中设置一个参数,并在您的调用任务中进行检查.
| 归档时间: |
|
| 查看次数: |
6059 次 |
| 最近记录: |