I'm pretty new to nant and have a question with regards to what I consider the equivalent of a top-level makefile that descends down into each subdirectory and builds the given target based on input to the top-level build file.

In nant, I guess this looks like:

<?xml version="1.0" ?>
<project name="Build all subdirs" default="build" xmlnds="http://tempuri.org/nant-vs.xsd";>
    <!-- compile Tutorials examples -->
    <target name="build" description="All MK libraries" inheritall="true">
        <nant target="${target::get-current-target()}">
            <buildfiles>
                <include name="**/default.build" />
                <!-- exclude current build file -->
                <exclude name="${project::get-buildfile-path()}" />
            </buildfiles>
        </nant>
    </target>
</project>

If I type "nant" in a top level directory structure with a nant project in each subdir, this works fine. What I would like however is to be able to type "nant sometarget" and have the top-level nant file carry this target over to the subdirs.

For instance "nant clean". It can easily be supported by duplicating the "<target name=" part of the file with name="clean". But then I would need a target section for each possible target, and this seems a bit redundant.

I've tried setting "<target name="${target::get-current-target()}">, but this does not work, even though it does work in the "nant target" part.

Any ideas on how I could accomplish this is a more elegant manner than having a target section for each possible target in the toplevel build file?

Thanks,

Marius K.


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.  Get Certified Today
Register for a JBoss Training Course.  Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to