I'm using concat targets in an ant macrodef to generate ddl files. One part of the string in a few of the property strings are getting duplicated in the resulting ddl.
This duplication is only observed when generated from the concat targets.
I've tried 1) using dashes instead of underscores, 2) using ${property-name} instead of @{property-name}, 3) using echo target instead of concat target, 4) switching from ant 1.9.3 to 1.10.5, and 5) doing an online search
Property getting set in ant script
<property name="SCHEMA_ID" value="REPLACE_SCHEMA_ID" />
Attribute being set in macrodef
<attribute name="schema-id" default="${SCHEMA_ID}" />
Concat target
<concat destfile="@{dest-dir}/@{spname}.ddl">
SET CURRENT SCHEMA = '@{schema-id}'
@@@@
SET CURRENT SQLID = '@{sql-id}'
@@@@
</concat>
Output line in the ddl file
SET CURRENT SCHEMA = 'REPLACE_REPLACE_SCHEMA_ID'
I would expect the Output line in the ddl file to be:
SET CURRENT SCHEMA = 'REPLACE_SCHEMA_ID'
As far as I can tell there's a bug when using echo or concat (at least in a macrodef) where if the name of a property equals part of the value of a property, the part of the value that doesn't match the name is duplicated.
but
<property name="SCHEMA_ID" value="@schema_id@" /> becomes @schema_id@
Strange behavior, and I'm open to being proven wrong, but this is what I came up with.