蚂蚁的loadFile覆盖属性 [英] Ant loadfile override property

查看:175
本文介绍了蚂蚁的loadFile覆盖属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Ant任务<&的loadFile GT; 在一个循环解析文件的内容。我有一些像

I'm trying to use the Ant task <loadfile> in a loop to parse the contents of a file. I have something like

<loadfile srcFile="@{some.input}" property="my.property">

由于Ant属性是不可变的,这并不为我工作。我需要'my.property在每次迭代更新。有没有办法来实现这一目标?我知道蚂蚁的contrib有一个&LT; VAR&GT; 的任务,但我不知道如何使用&LT;研究loadFile&GT; 吧。

Since Ant properties are immutable, this doesn't work for me. I need 'my.property' to update on every iteration. Is there a way to achieve this? I know Ant-contrib has a <var> task but I'm not sure how to use <loadfile> with it.

任何建议?

感谢。

推荐答案

借助蚂蚁插件Flaka 提供了一个让任务,允许覆盖现有的属性或变量像=

The Ant plugin Flaka provides a let task, allowing to overwrite existing properties or variables like that =

<project xmlns:fl="antlib:it.haefelinger.flaka">

<property name="my.property" value="value"/>
<fl:let> my.property ::= 'anothervalue'</fl:let>

</project>

所以没必要取消设置第一和事后设定。顺便说一句。 Flaka有一个取消设置的任务也; - )

So no need to unset first and set afterwards. btw. Flaka has a unset task also ;-)

这篇关于蚂蚁的loadFile覆盖属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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