views:

152

answers:

7

I'm not a huge fan of tools like Ant, but they are certainly useful. In a current C++ project I have no automated build process at all - I simply build my working dir using Visual studio, zip up the /bin folder and send it out for installation. The project is small enough this does work OK, but it's totally reliant on me knowing the project inside out.

I'd like a system which can do steps like:

  • update multiple SVN working dirs to a specified version (or default to Head)
  • run doxygen (or similar tool) to get API docs up to date
  • commit the API docs to some SVN repo
  • build several projects in the right order
  • copy some stuff about, delete unwanted files
  • package files/folders into a zip/folder named based on a user-specified version, or found from a file/SVN

Free is important. Easy to use is another. Windows is essential, and that doesn't include cygwin options.

It had crossed my mind you could probably do this using a .bat file, is that a viable option on what is still quite a small project (1-4 developers)?

+2  A: 

cmake is the tool of choice for any os these days. Nothing else comes close. You have to type a high level description of your code and cmake will generate VS solution/projects, and makefiles for all unices or cygwin.

NSIS: tons of open source/closed source projects use NSIS to create installers for windows -- its not bad, and the builder can be easily run from the command line -- so you can integrate it with cmake.

Hassan Syed
I already have a VS solution/projects, carefully set up. Will cmake play nicely with that?
John
Well, cmake would want to generate its own solution and projects -- you can tune a lot of stuff at an abstract level. You will probably have to port the configuration to cmake.
Hassan Syed
Oh. That sounds a bit annoying. i'd like a tool which works with my existing projects, not one which forces me to start over. Still, worth a look.
John
Yes, I know where you are coming from. You can always delay the change till you need to target another tool chain. I would investigate a bit though, it might be possible to use existing VS project files -- I believe this is the case since VS Project files allow a lot of customization and a lot of these might be too specific for cmake to lowest-common-denominator abstract these.
Hassan Syed
+1  A: 

I would recommend CMake:

http://www.cmake.org/

This is a pretty standard build system if you are used to dependency based build systems.

If you are more experimental (and enjoy coding ruby) Rake is great alternative:

http://rake.rubyforge.org/

Martin Fowler has a great introduction to the tool here: http://martinfowler.com/articles/rake.html

mikelong
+2  A: 

If you use Visual Studio (only) anyway, you could use its built-in build process in batch mode (type devenv /? in your cmd). That would be sufficient to build your C++ project and will resolve all C++ dependencies, which are hardest part.

Other things you could easily perform from batch script.

Also please read this 2 articles:

http://gamesfromwithin.com/the-quest-for-the-perfect-build-system

http://gamesfromwithin.com/the-quest-for-the-perfect-build-system-part-2

Alexander Poluektov
Interested in other peoples' thoughts on this kind of solution... it's one option I had in mind after seeing some big, stable commercial apps base their build/deployment around simple .BAT files.
John
I would say this solution don't scale up very well. But for *really simple* use cases it should be sufficient.
Alexander Poluektov
I would say that it does scale pretty well if you have everything in VS.Net projects. We use it for a ~1MLOC project. If you were dealing with even larger projects then there's also additional options such as Incredibuild for distributed builds.
the_mandrill
The linked articles are interesting but bear in mind that it's 5 years old.
the_mandrill
+1  A: 

If you have a spare box to spare I'd suggest Nant and [CruiseControl.net]. You don't have to necessarily use it for continuous integration you can set your builds to run [only when forced]. Both are open source, have native support for SVN, and are fairly easy to use. I've used Nant & CruiseControl.Net for each thing you have listed except the doxygen task. Even without the spare box I'd suggest using Nant to automate your way out of what looks like a long series of manual tasks.

Randolph
+1  A: 

Visual Studio still ships with a copy of Nmake, which is a classic build-by-dependency-rules tool. I can build your Visual Studio projects using devenv , and also do lots of other things. Anything you can do with a command line, you can do with nmake. And it has a pretty good macro language.

John Knoeller
+2  A: 

Hudson is very easy to setup, install and run, and has no problems running in a windows environment. You don't have to use it for continuous integration, it will happily do builds only when you tell it to.

Hudson has native support for executing windows batch scripts and will happily work NANT or cmake via plugins. If there isn't already a plugin for something you want to do, you can pretty easily accomplish it, if it could normally be done from the command line.

rjohnston
+1 for Hudson. Given that you have VS.Net project files you can build them from the command line with `devenv` or `msbuild` so it'll be very quick to set up an automated build system by calling a batch script with Hudson
the_mandrill
+1  A: 

Use http://www.finalbuilder.com as your buildserver, easy, user friendy and best of all, No XML hacking!

andy