我正试图显示一个用于调试目的的蚂蚁模式集。
在我的示例中,patternset显示为dontcompile patternSet{ includes: [] excludes: [] }
,没有显示excludes文件中的信息。
我知道excludesfile可以正常工作,因为在Linux上最后没有显示Windows源。
build.xml
<project default="init" >
<condition property="osname" value="linux">
<os family="unix" />
</condition>
<!-- if it's not unix assume it's some kind of windows -->
<property name="osname" value="windows" />
<target name="init" >
<local name="dont_compile.os.present" />
<local name="dont_compile.present" />
<available file="dont_compile.${osname}.lst" property="dont_compile.os.present" />
<available file="dont_compile.lst" property="dont_compile.present" />
<echo>dont_compile.${osname}.lst ${dont_compile.os.present}${line.separator}dont_compile.lst ${dont_compile.present}</echo>
<patternset id="dontcompile">
<excludesfile name="dont_compile.${osname}.lst" if="dont_compile.os.present" />
<excludesfile name="dont_compile.lst" if="dont_compile.present" />
</patternset>
<fileset id="myfileset" dir=".">
<include name="**/*.source" />
<patternset refid="dontcompile" />
</fileset>
<loadfile property="os_contents" srcFile="dont_compile.${osname}.lst" />
<local name="ps.value" />
<property name="ps.value" refid="dontcompile" />
<echo>
dontcompile ${ps.value}"
os_contents ${os_contents}
${toString:myfileset}
</echo>
</target>
</project>
dont_compile.linux.lst的内容
windows.source
win/**
我的测试目录的内容
./build.xml
./dont_compile.linux.lst
./general.source
./linux.source
./windows.source
./win/sub.source
示例输出
Buildfile: build.xml
init:
[echo] dont_compile.linux.lst true
[echo] dont_compile.lst ${dont_compile.present}
[echo]
[echo] dontcompile patternSet{ includes: [] excludes: [] }"
[echo] os_contents windows.source
[echo] win/sub.source
[echo]
[echo] general.source;linux.source
BUILD SUCCESSFUL
Total time: 0 seconds
答案 0 :(得分:1)
我发现${toString:refid}
显示了我的需求。
<echo>${toString:dontcompile}</echo>
显示
patternSet{ includes: [] excludes: [windows.source, win/**] }