0

I want to write a code in such a way that I will remove platform from first 3 lines and then take only the platform name and I will suffix that with installer-zip.${platform_name}.

platform.win-x86=true
platform.win-x64=true
platform.unix=false
installer-zip.win-x86=E:\abc.jar
installer-zip.win-x64=E:\def.jar

Now if the selected item is win-x86 then printing installer-zip.${platform_name} should give me E:\abc.jar. I tried ${installer-zip.${platform_name}} and many other things but they are not working

4

1 回答 1

0

您无法使用常规 ant 执行此操作,但您可以使用ant-contrib执行此操作。

特别是,有一个 contrib 任务property-regex

所以像:

<propertyregex property="$newProperty" 
               input="$oldProperty" 
               regexp="^platform\.(,*)$"
               select="\1"
               casesensitive="false" />

编辑:然后...

<property name=desiredProperty value="installer-zip.${newProperty}" />

这应该足以让您找出您正在寻找的确切解决方案......

于 2012-05-18T07:13:46.053 回答