如何通过写在蚂蚁的财产? [英] How to over-write the property in Ant?

查看:230
本文介绍了如何通过写在蚂蚁的财产?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法来重新分配为Ant 属性任务的价值?或者是有这个目的提供的另一项任务?

Is there a way to re-assign the value for the Ant property task? Or is there another task available for that purpose?

推荐答案

根据您想如何使用修改后的属性,你可以使用 macrodef 秒。

Depending on how you want to use the modified property, you can use macrodefs.

例如,而不是写以下内容:

For example, instead of writing the following:

<target name="foo">
   <echo message="${my_property}"/>
</target>

和不能够调用蚂蚁富与另一条消息,你可以写:

and not being able to call ant foo with another message, you could write:

<macrodef name="myecho">
    <attribute name="msg"/>
    <sequential>
        <echo message="@{msg}"/>
    </sequential>
</macrodef>

<target name="foo">
   <myecho msg="${my_property}"/>
   <property name="my_property2" value="..."/>
   <myecho msg="${my_property2}"/>
</target>

这篇关于如何通过写在蚂蚁的财产?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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