ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Frydl <mar...@idoox.com>
Subject PATCH: single file in FileSet
Date Thu, 21 Dec 2000 08:56:59 GMT
Hi,

    I've already posted this but no one reacted. So I repost it because
I'd like to know your opinion on this.

    I have problem with specifying <srcfiles> to <uptodate> element when

I don't know base directory, only file to check. For example I have
property srcfile and use this:

      <uptodate property="isUptodate" targetfile="${targetfile}">
          <srcfiles dir="???" includes="${srcfile}"/>
      </uptodate>

I don't know how to create dir value if I know only srcfile - which may
be relative or absolute. I tried "." and "/" but "." can't work if file
is in upper directory and "/" can't work if file is relative to ".".
Because I haven't found how to do this, I created a simple patch to
org.apache.tools.ant.types.FileSet. Now it can be written as

    <srcfiles file="${srcfile}"/>

Patch is very simle, it just splits filename into directory and filename

parts and calls setDir and setIncludes. It was using Ant 1.2 sources.

(May be I missed something and it can be done in different way (without
this patch))

    Martin

Mime
View raw message