2

可能重复:
Ant 字符串函数?

我正在修改 wxi 文件作为 wix 安装和更新 guid 的一部分。如果 guid 为小写,则作为“迂腐”警告设置的一部分,wix 构建失败。

如何将 guid 转换为 ant 中的大写字符串?

编辑: Ant 字符串函数线程绝对是要走的路 - Ant 字符串函数?

4

1 回答 1

2

您可以使用Ant Plugin Flaka,无需使用脚本语言 =

<project name="demo" xmlns:fl="antlib:it.haefelinger.flaka">
  <fl:install-property-handler />

    <property name="guid" value="a7655b5e-f074-4df1-9636-391aa234f4f4"/>

    <!-- simple echo -->
  <echo>
    #{'${guid}'.toupper}
   </echo>

    <!-- create new property for further processing -->
    <fl:let>
     guidtoupper := '#{'${guid}'.toupper}'
    </fl:let>

    <echo> $${guid} before => ${guid}</echo>

    <!-- overwrite existing property -->
  <fl:let>
   guid ::= '#{'${guid}'.toupper}'
  </fl:let>

    <echo> $${guid} after => ${guid}</echo>

</project>

输出 :

 [echo]     A7655B5E-F074-4DF1-9636-391AA234F4F4
 [echo]    
 [echo]  ${guid} before => a7655b5e-f074-4df1-9636-391aa234f4f4
 [echo]  ${guid} after => A7655B5E-F074-4DF1-9636-391AA234F4F4
于 2011-05-13T14:20:27.737 回答