How do you convert a string to uppercase in ant? [duplicate]
Possible Duplicate:
Ant string functions?
I am modifying a wxi file as part of a wix install and updating a guid. As part of the "pedantic" warning setting if a guid is in lowercase the wix build fails.
How can I convert the guid to an uppercase string in ant?
EDIT: The Ant string functions thread is definit开发者_StackOverflowly the way to go - Ant string functions?
You may use the Ant Plugin Flaka, no need to use a scripting language =
<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>
output :
[echo] A7655B5E-F074-4DF1-9636-391AA234F4F4
[echo]
[echo] ${guid} before => a7655b5e-f074-4df1-9636-391aa234f4f4
[echo] ${guid} after => A7655B5E-F074-4DF1-9636-391AA234F4F4
精彩评论