Quantcast
Channel: MSBuild Extension Pack
Viewing all articles
Browse latest Browse all 1211

New Post: Proposal on code analisys improvement

$
0
0
Mike,
I love your extension pack. And i know that you are very experience at MSBUILD and microsoft products. I want to ask you opinion about Microsoft static Code Analysis improvement. It is connected with msbuild process so maybe it can be the part of your pack...

So the subject. As you know Static CA makes solution build mutch slower. In my case > 2x slower than without CA. We can disable it but that is bad decision to lose its power. So what can we do?

First lets see how CA works.

You build solution. At eatch project build after msbuild Compile target fxcopcmd.exe is called with paths to assemblies witch should be analyzed. fxcopcmd. generates CA xml log witch is used by VS (or maybe output stream). fxcopcmd.exe loads assemblies(fast) and analyzing its synchronously, so only one CPU is loaded and 3 (in my case) are doing nothing. Only after CA is finished the next project in project dependency chain is builded.

So the week place in CA were we can improve it - to force it work in paralel to use all CPUs.


I see such solution: To make fake fxcopcmd.exe(or better override code analysis target) that will take parameters from MSBUILD, remember its and instantly report to msbuild that all is ok and there were no error(through CA xml.log, or succeeded file, or maybe stream..). So MSBUILD will build the next project and at that time we will call real fxcopcmd.exe with saved parameters... if MSBUILD will call fxcopcmd.exe on next project - we will call one more time fxcopcmd.exe... so there will be few processes witch will load all CPU'S. After real fxcopcmd.exe will finished we can call our MSBUILD target witch will call only CA target from microsoft.common.targtets with out compiling and our fake fxcopcmd.exe will instantly repporting results(CA is finished at that time and we have log) to MSBUILD-VS.
That is my general vision.
What do you think? Will this speed up CA? Why Microsoft didn't make such staff and use only one CPU in CA?

Viewing all articles
Browse latest Browse all 1211

Trending Articles