ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Guild <>
Subject deleting files not in whitelist
Date Tue, 17 Jul 2018 23:45:17 GMT

I have a build file which declares a <resources> containing a list of 
expected files which are relative to some directory. I am trying to 
delete any files from that directory which /are not present/ in the 
<resourcelist>, and I can't figure out how to do that with the <delete> 
task and my understanding of the standard selectors.

Here's my resource list:

    <resources id="my-whitelist">
         <resourcelist basedir="${some.dir}">
             <url url="${target.files.url}"/>

Basically my-whitelist is simply a list of filenames which are expected 
to exist relative to ${some.dir}.

In a target, I would like to somehow use the <delete> task to delete any 
files found in ${some.dir} which are /not listed in/ "my-whitelist", 
like this:

    <delete dir="${some.dir}">
             <resources refid="my-whitelist"/>

But this doesn't work. I also tried:

             <fileset dir="${some.dir}"/>
                 <resources refid="my-whitelist"/>

Which doesn't work either.
Any help you can provide would be appreciated.


View raw message