views:

976

answers:

7

Simple question. I use Visual studio and i 've just installed subversion, how can i force the project to be build with msbuild, and if successfully build commit it else warn the user. I would use TortoiseSVN or VisualSVN or AKHSV (whatever it's called) if they have the ability to force build on commit builtin (i know that this is not their usage, i know they are just used as just GUI for committing to SVN) i would like to know if any of this tools can to this extra thing.

To wrap up i am just searching for a painless way to build before commit for subversion.

+4  A: 

TortoiseSVN has client-side hook scripts which you could use. For example, you could write a script which does the build and only returns true if the build was successful. Then add that script as a pre-commit hook.

Stefan
+4  A: 

You could also use CruiseControl, Hudson or another continuous integration tool.

These could run in the background, watch for changes and then build.

Fortyrunner
+2  A: 

The method Stefan suggested seems to be potentially the best for you.

However an alternative depending on what your trying to gain, might be to run with some sort of Automated Continuous Integration so every time a commit is made a build / test will be run, then if there are problems it could raise an alert or whatever. Since your using visual studio guessing your using .NET so CruiseControl might be worth a look.

Mark Davidson
+4  A: 

Take a look at TeamCity's "pre-tested commit" a.k.a "delayed commit" a.k.a "private build" feature.

In a nutshell, you "commit" to TeamCity, TeamCity verifies your build and commits to the real repository only if the build passes. If not, you're told so. The advantage here is that your trunk is never broken.

Mauricio Scheffer
+1, Team City is great!
CMS
+1  A: 

I think this might work for you since you use SVN.

In all what you are asking for is like what mausch suggested, a CI server. In that case TeamCity fits the bill.

But perhaps you didnt need all the bells and whistles that came with a CI server. Then SIN might work for you. Check it out if you have time!

ShaChris23
+1  A: 

Well, you may also educate your co-workers if you are not willing to pay for special tools...

Romulo A. Ceccon
A: 

Does anyone know if there is a way to force commits to go through TeamCity, so as to prevent our developers from committing code directly to the svn repository without running a personal build first?

Thanks in advance

Paul