You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2011/06/26 13:31:53 UTC
DO NOT REPLY [Bug 33404] Jar task supporting "replace token" using
filterset
https://issues.apache.org/bugzilla/show_bug.cgi?id=33404
--- Comment #3 from Marco Hunsicker <ap...@triemax.com> 2011-06-26 11:31:53 UTC ---
Sure you have to be careful to avoid filtering unwanted files, but doesn't this
apply to the <copy> task in an equal manner?
If you would limit filtering to specific filesets as suggested by the OP, I
don't see more potential to do harm than with the <copy> task.
<filter token="BUILD.VERSION" value="${BUILD.VERSION}" />
<filter token="BUILD.NUMBER" value="${SAFE.BUILD.NUMBER}" />
<copy todir="/tmp" filtering="true" overwrite="true">
<fileset dir="src/main/resources">
<include name="**" />
</fileset>
</copy>
<jar jarfile="target/file-${BUILD.VERSION}.jar">
<zipfileset dir="/tmp">
<patternset>
<include name="**" />
</patternset>
</zipfileset>
</jar>
vs.
<filter token="BUILD.VERSION" value="${BUILD.VERSION}" />
<filter token="BUILD.NUMBER" value="${SAFE.BUILD.NUMBER}" />
<jar jarfile="target/file-${BUILD.VERSION}.jar">
<zipfileset dir="src/main/resources" filtering="true">
<patternset>
<include name="**" />
</patternset>
</zipfileset>
</jar>
As I often need to filter things, I've patched Ant. It's a simple change if you
assume all files have the same encoding like in my use case, but still a nice
enhancement. I'd vote to reconsider your decision.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.