I decided to add the "configuration" targets so that I would have the 
flexibility to do it either way.  And these new targets are generic in a 
sense so I was able to add them to a separate build script.  The only 
requirement is that each build script which includes this common script must 
define clean and build targets.

The result is:

common.build:

<?xml version="1.0"?>
<project>

        <!--
        Default is Debug.
        -->

        <property name="debug" value="True" overwrite="false" />

        <!--
        Set configuration property based on the debug property.
        -->

        <if test="${string::to-lower(debug)=='true'}">
                <property name="configuration" value="Debug"/>
        </if>
        <if test="${string::to-lower(debug)!='true'}">
                <property name="configuration" value="Release"/>
        </if>

        <!--
        Create configuration specific targets.
        -->

        <target name="clean-debug" description="Cleans debug">
                <property name="configuration" value="Debug"/>
                <call target="clean"/>
        </target>

        <target name="build-debug" description="Builds debug">
                <property name="configuration" value="Debug"/>
                <call target="build"/>
        </target>

        <target name="rebuild-debug" description="Rebuilds debug">
                <property name="configuration" value="Debug"/>
                <call target="rebuild"/>
        </target>

        <target name="clean-release" description="Cleans release">
                <property name="configuration" value="Release"/>
                <call target="clean"/>
        </target>

        <target name="build-release" description="Builds release">
                <property name="configuration" value="Release"/>
                <call target="build"/>
        </target>

        <target name="rebuild-release" description="Rebuilds release">
                <property name="configuration" value="Release"/>
                <call target="rebuild"/>
        </target>

        <!--
        Implementation of rebuild as clean & build seems to work fine.
        -->

        <target name="rebuild" description="Rebuilds" depends="clean,build"/>

        <!--
        Update from SCCS.
        -->

        <target name="update" description="Updates the source from source 
control">
                <cvs-update cvsfullpath="c:/program files/cvsnt/cvs.exe"/>
        </target>

</project>

specialized build:

<?xml version="1.0"?>
<project name="Eom" default="build" basedir=".">
        <description>Eom application</description>
        <property name="baseName" value="Eom2"/>

        <include buildfile="../common.build"/>

        <target name="clean" description="Cleans Eom">
                <delete dir="${configuration}"/>
                <delete>
                        <fileset>
                                <include 
name="../../bin/${configuration}/${baseName}.*"/>
                        </fileset>
                </delete>
        </target>

        <target name="build" description="Builds Eom">
                <solution configuration="${configuration}">
                        <projects>
                                <include name="Eom.vcproj"/>
                        </projects>
                </solution>
        </target>

</project>


Nick

>From: "Bob Archer" <[EMAIL PROTECTED]>
>To: "Nicholas Duane" <[EMAIL PROTECTED]>,<nant-users@lists.sourceforge.net>
>Subject: RE: [NAnt-users] solution task: targets v.s. configuration
>Date: Wed, 6 Sep 2006 11:09:49 -0400
>
>You can do it either way you want.
>
>Basically, in our build we have the basic targets:
>
>Clean
>Version
>Label
>Get
>Compile
>UpdateDb
>Deploy
>
>The compile task can do either release or debug based on the parameter.
>However, there was no reason why you can't have two Compile targets etc
>as you listed below. NAnt is very flexible.
>
>Also, you could have a property that held "debug" or "release" or "both"
>if you wanted.
>
>BOb
>
>
>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Nicholas
>Duane
>Sent: Wednesday, September 06, 2006 10:50 AM
>To: nant-users@lists.sourceforge.net
>Cc: [EMAIL PROTECTED]
>Subject: [NAnt-users] solution task: targets v.s. configuration
>
>I know there has already been a discussion on adding another attribute,
>operation, so we can specify clean, build, rebuild.  From the little bit
>
>I've read so far (just started using nant) it appears that people are
>equating targets to clean, build, and rebuild and using a property to
>determine the configuration: debug or release.  Is this correct?  Why
>would
>the configuration not also equate to a target type?  Otherwise, if I
>want to
>build both debug and release I have to have two nant entries (from my
>cruisecontrol configuration) whereas if debug and release were targets I
>
>would only need one entry and could specify both targets.
>
>So do people create debug and release targets?  Maybe something like:
>
><target name="debugclean" .../>
><target name="debugbuild" .../>
><target name="debugrebuild" .../>
><target name="releaseclean" .../>
><target name="releasebuild" .../>
><target name="releaserebuild" .../>
>
>Thanks,
>Nick
>
>_________________________________________________________________
>Check the weather nationwide with MSN Search: Try it now!
>http://search.msn.com/results.aspx?q=weather&FORM=WLMTAG
>
>
>------------------------------------------------------------------------
>-
>Using Tomcat but need to do more? Need to support web services,
>security?
>Get stuff done quickly with pre-integrated technology to make your job
>easier
>Download IBM WebSphere Application Server v.1.0.1 based on Apache
>Geronimo
>http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>_______________________________________________
>NAnt-users mailing list
>NAnt-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/nant-users

_________________________________________________________________
All-in-one security and maintenance for your PC.  Get a free 90-day trial!   
http://www.windowsonecare.com/trial.aspx?sc_cid=msn_hotmail


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to