ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 33404] Jar task supporting "replace token" using filterset
Date Sun, 26 Jun 2011 11:31:53 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=33404

--- Comment #3 from Marco Hunsicker <apache@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.

Mime
View raw message