I'm looking for my build to delete the contents of a directory without touching a certain folder. Below is what I'm trying, and it even looks wrong to me...aside from the fact that it bombs when I run it. Do I need to be deleting the contents of the dir explicitly and at the same time exclude my Reports folder?
<delete includeemptydirs="true">
<fileset dir="${PublishLocation}" >
<exclude name="**Reports**"/>
</fileset>
</delete>
Cheers.
It should be:
<delete>
<fileset basedir="${PublishLocation}">
<include name="**/*"/>
<exclude name="**/Reports/**/*" />
</fileset>
</delete>
Please notice the following:
includeemptydirs="true"
is defaultfileset
is basedir
instead of dir
<exclude name="**/Reports/**" />
instead of <exclude name="**/Reports/**/*" />
all files named Reports
are kept as wellIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With