Skip to content

Commit

Permalink
use SonarScanner (#244)
Browse files Browse the repository at this point in the history
* use SonarScanner
* specify toolset used with inspect code
* fix path to SonarAnalyzer assemblies
* fix path to System.Net.Http.Formatting
  • Loading branch information
Jérémie Bertrand authored and laedit committed Oct 17, 2020
1 parent c398d03 commit b653d05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
24 changes: 6 additions & 18 deletions build/build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,29 +37,17 @@ Target "RestorePackages" (fun _ ->
)

Target "BeginSonarQube" (fun _ ->
"msbuild-sonarqube-runner" |> Choco.Install id
"sonarscanner-msbuild-net46" |> Choco.Install id

SonarQube Begin (fun p ->
{p with
ToolsPath = "MSBuild.SonarQube.Runner.exe"
Key = "laedit_vika"
Name = "Vika"
Version = version
Settings = [
"sonar.host.url=https://sonarcloud.io";
"sonar.login=" + environVar "SonarQube_Token";
"sonar.projectDescription=\"Visual Interpreter of Kooky Analysis: parse analysis reports and send messages to the build server, or in console.\"";
"sonar.links.homepage=https://github.com/laedit/vika";
"sonar.links.ci=https://ci.appveyor.com/project/laedit/vika";
"sonar.links.issue=https://github.com/laedit/vika/issues";
"sonar.organization=laedit-github"
] })
directExec(fun info ->
info.FileName <- "SonarScanner.MSBuild.exe"
info.Arguments <- "begin /k:\"laedit_vika\" /n:\"Vika\" /o:laedit-github /v:\"" + version + "\" /d:sonar.host.url=https://sonarcloud.io /d:sonar.login=" + environVar "SonarQube_Token" + " /d:sonar.projectDescription=\"Visual Interpreter of Kooky Analysis: parse analysis reports and send messages to the build server, or in console.\" /d:sonar.links.homepage=https://github.com/laedit/vika /d:sonar.links.ci=https://ci.appveyor.com/project/laedit/vika /d:sonar.links.issue=https://github.com/laedit/vika/issues" ) |> ignore
)

Target "EndSonarQube" (fun _ ->
SonarQube End (fun p ->
{p with
ToolsPath = "MSBuild.SonarQube.Runner.exe"
ToolsPath = "SonarScanner.MSBuild.exe"
Settings = [ "sonar.login=" + environVar "SonarQube_Token" ]
})
)
Expand All @@ -75,7 +63,7 @@ Target "InspectCodeAnalysis" (fun _ ->

directExec(fun info ->
info.FileName <- "inspectcode"
info.Arguments <- "/o=\"" + artifactsDir + "inspectcodereport.xml\" /project=\"NVika\" \"src\Vika.sln\"" ) |> ignore
info.Arguments <- "-o=\"" + artifactsDir + "inspectcodereport.xml\" --project=\"NVika\" \"src\Vika.sln\" --toolset=14.0" ) |> ignore
)

let saveGendarmeReportAsGist report =
Expand Down
4 changes: 2 additions & 2 deletions src/NVika/NVika.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
<HintPath>..\packages\System.IO.Abstractions.3.0.2\lib\net40\System.IO.Abstractions.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="System.Net.Http.Formatting, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
Expand Down

0 comments on commit b653d05

Please sign in to comment.