ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Bringing up an old issue that was never addressed: includeemptydirs on delete
Date Mon, 08 May 2006 20:18:30 GMT
--- Liz Burke-Scovill <fiddledragon@gmail.com> wrote:
[SNIP]
> XML snippet:
> 
> <delete includeemptydirs="true">
>     <fileset dir="test" includes="**/*.ini" />
> </delete>
> 
> Actual outcome:
> 
> test/something.ini and test/test1/test2/another.ini
> are deleted - this is
> also expected based on current implementation.
> 
> Desired outcome:
> 
> files test/something.ini,
> test/test1/test2/another.ini deleted
> dirs test3 and test2 deleted as both are now empty.
> 
> Using an excludes pattern of <fileset dir="test"
> excludes="**/*.txt" />, it
> does exactly as desired, but it's kind of hacky as
> you
> have to think backwards, and if you have more than
> one filetype, it will get
> more complicated...and what if (as in our real world
> situation) files of
> various and changing file types are being added, and
> we *only* want to
> delete one specific file type. In an automated build
> situation, we as
> developers shouldn't care what other file types
> other developers are adding
> if we *only* want to delete say class files.
> 
> 

Liz:  I don't think this will be resolved to your
complete satisfaction.  :(  Occasionally there are
multiple ways of thinking about a given problem and it
can be difficult to reconcile contrary points of view.
 The behavior you are asking for opposes Ant's basic
concept of fileset-based tasks.  The following is
about the best compromise this discussion is likely to
arrive at:

<delete includeemptydirs="true">
  <fileset dir="test">
    <or>
      <filename name="**/*.ini" />
      <type type="dir" />
    </or>
  </fileset>
</delete>

HTH,
Matt


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message