> But the issue here is if I have created a folder named "obj"
(different
> from the intermediate "obj" folder) which contains some files that I
use
> in the project, then this "clean" target will also delete my "obj"
> folder which I do not want to happen. Could you guide in this case?

My immediate thought was to not give my own folder the name "obj" ...
:-)


However, using a fileset is still the way to go, you just need to limit
things more tightly.

The "intermediate files" obj folder is always located immediately under
the project folder, and contains subfolders for the build
configurations.

Commonly, project folders are immediate subfolders of the solution
folder.

So, assuming you have a property ${solution.dir} that points to the
solution folder, you might set up something like this:

    <target name="clean" 
            description="Remove all products of previous compilations">

        <delete>
            <fileset>
                <include name="${solution.dir}/*/obj/Debug/**/*" />
                <include name="${solution.dir}/*/obj/Release/**/*" />
            </fileset>
        </delete>

    </target>

The first "*" matches only one directory level, traversing into all the
project folders. Within each project folder, will only remove files from
obj/Debug and obj/Release.

You may find it useful to reread the docs on path matching, included in
the documentation of how filesets work:
http://nant.sourceforge.net/release/latest/help/types/fileset.html

Hope this helps,
Bevan.



******************************************************************************
"This message (and any files transmitted with it) are confidential and
may be legally privileged. If you are not the intended recipient please
notify the sender immediately and delete this message from your system.

This message does not necessarily reflect the views of the
Reserve Bank of New Zealand. If the recipient has any concerns about
the content of this message they should seek alternative confirmation
from the Reserve Bank of New Zealand."
******************************************************************************

------------------------------------------------------------------------------
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to