从模式蚂蚁负载特性 [英] Ant load properties from pattern

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

问题描述

在蚂蚁,我需要加载基于图案是一组的.properties 文件。结果
我想:

In ant, I need to load a set of .properties files based on a pattern.
I tried:

<property>  
    <fileset includes="${propertiesDir}/*.properties"/>
</property>

但它不工作,因为&LT;性&gt; 不支持嵌套

如何从文件加载模式匹配的属性呢?

How can i load properties from files matching a pattern?

谢谢..

推荐答案

您可以使用 CONCAT 任务文件Concat的所有属性,以一个大的临时属性文件,以及使用的 属性 这个大临时属性文件属性。

You could use the concat task to concat all your properties files to a big temporary properties file, and the use property with this big temporary properties file as attribute.

请务必使用fixlastline =真与CONCAT任务,以确保一个新的行字符每个文件的结尾。

Make sure to use fixlastline="true" with the concat task to make sure each file ends with a new line character.

例如:

<target name="init">
    <concat destfile="temp/bigPropertiesFile.properties" fixlastline="true">
        <fileset dir="${propertiesDir}" includes="*.properties"/>
    </concat>
    <property file="temp/bigPropertiesFile.properties"/>
</target>

这篇关于从模式蚂蚁负载特性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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