如何显示包含excludesfile的蚂蚁模式集 [英] How to display an ant patternset containing an excludesfile
本文介绍了如何显示包含excludesfile的蚂蚁模式集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图显示一个用于调试目的的蚂蚁模式集.
在我的示例中,patternset显示为dontcompile patternSet{ includes: [] excludes: [] }
,没有显示excludes文件中的信息.
I'm trying to display an ant patternset for debugging purposes.
In my sample the patternset is displayed as dontcompile patternSet{ includes: [] excludes: [] }
, no info from the excludesfile is shown.
我知道excludesfile可以正常工作,因为在Linux上最后没有显示Windows源.
I know the excludesfile is working because on Linux no windows sources are shown at the end.
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
推荐答案
我发现${toString:refid}
显示了我的需求.
I found that ${toString:refid}
shows what I need.
<echo>${toString:dontcompile}</echo>
显示
patternSet{ includes: [] excludes: [windows.source, win/**] }
这篇关于如何显示包含excludesfile的蚂蚁模式集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文