views:

539

answers:

5

I'm laying the groundwork for an automated build process and am trying to make sure I start down the right path. Our codebase is a mixture of Managed/Unmanaged C++. The managed part is in .NET 2.0 and all of the projects are part of a Visual Studio 2005 solution.

Right now I'm looking at NAnt, but I can't figure out how to perform a build. When I try to build using the tag, it spits out an error:

Microsoft Visual Studio.NET 2005 solutions are not supported.

I feel like I'm just approaching this problem from the wrong direction. Can anyone point me in the right one?

P.S. I also want to run doxygen as part of the build process, but I assume that whatever tool I choose will allow me to run it as a shell command at the very least.

+3  A: 

What's wrong with MSBuild? All your projects already use it, it's a good product, and it's free.

Alex Fort
Is MSBuild better suited to this situation? Is it even possible to compile this app using NAnt?
brian
Yes, you can compile it using NAnt, but you may have to create a NAnt build file in order to do so. MSBuild can generally do anything NAnt can, and it's already being used by your IDE and environment.
Alex Fort
Let me second the call for MSBuild - solid design, good MS and community support.
Scott Weinstein
Can you upload files with MSBuild? I know you can do it with ANT...I don't know if you can do it with NANT.
leeand00
A: 

You can use cruise control with c++:

http://confluence.public.thoughtworks.org/display/CC/UsingCruiseControlWithCplusPlus

We use make/cron and some home made scripts for crossplatform builds and it does the job (including running unit tests) - the reporting is a little crass though

billybob
+1  A: 

Come to think of it, MSBuild for VS2005 (8.0) does not fully support VC++. Depending on the project combination one could run into problems with using MSBuild as it directly calls out to VCBuild for native projects (which can be seen in the msdn forums).

So depending on the projects, either MSBuild or VCBuild should do the trick. To stay within NAnt one could use MSBuild or VCBuild directly by using the exec task.

If in VS2008 (.NET 3.5 framework), MSBuild does have a VCBuild task. You could then use the latest (.86 beta 1 version) of NAnt, combined with NAntContrib (provides msbuild task) to get 3.5 support.

Scott Saad
I was able to build these projects using MSBuild, although it looks like .vdproj files are not supported in 2005.
brian
Yes, MSBuild actually calls out to VCBuild in VS2005. Will update the answer.
Scott Saad
A: 

Kinook has a nice product called Visual Build that might serve your needs.

Eric P. Mangold
+2  A: 

We've used NAnt since VS003, VS2005 and now with VS2008 (although VS2008 and .net 3.5 requires the lastest build of NAnt 0.86+) so to answer your first question, yes NAnt will work just fine.

Here's a template that should get you started:

<?xml version="1.0"?>
<project name="Test Build" default="build" xmlns="http://nant.sf.net/release/0.85-rc4/nant.xsd"&gt;

<property name="target" value="rebuild" overwrite="false" />
<property name="configuration" value="debug" overwrite="false" />
<property name="projectName" value="MyProject.sln"/>

<target name="build" description="Build all targets.">
 <call target="build.MyProject"/>
</target>

<target name="build.MyProject">
    <exec program="MSBuild" failonerror="true" commandline="/t:${target} /p:Configuration=${configuration} ${projectName}" />
</target>

</project>

And finally make sure your environment is setup correctly when running the build for VS2005:

build.bat:

call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
"C:\Program Files\NANT\bin\NAnt.exe" -t:net-2.0 -logfile:buildlog.txt %*
Todd Smith