开发者

How can I retain compiler warnings in Hudson (CI) when using SVN Update?

I've got a continuous integration setup using Hudson and lately I've configured the jobs to use svn update to get the latest version of the code. I really like this approach since it allows msbuild to version appropriately and only build the effected assemblies.

However, I've noticed that since I'm not doing a build of all the assemblies again, I lo开发者_如何学Cose all of the compiler warnings for those assemblies if they aren't built.

For example, if I have 3 assemblies with dependencies demonstrated via indenting:

  • Assembly 1 10 warnings
    • Assembly 2 (Depends on 1) 10 warnings
      • Assembly 3 (Depends on 2) 10 warnings

The first build will build all 3 assemblies and log 30 warnings.

Next build, if I only change Assembly 3, Hudson will only build Assembly 3 and I will only get 10 warnings for that build, effectively marking 20 warnings as "fixed".

As far as I can tell, there isn't going to be any way around this, but I would love to know if anyone has configured Hudson to retain these compiler warnings from one build to another.

Edit: Yes I realize that this can turn into a debate of "you should / shouldn't be doing an update on a CI box", but there are reasons we went with the update approach.

  • Its roughly 3x faster
  • We're still producing the most up to date assemblies
  • msbuild can version the assemblies appropriately.


I would change your approach to a CI build. Doing an incremental build on a build machine is very misleading, and only of marginal value (IMHO) and unless your system is the size of an operating system you are probably not saving yourself much time.

If you have assemblies which do not change often or ever, package them away as "third party" dependencies (maybe even in a merge module so your deployment can pick them up easily) and don't rebuild them with your CI.

On the other hand, if all your assemblies are volatile (need to be rebuilt more than once in a release cycle) build them all, all the time.


Well, msbuild is doing what it should be doing: Its only logging the warnings that it encountered.

If you must use svn update, the only way would be to somehow:

  • parse the build log and determine what assemblies were not built
  • foreach unbuilt assembly
    • look up the warnings for the last time that particular assembly was built
    • manually carry those warnings forward, into the current build.

It may / may not be unwieldy and it would have to have a decent understanding of the msbuild log format.

One could also argue that it is misleading since you'd be recording warnings that were not logged for that particular build.


You do the continuous integration to see how one assembly interferes the other assemblies. So if they have dependencies you should build all. If they don't have dependencies at all, create one job per assembly (in your case 3).

The version you describe is not a full build it is only an update build and should be done on the developers machine.

EDIT: Versioning Issue

You can configure Hudson (in connection with SVN) to ignore commits by certain users. Using this black list, there should be no issue with msbuild doing the versioning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜