[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sonar-user
Subject:    Re: [sonar-user] Sonar StyleCop runner challenge
From:       Fabrice Bellingard <fabrice.bellingard () sonarsource ! com>
Date:       2012-06-29 9:51:12
Message-ID: CA+PhQbsERxem4tCmBXzaL2Rm2-vhEZ5POov1mU0xPQCc3nEXrA () mail ! gmail ! com
[Download RAW message or body]

Hi Ed,

The main problem in your case is that the Sonar C# StyleCop plugin is not
(yet!) compatible with the version of  StyleCop that you are using (4.7). I
think it would be wiser to wait for the update, otherwise I'm pretty sure
your headache will last longer than expected ;-)

Once the update of the Sonar C# StyleCop plugin is available, then I will
suggest you to:

   - centralize the StyleCop configuration on the Sonar server = define
   your own C# quality profile(s)
   - let Sonar batch do everything for you = download the correct StyleCop
   config for a given project, run StyleCop and analyse the on-the-fly
   generated report

I know this is probably not the answer you expected, but IMO this is the
wisest position otherwise you will waste a lot of time on this whereas with
it should be straightforward.


Best regards,

 *Fabrice BELLINGARD | SonarSource**
*http://sonarsource.com



On Fri, Jun 29, 2012 at 9:47 AM, 00se <php078@gmail.com> wrote:

> Hello all,
>
> In addition to my previous post
>
> http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html
> here , I again want to ask for your support.
>
> The last few days I have given myself a big headache over configuring
> StyleCop in combination with the MSBuild tool using Sonar on a Jenkins CI
> platform.
>
> My setup:
> In jenkins I fist pull Sources and Binaries from another server to my
> Jenkins CI server using a batch file.
>
> In other words, I have *no influence* on any of the directory sturcture nor
> the version of StyleCop that is being used by the developers.
>
> The directory structure for the two solutions:
> Project 1
>  |__ Sources
>  |__ Binaries
>  |__ Tests
>
> Project 2
>  |__ Sources
>  |__ Binaries
>
> Within the Sources directory are one solution file and multiple projects.
> And one Settings.StyleCop, including the newer header like so:
> ..
> <StyleCopSettings Version="105">
>  <Parsers>
>    <Parser ParserId="StyleCop.CSharp.CsParser">
>      <ParserSettings>
>        <BooleanProperty Name="AnalyzeDesignerFiles">False</BooleanProperty>
>      </ParserSettings>
>    </Parser>
>  </Parsers>
> ..
>
> Since the StyleCop runner is not compatible with StyleCop 4.7/ MSBuild, you
> would think that then you would have to overwrite the Settings.StyleCop
> with
> a version compatibel with the embedded version of StyleCop as explained by
> Alexandre Victoor in the same post as
>
> http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html
> above .
>
> Next I invoke a standalone Sonar Runner to start analysis. As so far it
> failed very single time.
> My build attempts count is now at #204 attempts.
>
> Unfortunately I cannot get StyleCop to analyze the project using the Sonar
> runner.
>
> ..
> (StyleCop target) ->
>  C:\Program Files (x86)\MSBuild\StyleCop\v4.7\StyleCop.targets(98,5): error
> MSB4062: The "StyleCopTask" task could not be loaded from the assembly
> C:\Program Files (x86)\StyleCop 4.7\StyleCop.dll. Could not load file or
> assembly 'Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral,
> PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system
> cannot find the file specified. Confirm that the <UsingTask> declaration is
> correct, that the assembly and all its dependencies are available, and that
> the task contains a public class that implements
> Microsoft.Build.Framework.ITask. [C:\Documents and Settings\Default
> User\.jenkins\workspace\[project]\Sources\blah\blah.csproj]
> ..
>
> So what do I have?
>
> I have two  solutions with multiple projects containing a Settings.StyleCop
> file which cannot work together with the embedded StyleCop version of
> 4.4.0.14.
>
> Changing the Settings.StyleCop after fetching the solutions and copying the
> file twice to the respective Sources directories (thus overwriting the
> StyleCop 4.7 settings) didn't work neither.
>
> Basically I have tried every setup possible;
> changing the Settings.StyleCop file, changing the
> (Microsoft.)StyleCop.Targets file in any combination possible with StyleCop
> v4.7 or the embbeded version..running analysis over and over using the
> standalone runner from within Jenkins.
>
> My question:
> Does anyone have the magic setup for me on how I can configure Jenkins,
> Sonar, MSBuild to work happily together?
>
> (I am aware that this mailinglist is about Sonar and yet asking and finding
> the answer for what I ask above might help a lot of other people too)
>
> Thanks in advance for your well appreciated answers.
>
>
> Best regards,
>
>
> Ed
>
>
> p.s.  http://jira.codehaus.org/browse/SONARPLUGINS-1405 looking forward to
> the nightlybuild of StyleCop runner plugin with 4.7 embedded ;-)
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://sonar.15.n6.nabble.com/Sonar-StyleCop-runner-challenge-tp5000391.html
> Sent from the Sonar user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

[Attachment #3 (text/html)]

Hi Ed,<div><br></div><div>The main problem in your case is that the Sonar C# StyleCop \
plugin is not (yet!) compatible with the version of  StyleCop that you are using \
(4.7). I think it would be wiser to wait for the update, otherwise I&#39;m pretty \
sure your headache will last longer than expected ;-)</div>

<div><br></div><div>Once the update of the Sonar C# StyleCop plugin is available, \
then I will suggest you to:</div><div><ul><li>centralize the StyleCop configuration \
on the Sonar server = define your own C# quality profile(s)</li>

<li>let Sonar batch do everything for you = download the correct StyleCop config for \
a given project, run StyleCop and analyse the on-the-fly generated \
report</li></ul></div><div>I know this is probably not the answer you expected, but \
IMO this is the wisest position otherwise you will waste a lot of time on this \
whereas with it should be straightforward.</div>

<div><br clear="all"><span \
style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><br></div><div>Best \
regards,</div><div><br></div><div><table width="100%" border="0" cellspacing="0" \
cellpadding="0" style="color:rgb(34,34,34);background-color:rgb(255,255,255);font-family:&#39;Times \
New Roman&#39;">

<tbody><tr><td style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-family:arial,sans-serif"></td></tr><tr><td \
style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-family:arial,sans-serif">


<div style="font-family:Arial,Helvetica,sans-serif;font-size:12px"><strong>Fabrice \
BELLINGARD | <font color="#C30C00">SonarSource</font></strong><font \
color="#666666"><i><br></i></font><a href="http://sonarsource.com/" \
style="color:rgb(195,12,0)" target="_blank">http://sonarsource.com</a></div>

</td></tr></tbody></table></div></span><br>
<br><br><div class="gmail_quote">On Fri, Jun 29, 2012 at 9:47 AM, 00se <span \
dir="ltr">&lt;<a href="mailto:php078@gmail.com" \
target="_blank">php078@gmail.com</a>&gt;</span> wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">

Hello all,<br>
<br>
In addition to my previous post<br>
<a href="http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html" \
target="_blank">http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html</a><br>
 here , I again want to ask for your support.<br>
<br>
The last few days I have given myself a big headache over configuring<br>
StyleCop in combination with the MSBuild tool using Sonar on a Jenkins CI<br>
platform.<br>
<br>
My setup:<br>
In jenkins I fist pull Sources and Binaries from another server to my<br>
Jenkins CI server using a batch file.<br>
<br>
In other words, I have *no influence* on any of the directory sturcture nor<br>
the version of StyleCop that is being used by the developers.<br>
<br>
The directory structure for the two solutions:<br>
Project 1<br>
  |__ Sources<br>
  |__ Binaries<br>
  |__ Tests<br>
<br>
Project 2<br>
  |__ Sources<br>
  |__ Binaries<br>
<br>
Within the Sources directory are one solution file and multiple projects.<br>
And one Settings.StyleCop, including the newer header like so:<br>
..<br>
&lt;StyleCopSettings Version=&quot;105&quot;&gt;<br>
  &lt;Parsers&gt;<br>
    &lt;Parser ParserId=&quot;StyleCop.CSharp.CsParser&quot;&gt;<br>
      &lt;ParserSettings&gt;<br>
        &lt;BooleanProperty \
Name=&quot;AnalyzeDesignerFiles&quot;&gt;False&lt;/BooleanProperty&gt;<br>  \
&lt;/ParserSettings&gt;<br>  &lt;/Parser&gt;<br>
  &lt;/Parsers&gt;<br>
..<br>
<br>
Since the StyleCop runner is not compatible with StyleCop 4.7/ MSBuild, you<br>
would think that then you would have to overwrite the Settings.StyleCop with<br>
a version compatibel with the embedded version of StyleCop as explained by<br>
Alexandre Victoor in the same post as<br>
<a href="http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html" \
target="_blank">http://sonar.15.n6.nabble.com/Problems-with-stylecop-4-7-Sonar-and-Jenkins-td4999639.html</a><br>
 above .<br>
<br>
Next I invoke a standalone Sonar Runner to start analysis. As so far it<br>
failed very single time.<br>
My build attempts count is now at #204 attempts.<br>
<br>
Unfortunately I cannot get StyleCop to analyze the project using the Sonar<br>
runner.<br>
<br>
..<br>
(StyleCop target) -&gt;<br>
  C:\Program Files (x86)\MSBuild\StyleCop\v4.7\StyleCop.targets(98,5): error<br>
MSB4062: The &quot;StyleCopTask&quot; task could not be loaded from the assembly<br>
C:\Program Files (x86)\StyleCop 4.7\StyleCop.dll. Could not load file or<br>
assembly &#39;Microsoft.Build.Utilities.v3.5, Version=3.5.0.0, Culture=neutral,<br>
PublicKeyToken=b03f5f7f11d50a3a&#39; or one of its dependencies. The system<br>
cannot find the file specified. Confirm that the &lt;UsingTask&gt; declaration is<br>
correct, that the assembly and all its dependencies are available, and that<br>
the task contains a public class that implements<br>
Microsoft.Build.Framework.ITask. [C:\Documents and Settings\Default<br>
User\.jenkins\workspace\[project]\Sources\blah\blah.csproj]<br>
..<br>
<br>
So what do I have?<br>
<br>
I have two  solutions with multiple projects containing a Settings.StyleCop<br>
file which cannot work together with the embedded StyleCop version of<br>
4.4.0.14.<br>
<br>
Changing the Settings.StyleCop after fetching the solutions and copying the<br>
file twice to the respective Sources directories (thus overwriting the<br>
StyleCop 4.7 settings) didn&#39;t work neither.<br>
<br>
Basically I have tried every setup possible;<br>
changing the Settings.StyleCop file, changing the<br>
(Microsoft.)StyleCop.Targets file in any combination possible with StyleCop<br>
v4.7 or the embbeded version..running analysis over and over using the<br>
standalone runner from within Jenkins.<br>
<br>
My question:<br>
Does anyone have the magic setup for me on how I can configure Jenkins,<br>
Sonar, MSBuild to work happily together?<br>
<br>
(I am aware that this mailinglist is about Sonar and yet asking and finding<br>
the answer for what I ask above might help a lot of other people too)<br>
<br>
Thanks in advance for your well appreciated answers.<br>
<br>
<br>
Best regards,<br>
<br>
<br>
Ed<br>
<br>
<br>
p.s.  <a href="http://jira.codehaus.org/browse/SONARPLUGINS-1405" \
target="_blank">http://jira.codehaus.org/browse/SONARPLUGINS-1405</a> looking forward \
to<br> the nightlybuild of StyleCop runner plugin with 4.7 embedded ;-)<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a \
href="http://sonar.15.n6.nabble.com/Sonar-StyleCop-runner-challenge-tp5000391.html" \
target="_blank">http://sonar.15.n6.nabble.com/Sonar-StyleCop-runner-challenge-tp5000391.html</a><br>
 Sent from the Sonar user mailing list archive at Nabble.com.<br>
<br>
---------------------------------------------------------------------<br>
To unsubscribe from this list, please visit:<br>
<br>
    <a href="http://xircles.codehaus.org/manage_email" \
target="_blank">http://xircles.codehaus.org/manage_email</a><br> <br>
<br>
</blockquote></div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic