Ant内置任务之echoproperties
2018-01-15 15:09
330 查看
一、概述
echoproperties是Ant内置任务,用于显示当前project的所有属性,如果需要还可以输出到文件。可以用来作为从ant调用返回数据的一种方式,但更多的是用来调试构建文件。二、属性
destfile:指定将声明输出到的文件。生成的输出文件作为属性文件与java应用程序兼容。如果不设置此属性,将会输出到ant日志。prefix:属性前缀,用于过滤,只有相同前缀的属性才会输出。
regex:正则表达式,用于过滤,只有匹配的属性才会输出。
failonerror:在将属性写入发生错误时是否停止构建。如果设置为true,在发生错误时会抛出一个BuildException,停止构建;如果设置为false,将输出IO错误,但是不会停止构建。默认为true。
format:输出格式,text或者xml。默认为text。
从Ant1.6起,可以通过propertyset指定属性子集,可以通过propertyset对选中的属性做更多的控制。
三、简单示例
<project> <echoproperties/> <echoproperties destfile="properties.xml" failonerror="false" format="xml"/> <echoproperties destfile="java.properties"> <propertyset> <propertyref prefix="java."/> </propertyset> </echoproperties> </project>
相关文章推荐
- Ant内置任务之echoxml
- Ant内置任务之loadproperties
- Ant内置任务之echo
- Ant内置任务之sleep
- Ant内置任务之touch
- Ant内置任务之sequential
- Ant内置任务之fail
- Ant内置任务之available
- Ant内置任务之filter
- Ant内置任务之script
- Ant内置任务之hostinfo
- ANT 的内置任务
- Ant内置任务之checksum
- Ant内置任务之copy
- Ant任务echo的message属性中字符换行的写法
- Ant内置任务之depend
- Ant内置任务之tar
- Ant内置任务之splash
- Ant内置任务之antcall
- Ant内置任务之basename