Thank you Gert. I believe that this will solve the issues I am
encountering with designing the build.

 

I would like to thank everyone else for their email as well. :-)

 

Regards,

-jdix

 

________________________________

From: Gert Driesen [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 14, 2007 12:53 AM
To: Dix, John; nant-users@lists.sourceforge.net
Subject: RE: [NAnt-users] linking multiple build files

 

John,

 

Use the <nant> task instead:

http://nant.sourceforge.net/release/latest/help/tasks/nant.html

 

For example:

 

    <project name="standalone" default="rebuild">
        <target name="*">
            <nant target="${target::get-current-target()}">
                <buildfiles basedir="C:\enlistments\Main\src">
                    <include name="Comp1/subcomp1/subcomp.build" />
                    <include name="Comp1/subcomp2/subcomp.build" />
                    <include name="Comp2/subcomp1/subcomp.build" />
                    <include name="Comp2/subcomp2/subcomp.build" />
                </buildfiles>
            </nant>

        </target>

    </project>
 

or if you just want to execute all build files in a given directory and
all subdirectories:

 

    <project name="standalone" default="rebuild">
        <target name="*">
            <nant target="${target::get-current-target()}">
                <buildfiles basedir="C:\enlistments\Main\src">
                    <include name="**/*.build" />

                    <!-- avoid recursive execution of current build file
-->
                    <exclude name="${project::get-buildfile-path()}" />

                </buildfiles>
            </nant>
        </target>

    </project>

 

The use of "*" as target name is special here. It will match any target
that does not exist in the project.

 

More information on this is available here:

http://nant.sourceforge.net/release/latest/help/fundamentals/targets.htm
l

 

In this case, it allows you to pass any target to the "master" build
file, and have that target executed in the build files you specify.

 

For sharing properties, I'd recommand using a separate build file in
which you define these properties and include that build file in your
regular build files.

 

For example:

 

<project name="settings">

    <property name="some.global.setting" value="ok" />

</project>

 

<project name="client" default="build">

    <include buildfile="settings.build" />

 

    <target name="build">

        <echo>Value of 'some.global.setting' is
'${some.global.setting}'.</echo>

    </target>

 </project>

 

Hope this helps,

 

Gert

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dix, John
Sent: vrijdag 13 juli 2007 22:04
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] linking multiple build files

Hello all,

 

I have been working with scripted builds for sometime now involving .cmd
files combined with either Python or Perl to get the job done. I am now
moving over to nant to do my work for me however I think I may need to
change how I am used to designing the builds.

 

Before I would create a setenv.cmd file which when opening a cmd window,
it would set environment variables I need to work with including paths
and such. Then I could issue something like "build release" and then my
entire product, which is laid out in multiple subdirectories at various
levels, would then proceed to be built. 

 

My questions are these:

1.      Is the best way to do what I want with nant to use the same
model and execute something like this: 

<?xml version="1.0"?>

<project name="testing chained calling" >

            <exec program="nant.exe"
commandline="-buildfile:C:\enlistments\Main\src\Comp1\subcomp1\subcomp.b
uild" verbose="true" failonerror="true" />

            <exec program="nant.exe"
commandline="-buildfile:C:\enlistments\Main\src\Comp1\subcomp2\subcomp.b
uild" verbose="true" failonerror="true" />

            <exec program="nant.exe"
commandline="-buildfile:C:\enlistments\Main\src\Comp2\subcomp1\subcomp.b
uild" verbose="true" failonerror="true" />

            <exec program="nant.exe"
commandline="-buildfile:C:\enlistments\Main\src\Comp2\subcomp2\subcomp.b
uild" verbose="true" failonerror="true" />

</project>

 

Or is there another way? This seems like a really lame way to do it. It
works with script files, but ... :-)

 

 

2.      Is there a way without modifying the NAnt.exe.config file to
persist the global settings I normally setup in my setenv.cmd file I
mentioned earlier? In other words I would like to load them into
properties that can then be accessed through-out my build environment. 

 

Thanks!

 

-jdix

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to