I am trying to "function"alize few lines of ant-code using macrodef
. But its resulting in error like :
copy doesn't support the nested "my-macro" element.
If I "inline" definition of my-macro of adding filterchian within copy-task it works.
My test target looks like this -
<target name="copy-files">
<sequential>
<copy todir="abc" >
<fileset dir="xyz">
<!--needy includes/excludes -->
</fileset>
<my-macro/>
</copy>
</sequential>
</target>
And my-macro looks like this:
<macrodef name="my-macro">
<sequential>
<filterchain>
<fixcrlf includes="**" eol="lf"/>
</filterchain>
</sequential>
</macrodef>
Code which works (inlined-one ) looks like :
<target name="copy-files">
<sequential>
<copy todir="abc" >
<fileset dir="xyz">
<!--needy includes/excludes -->
</fileset>
<filterchain>
<fixcrlf includes="**" eol="lf"/>
</filterchain>
</copy>
</sequential></target>