FAKE - F# Make - A DSL for build tasks and more FAKE
6.1.3

Lookig for older versions of the documentation, pre FAKE v6? See 

v5.fake.build

SonarQube Module

Contains a task to run the SonarQube static code analyzer. It uses the SonarScanner for MSBuild

Types

Type Description

SonarQubeParams

Parameter type to configure the SonarQube runner.

Functions and values

Function or value Description

finish setParams

Full Usage: finish setParams

Parameters:

This task can be used to run the end command of Sonar Qube on a project.

setParams : (SonarQubeParams -> SonarQubeParams) option

Function used to overwrite the SonarQube default parameters.

Example


 open Fake.Testing

   SonarQube.finish None

   SonarQube.finish (Some (fun p ->
    { p with
         Settings = ["sonar.login=login"; "sonar.password=password"] }))

scan setParams doBetween

Full Usage: scan setParams doBetween

Parameters:

This task can be used to execute some code between the `begin` and `end` [Sonar Qube](http://sonarqube.org/) on a project.

setParams : SonarQubeParams -> SonarQubeParams

Function used to overwrite the SonarQube default parameters.

doBetween : unit -> unit

Function executed between begin and endSonar Qube commands.

Example


 open Fake.Testing

 Target.create "StaticAnalysis" (fun _ ->
   let setParams p =
     { p with Key = "ProjectKey"
              Name = "ProjectName"
              Version = "3.2.1"
              Settings =
                 [ "sonar.host.url=" + SONAR_HOST_URL
                   "sonar.login=" + SONAR_TOKEN
                   "sonar.cs.opencover.reportsPaths=opencovercoverage.xml"
                 ]
              // choose what you need
              // https://fake.build/guide/dotnet-cli.html#SDK-tools-local-global-clireference
              ToolType = ToolType.CreateGlobalTool() // Start as dotnet global tool (`sonarscanner`)
              ToolType = ToolType.CreateLocalTool()  // Start as dotnet local tool (`dotnet sonarscanner`)
     }
   SonarQube.scan setParams (fun () ->
         DotNet.build id
         DotNet.test id
   )
 )

start setParams

Full Usage: start setParams

Parameters:

This task can be used to run the begin command of Sonar Qube on a project.

setParams : SonarQubeParams -> SonarQubeParams

Function used to overwrite the SonarQube default parameters.

Example


 open Fake.Testing

   SonarQube.start (fun p ->
     { p with
           Key = "MyProject"
           Name = "MainTool"
           Version = "1.0 })