ant - How to specify files matching *~? -


i have following ant target:

  <delete>     <fileset dir="${qnaire_dir}" includes="**/*~" />   </delete> 

it not delete following files:

./details~ ./qnaire/__init__.py~ ./qtest.py~ ./readme~ 

what correct includes value match these files?

i found answer! syntax looking for:

  <defaultexcludes remove="**/*~" />   <delete>     <fileset dir="${qnaire_dir}" includes="**/*~" />   </delete>   <defaultexcludes default="true" /> 

after skimming ant documentation delete task (http://ant.apache.org/manual/tasks/delete.html) half dozen times, noticed statement:

if use task delete temporary files created editors , doesn't seem work, read on default exclusion set in directory-based tasks, , see defaultexcludes attribute below.

so went , read defaultexludes. turns out default ant excludes set of file expressions directory based tasks. these listed here: http://ant.apache.org/manual/dirtasks.html#defaultexcludes

adding first defaultexludes element , removing '*~' list allows subsequent delete task right thing. second defaultexcludes element puts default exclusion list in place.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -