I requested the feature because the <solution> task is the logical place
to do a clean operation since the solution already knows all the
intermediate and output files that are generated during a build.
Otherwise you have hand-code a 'clean' target in nant using <delete>
tasks that get all the intermediate and output files for a given
configration. Do-able but, IMHO, messy.
Currently the way I am doing it is with properties. Prior to using the
solution task, I was exec'ing devenv.com like so:
<!-- 'debug' or 'release' -->
<property name="project.config" value="debug" />
<!-- '/build' or '/clean' or '/rebuild' -->
<property name="devenv.command" value="/build" />
I have some targets for changing the above properties which are really
just shortcuts for specifying them on the nant command line:
<target name="release" >
<property name="project.config" value="debug" />
</target>
<target name="clean" >
<property name="devenv.command" value="/clean" />
</target>
<target name="rebuild" >
<property name="devenv.command" value="/rebuild" />
</target>
Then I have a utility target that expects these properties to be set:
<target name='build-solution'>
<exec program='devenv.com'>
<arg value='${devenv.solutionFile}' />
<arg value='${devenv.command}' />
<arg value='${project.config}' />
</exec>
</target>
And build targets look like:
<target name='all'>
<property name="devenv.solutionFile" value="MySolution.sln" />
<call target='build-solution'/>
</target>
So to build a debug version I type:
nant all or just nant
To clean the debug version:
nant clean all
To rebuild a release version:
nant rebuild all
So, my request was for a feature to allow me to keep the same type of
structure when using the <solution> task without doing <if> tasks in all
my build files. For example:
<!-- 'build' or 'clean' or 'rebuild' -->
<property name='solutionOp' value='build'/>
<target name="clean" >
<property name="solutionOp" value="clean" />
</target>
<target name="rebuild" >
<property name="solutionOp" value="rebuild" />
</target>
<target name='build-solution'>
<solution solutionFile='${build-solution.solutionFile}'
op='${solutionOp}'
configuration='${project.config}'/>
</target>
<target name='all'>
<property name="build-solution.solutionFile" value="MySolution.sln"
/>
<call target='build-solution'/>
</target>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf
> Of Nicholas Duane
> Sent: Wednesday, September 06, 2006 10:50 AM
> To: [email protected]
> 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
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/nant-users
>
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/nant-users