Skip to content

Commit 370a5f1

Browse files
authored
Update README.md
1 parent 5555ee6 commit 370a5f1

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

README.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,40 @@ Create a file called SonarQube.Analysis.xml, containing at minimum sonar.cs.fxco
6666
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
6767
<Property Name="sonar.cs.fxcop.fxCopCmdPath">C:/Program Files (x86)/Microsoft Visual Studio 14.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe</Property>
6868
<Property Name="sonar.cs.fxcop.directory">\bin\debug\</Property>
69-
<Property Name="sonar.cs.fxcop.slnFile">\bin\debug\MyProject.sln</Property>
69+
<Property Name="sonar.cs.fxcop.slnFile">MyProject.sln</Property>
70+
</SonarQubeAnalysisProperties>
71+
```
72+
73+
use /s to set the addditional xml file
74+
75+
SonarQube.Scanner.MSBuild.exe begin /n:"MyProject" /v:"0.9.0.99" /k:"MyProject_key" /s:"C:\projects\MyDll\SonarQube.Analysis.xml"
76+
77+
msbuild /t:Rebuild MyProject.sln
78+
79+
SonarQube.Scanner.MSBuild.exe end
80+
81+
### Scan on base of an FxCop project file
82+
83+
It is possible to create a project file with the FxCop gui and then use this for the scan by parameter sonar.cs.fxcop.project.
84+
85+
**__Example:__**
86+
87+
SonarQube.Scanner.MSBuild.exe begin /n:"MyProject" /v:"0.9.0.99" /k:"MyProject_key" /d:"sonar.cs.fxcop.project=MyFxCopProject.project" /d:"sonar.cs.fxcop.fxCopCmdPath=C:/Program Files (x86)/Microsoft Visual Studio 14.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe" /d:"sonar.cs.fxcop.directory=bin\debug\"
88+
89+
msbuild /t:Rebuild MyProject.sln
90+
91+
SonarQube.Scanner.MSBuild.exe end
92+
93+
**__Example with SonarQube.Analysis.xml:__**
94+
95+
Create a file called SonarQube.Analysis.xml, containing at minimum sonar.cs.fxcop.slnFile, sonar.cs.fxcop.fxCopCmdPath and sonar.cs.fxcop.directory.
96+
97+
```xml
98+
<?xml version="1.0" encoding="utf-8"?>
99+
<SonarQubeAnalysisProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">
100+
<Property Name="sonar.cs.fxcop.fxCopCmdPath">C:/Program Files (x86)/Microsoft Visual Studio 14.0/Team Tools/Static Analysis Tools/FxCop/FxCopCmd.exe</Property>
101+
<Property Name="sonar.cs.fxcop.directory">\bin\debug\</Property>
102+
<Property Name="sonar.cs.fxcop.project">MyFxCopProject.project</Property>
70103
</SonarQubeAnalysisProperties>
71104
```
72105

0 commit comments

Comments
 (0)