如何在文件中存储 Apache Ant 属性值 [英] How to store Apache Ant property value in file

查看:22
本文介绍了如何在文件中存储 Apache Ant 属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要修改来自 Apache Ant 的 (xml-) 文件.loadfile"任务允许在属性中加载文件的内容.但是如何将属性的值在其(属性)修改后存储回文件?

当然我可以编写自定义任务来执行此操作,但我想知道是否有一些现有的实现.

解决方案

您可以使用 回声任务.

echoxml 任务您可能也会感兴趣.

I need to modify a (xml-)file from Apache Ant. "loadfile" task allows to load the file's content in a property. But how to store the property's value back to a file after its (property) modification?

Of course I could write custom task to perform this operation but I would like to know if there's some existing implementation.

解决方案

You can use the echo task.

<echo file="${fileName}" message="${xmlProperty}"/>

The echoxml task might be of interest to you as well.

这篇关于如何在文件中存储 Apache Ant 属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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