2011-05-09 20 views
2

可能重複:
Ant string functions?如何將字符串轉換爲大寫的螞蟻?

我修改WXI文件作爲威克斯安裝的一部分和更新GUID。作爲「迂迴」警告設置的一部分,如果guid小寫,則wix構建失敗。

如何將guid轉換爲螞蟻中的大寫字符串?

編輯:螞蟻字符串函數線程definitly要走的路 - Ant string functions?

+7

也許這可能有所幫助:http://stackoverflow.com/questions/3725827/ant-string-functions – 2011-05-09 19:21:04

+2

這真的沒有任何關係與WiX,ta克可能應該被刪除。 – 2011-05-09 23:25:17

+0

@Rob我同意,wix標籤最好從這個問題中刪除。 – 2011-05-10 06:41:21

回答

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