ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sony Antony <sony.ant...@gmail.com>
Subject Overriding ant <copy> task
Date Mon, 05 Jul 2010 00:17:20 GMT
Hi :
Im trying to modify the <copy> task so that if a token seen in the
file being copied, is undefined in teh <filterset>, the build will
fail..
( It will also list all teh undefined tokens encountered against the
corresponding file name )

1. Was there an way to do this without writing java code ?

2. I have already made the changes required in teh ant source code.
But I cant figure out how to execute my code.
I created a jar file with just the changed class files, and did a
<taskdef> with this jar file.
But none of my files got executed.
Since my class files were packaged just like teh original ant
classfiles, it appeard that ant ignored them completely thinking that
those class files have already been loaded.

Is there a way around it so that class files seen inside my jar file
will be picked up first and the remaining files will be resolved from
the original ant classloader

Thanks
--sony

Files being changed and packaged inside antfix.jar
apache-ant-1.8.1/src/main/org/apache/tools/ant/taskdefs/Copy.java
apache-ant-1.8.1/src/main/org/apache/tools/ant/types/FilterSet.java
apache-ant-1.8.1/src/main/org/apache/tools/ant/types/FilterSetCollection.java
apache-ant-1.8.1/src/main/org/apache/tools/ant/util/ResourceUtils.java

<taskdef name="copy2" classname="org.apache.tools.ant.taskdefs.Copy"
classpath="/path/to/antfix.jar"/>

Doesnt work :
<target name="try">
        <copy2 file="srcfile" toFile="destfile">
<filterset begintoken="@" endtoken="#">
<filter token="TOK1" value="VAL1"/>
<filter token="TOK2" value="VAL2"/>
</filterset>
        </copy2>
        </target>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message