大家好,这些都是我的 file.properties 文件的内容,我想打印那些具有真实价值的平台及其安装程序位置,可以确定具有真实价值的平台只有安装程序:
platform.win-x86=true
platform.win-x86-client=false
platform.win-x64=true
platform.linux-x86=false
installer-zip.win-x86=E:\\abc\\abc.jar
installer-zip.win-x64=E:\\def\\def.jar
尝试了很多东西,但我用过的东西之一就是
<propertyselector property="platform.list"
delim`enter code here`iter=","
match="platform\.([^\.]*)"
select="\1"
casesensitive="false" />
<propertyselector property="zip.list"
delimiter=","
match="installer-zip\.([^\.]*)"
select="\1"
casesensitive="false" />
<target name="print.name" >
<propertycopy name="platform.name" from="platform.${platform.id}" />
<if> <equals arg1="${platform.name}" arg2="true" />
<then>
<echo>PlatForm.Id====>${platform.id}</echo>
<echo message="${platform.name}" />
<echo file="platform.properties" append="yes">${new.platform-name}=Yes${line.separator}</echo>
</then>
</if>
</target>
<target name="print.zipname" >
<propertycopy name="zip.name" from="installer-zip.${zip.id}" />
<echo>zip.Id====>${zip.id}</echo>
<echo message="${zip.name}" />
</target>
<target name="first">
<foreach list="${platform.list}"
delimiter=","
target="print.name"
param="platform.id" />
<foreach list="${zip.list}"
delimiter=","
target="print.zipname"
param="zip.id" />
</target>
虽然它为所有真正的平台打印值,但对于安装程序它只打印 1,然后中断..你能帮忙吗