一、概述
DirSet是一组目录,是从基本目录开始的目录树中与一系列模式集和选择器的模式匹配的目录。模式集可以通过内嵌patternset元素设置,此外,目录集还包含了一个隐式的模式,并支持内嵌include、includesfile、exclude、excludesfile元素,以及模式集的属性。选择器作为DirSet的内嵌元素使用。如果目录集中的任何选择器都没有选择一个目录,那么这个目录就不会包含在目录集中。
二、属性
dir:文件集目录树的根目录。
includes:逗号或空格分隔的必须包含的目录模式列表。
includesfile:文件名。指定文件的每一行都会做为一个includes模式。
excludes:逗号或空格分隔的必须排除的目录模式列表。
excludesfile:文件名。指定文件的每一行都会做为一个excludes模式。
casesensitive:处理includes与excludes模式时是否区分大小写,默认为true。
followsymlinks:是否跟踪符号链接,默认为true。
erroronmissingdir:Ant1.7.1起,指定在基本目录不存在时的处理方式。如果为true,会发生构建错误,如果为false,文件集会被忽略。默认为true。
三、简单示例
<project>
<dirset dir="E:\workspace\trans\bin" casesensitive="no">
<include name="com*"/>
<exclude name="interface-mgr*"/>
</dirset>
<dirset dir="E:\workspace\trans\bin" casesensitive="false">
<patternset id="dirset">
<include name="com*"/>
<exclude name="interface-mgr*"/>
</patternset>
</dirset>
<dirset dir="E:\workspace\trans\bin" >
<patternset refid="dirset"/>
</dirset>
</project>