-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonarqube migration #1583
Merged
Merged
Sonarqube migration #1583
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Auto-Generated by FAKE; do not edit | ||
namespace System | ||
open System.Reflection | ||
|
||
[<assembly: AssemblyTitleAttribute("FAKE - F# Make Analizing your project with SOnarQube")>] | ||
[<assembly: AssemblyProductAttribute("FAKE - F# Make")>] | ||
[<assembly: AssemblyVersionAttribute("5.0.0")>] | ||
[<assembly: AssemblyInformationalVersionAttribute("5.0.0")>] | ||
[<assembly: AssemblyFileVersionAttribute("5.0.0")>] | ||
do () | ||
|
||
module internal AssemblyVersionInformation = | ||
let [<Literal>] AssemblyTitle = "FAKE - F# Make Analizing your project with SOnarQube" | ||
let [<Literal>] AssemblyProduct = "FAKE - F# Make" | ||
let [<Literal>] AssemblyVersion = "5.0.0" | ||
let [<Literal>] AssemblyInformationalVersion = "5.0.0" | ||
let [<Literal>] AssemblyFileVersion = "5.0.0" |
34 changes: 34 additions & 0 deletions
34
src/app/Fake.Testing.SonarQube/Fake.Testing.SonarQube.fsproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<Project Sdk="FSharp.NET.Sdk;Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<VersionPrefix>1.0.0-alpha-10</VersionPrefix> | ||
<TargetFramework>netstandard1.6</TargetFramework> | ||
<DefineConstants>$(DefineConstants);NO_DOTNETCORE_BOOTSTRAP</DefineConstants> | ||
<DebugType>pdbonly</DebugType> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<AssemblyName>Fake.Testing.SonarQube</AssemblyName> | ||
<OutputType>Library</OutputType> | ||
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netstandard1.6' ">$(PackageTargetFallback);portable-net45+win8;dnxcore50</PackageTargetFallback> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' "> | ||
<DefineConstants>$(DefineConstants);NETSTANDARD;USE_HTTPCLIENT</DefineConstants> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> | ||
<DefineConstants>$(DefineConstants);RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="AssemblyInfo.fs" /> | ||
<Compile Include="SonarQube.fs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Fake.Core.Tracing\Fake.Core.Tracing.fsproj" /> | ||
<ProjectReference Include="..\Fake.Core.Process\Fake.Core.Process.fsproj" /> | ||
<ProjectReference Include="..\Fake.Core.Globbing\Fake.Core.Globbing.fsproj" /> | ||
<ProjectReference Include="..\Fake.IO.FileSystem\Fake.IO.FileSystem.fsproj" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<DotNetCliToolReference Include="dotnet-compile-fsc"> | ||
<Version>1.0.0-preview2-020000</Version> | ||
</DotNetCliToolReference> | ||
</ItemGroup> | ||
<Import Project="..\..\..\.paket\Paket.Restore.targets" /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/// Contains a task to run the msbuild runner of [SonarQube analyzer](http://sonarqube.org). | ||
module Fake.Testing.SonarQube | ||
|
||
open System.IO | ||
open Fake.Core | ||
open Fake.Core.Globbing | ||
open Fake.Core.Process | ||
open Fake.IO.FileSystem.Operators | ||
|
||
/// [omit] | ||
/// The supported commands of SonarQube. It is called with Begin before compilation, and End after compilation. | ||
type private SonarQubeCall = Begin | End | ||
|
||
/// Parameter type to configure the SonarQube runner. | ||
type SonarQubeParams = { | ||
/// FileName of the SonarQube runner exe. | ||
ToolsPath : string | ||
/// Key to identify the SonarQube project | ||
Key : string | ||
/// Name of the project | ||
Name : string | ||
/// Version number of the project | ||
Version : string | ||
/// Individual global settings for SonarQube | ||
Settings : string list | ||
/// Read settings from configuration file | ||
Config : string option | ||
} | ||
|
||
/// SonarQube default parameters - tries to locate MSBuild.SonarQube.exe in any subfolder. | ||
let SonarQubeDefaults = | ||
{ ToolsPath = Tools.findToolInSubPath "MSBuild.SonarQube.Runner.exe" (Directory.GetCurrentDirectory() @@ "tools" @@ "SonarQube") | ||
Key = null | ||
Name = null | ||
Version = "1.0" | ||
Settings = [] | ||
Config = None } | ||
|
||
/// [omit] | ||
/// Execute the external msbuild runner of SonarQube. Parameters are given to the command line tool as required. | ||
let private SonarQubeCall (call: SonarQubeCall) (parameters : SonarQubeParams) = | ||
let sonarPath = parameters.ToolsPath | ||
let setArgs = parameters.Settings |> List.fold (fun acc x -> acc + "/d:" + x + " ") "" | ||
|
||
let cfgArgs = | ||
match parameters.Config with | ||
| Some(x) -> (" /s:"+x) | ||
| None -> "" | ||
|
||
let args = | ||
match call with | ||
| Begin -> "begin /k:\"" + parameters.Key + "\" /n:\"" + parameters.Name + "\" /v:\"" + parameters.Version + "\" " + setArgs + cfgArgs | ||
| End -> "end " + setArgs + cfgArgs | ||
|
||
let result = | ||
ExecProcess (fun info -> | ||
info.FileName <- sonarPath | ||
info.Arguments <- args) System.TimeSpan.MaxValue | ||
if result <> 0 then failwithf "Error during sonar qube call %s" (call.ToString()) | ||
|
||
/// This task to can be used to run the begin command of [Sonar Qube](http://sonarqube.org/) on a project. | ||
/// ## Parameters | ||
/// | ||
/// - `setParams` - Function used to overwrite the SonarQube default parameters. | ||
/// | ||
/// ## Sample | ||
|
||
/// open Fake.Testing | ||
/// | ||
/// SonarQube.Begin (fun p -> | ||
/// {p with | ||
/// Key = "MyProject" | ||
/// Name = "MainTool" | ||
/// Version = "1.0 }) | ||
/// | ||
let Begin setParams = | ||
use __ = Trace.traceTask "SonarQube" "Begin" | ||
let parameters = setParams SonarQubeDefaults | ||
SonarQubeCall Begin parameters | ||
|
||
/// This task to can be used to run the end command of [Sonar Qube](http://sonarqube.org/) on a project. | ||
/// ## Parameters | ||
/// | ||
/// - `setParams` - Function used to overwrite the SonarQube default parameters. | ||
/// | ||
/// ## Sample | ||
|
||
/// open Fake.Testing | ||
/// | ||
/// SonarQube.End None | ||
/// | ||
/// SonarQube.End (fun p -> | ||
/// {p with | ||
/// Settings = ["sonar.login=login", "sonar.password=password"] }) | ||
/// | ||
let End setParams = | ||
use __ = Trace.traceTask "SonarQube" "End" | ||
let parameters = match setParams with | ||
| Some setParams -> setParams SonarQubeDefaults | ||
| None -> (fun p -> { p with Settings = [] }) SonarQubeDefaults | ||
SonarQubeCall End parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
group netcore | ||
FSharp.NET.Sdk | ||
FSharp.Core | ||
NETStandard.Library |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I should probably update those, as I moved them into a subfolder..