Я пытаюсь отобразить набор шаблонов ant для целей отладки. В моем примере набор шаблонов отображается в виде dontcompile исходники показаны в конце.
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