> I want to delete the intermediate files and folders that are generated while
> building the .NET projects (folder "obj" and its contents). There are many
> projects in a build file that are to be built and each project's "obj"
> folder needs to be deleted. Writing a target "Clean" and deleting all these
> "obj" folders manually will be a tedious job. Hence, I want to know is there
> any easy way to achieve this?

Assuming that the "workingPath" property contains the name of the
ultimate parent of all the directories you want to delete, you could
do something like this:

    <target name="clean" failonerror="true" description="Remove all
products of previous compilations">
        <delete>
            <fileset>
                <include name="${workingpath}/**/bin/**/*" />
                <include name="${workingpath}/**/obj/**/*" />
            </fileset>
        </delete>

    </target>

I forget whether or not that actually deletes the directory, and I'm
not currently in a place where I can test it, but you should be able
to experiment with it.

/bs

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

Reply via email to