开发者

Read <property> value from file within build.xml

Can I read the the property value from an external file instead of specifing the value within the <property> tag.

So instead of -

 <property name="device" value="test" />
开发者_开发百科

Use something like

 <property name="device" value="c:\\fileToRead" />

where file to read contains test,test2,test3

Thanks


The <property> task provides a means to load a java properties file, if that's what you mean:

<property file="c:\\fileToRead"/>


Maybe. While you can't use the content of the file, you can use a file that looks like so:

device=C:\\fileToRead

and then read that with

<property file="foo.properties"/>

(see the docs).


in build.xml

<property file="general.properties" />

general.properties file

svnant.version=1.0.0
lib.dir=${ant.home}/lib

So for you will be:

<property file="c:\\fileToRead" />

fileToRread is

 device=test
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜