At 01:05 PM 6/7/2002 -0700, Alexey Solofnenko wrote:

I am preparing a image directory by copying files from several folders.
After that I want to delete obsolete files (instead of deleting the whole
directory at the beginning). The code is something like:

<copy todir="${image}">
  <fileset .../>
</copy>
<delete>
  <fileset dir="${image}">
    <present targetdir="${src_dir} present="srconly"/>
  </fileset>
</delete>

However source fileset can be quite complex. Do you think this feature
should be added into ANT?

Ok, I'm more clear on why you want this. Reusing filesets when detecting obsolete files does make sense.


I think that there is another way to get that reuse, though. You could have something like this:

<project basedir="." target="create.new">
  <selector id="complicated-selection">
    ...
  </selector>

  <target name="create.new">
    <copy todir="${image}">
      <fileset dir="${src_dir}">
        <selector refid="complicated-selection"/>
      </fileset>
    </copy>
  </target>

  <target name="remove.obsolete">
    <delete>
      <fileset dir="${image}">
        <and>
          <selector refid="complicated-selection"/>
          <present targetdir="${src_dir}" present="srconly"/>
        </and>
      </fileset>
    </delete>
  </target>
</project>

Having said that, people don't necessarily want to rewrite their filesets in terms of selectors just to find obsolete files. Perhaps the usability benefits make it worth adding fileset references to <present> (and <depend>, I guess) for 1.6.

Anyone else have an opinion on this?



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to