<commit_before>//////////////////////////////////////////////////////////////////////
// MODULES
//////////////////////////////////////////////////////////////////////
#module "nuget:?package=Cake.DotNetTool.Module"

//////////////////////////////////////////////////////////////////////
// ADDINS
//////////////////////////////////////////////////////////////////////

//#addin "nuget:?package=Cake.FileHelpers&version=3.0.0"
#addin "nuget:?package=Cake.Coveralls&version=0.9.0"
//#addin "nuget:?package=Cake.PinNuGetDependency&version=3.0.1"
//#addin "nuget:?package=Cake.Powershell&version=0.4.5"
//#addin "nuget:?package=Cake.Sonar&version=1.0.4"

//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////

#tool "nuget:?package=GitReleaseManager&version=0.7.1"
#tool "nuget:?package=coveralls.io&version=1.4.2"
#tool "nuget:?package=OpenCover&version=4.6.519"
#tool "nuget:?package=ReportGenerator&version=3.1.2"
#tool "nuget:?package=vswhere&version=2.5.2"
#tool "nuget:?package=xunit.runner.console&version=2.4.0"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.5"
#tool "nuget:?package=MSBuild.SonarQube.Runner.Tool"
#tool "dotnet:?package=dotnet-sonarscanner&version=4.4.2"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
if (string.IsNullOrWhiteSpace(target))
{
    target = "Default";
}

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Should MSBuild treat any errors as warnings?
var treatWarningsAsErrors = false;

// Build configuration
var githubOwner = "dhgms-solutions";
var githubRepository = "gripewithroslyn";
var githubUrl = string.Format("https://github.com/{0}/{1}", githubOwner, githubRepository);
var solutionToBuild = "./src/Dhgms.GripeWithRoslyn.sln";

var local = BuildSystem.IsLocalBuild;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
var isRepository = StringComparer.OrdinalIgnoreCase.Equals(githubOwner + "/" + githubRepository, AppVeyor.Environment.Repository.Name);

var isDevelopBranch = StringComparer.OrdinalIgnoreCase.Equals("develop", AppVeyor.Environment.Repository.Branch);
var isReleaseBranch = StringComparer.OrdinalIgnoreCase.Equals("master", AppVeyor.Environment.Repository.Branch);
var isTagged = AppVeyor.Environment.Repository.Tag.IsTag;
var unitTestProjectFilePath = "./src/Dhgms.GripeWithRoslyn.Analyzer.UnitTests/Dhgms.GripeWithRoslyn.Analyzer.UnitTests.csproj";


var vsPath = VSWhereLatest();

if (vsPath == null)
{
    throw new Exception("Unable to find Visual Studio");
}
Information("Visual Studio Path: " + vsPath);

var msBuildPath = GetFiles(vsPath + "/**/msbuild.exe").FirstOrDefault();
if (msBuildPath == null)
{
    throw new Exception("Unable to find MSBuild path");
}
Information("MSBuild Path: " + msBuildPath);

var androidHome = EnvironmentVariable("ANDROID_HOME");

// Version
var gitVersion = GitVersion();
var majorMinorPatch = gitVersion.MajorMinorPatch;
var informationalVersion = gitVersion.InformationalVersion;
var nugetVersion = gitVersion.NuGetVersionV2;
var buildVersion = gitVersion.FullBuildMetaData;
var assemblyVersion = gitVersion.Major + "." + gitVersion.Minor + ".0.0";
var fileVersion = majorMinorPatch;
var packageVersion = isReleaseBranch ? majorMinorPatch : informationalVersion;
Information("nugetVersion: " + nugetVersion);
Information("informationalVersion: " + informationalVersion);
Information("assemblyVersion: " + assemblyVersion);
Information("fileVersion: " + fileVersion);


// Artifacts
var artifactDirectory = "./artifacts/";
var testCoverageOutputFile = artifactDirectory + "OpenCover.xml";
var packageWhitelist = new[] { "Dhgms.GripeWithRoslyn.Analyser" };

var runSonarQube = false;
var sonarQubePreview = false;
var sonarQubeLogin = EnvironmentVariable("sonarqubeLogin");
var sonarqubeProjectKey = "gripewithroslyn";
var sonarqubeOrganisationKey = "dpvreony-github";

// sonarqube
if (isRepository && !local && sonarQubeLogin != null)
{<commit_msg>corrected pkg name in whitelist<commit_after>//////////////////////////////////////////////////////////////////////
// MODULES
//////////////////////////////////////////////////////////////////////
#module "nuget:?package=Cake.DotNetTool.Module"

//////////////////////////////////////////////////////////////////////
// ADDINS
//////////////////////////////////////////////////////////////////////

//#addin "nuget:?package=Cake.FileHelpers&version=3.0.0"
#addin "nuget:?package=Cake.Coveralls&version=0.9.0"
//#addin "nuget:?package=Cake.PinNuGetDependency&version=3.0.1"
//#addin "nuget:?package=Cake.Powershell&version=0.4.5"
//#addin "nuget:?package=Cake.Sonar&version=1.0.4"

//////////////////////////////////////////////////////////////////////
// TOOLS
//////////////////////////////////////////////////////////////////////

#tool "nuget:?package=GitReleaseManager&version=0.7.1"
#tool "nuget:?package=coveralls.io&version=1.4.2"
#tool "nuget:?package=OpenCover&version=4.6.519"
#tool "nuget:?package=ReportGenerator&version=3.1.2"
#tool "nuget:?package=vswhere&version=2.5.2"
#tool "nuget:?package=xunit.runner.console&version=2.4.0"
#tool "nuget:?package=GitVersion.CommandLine&version=3.6.5"
#tool "nuget:?package=MSBuild.SonarQube.Runner.Tool"
#tool "dotnet:?package=dotnet-sonarscanner&version=4.4.2"

//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
if (string.IsNullOrWhiteSpace(target))
{
    target = "Default";
}

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Should MSBuild treat any errors as warnings?
var treatWarningsAsErrors = false;

// Build configuration
var githubOwner = "dhgms-solutions";
var githubRepository = "gripewithroslyn";
var githubUrl = string.Format("https://github.com/{0}/{1}", githubOwner, githubRepository);
var solutionToBuild = "./src/Dhgms.GripeWithRoslyn.sln";

var local = BuildSystem.IsLocalBuild;
var isPullRequest = AppVeyor.Environment.PullRequest.IsPullRequest;
var isRepository = StringComparer.OrdinalIgnoreCase.Equals(githubOwner + "/" + githubRepository, AppVeyor.Environment.Repository.Name);

var isDevelopBranch = StringComparer.OrdinalIgnoreCase.Equals("develop", AppVeyor.Environment.Repository.Branch);
var isReleaseBranch = StringComparer.OrdinalIgnoreCase.Equals("master", AppVeyor.Environment.Repository.Branch);
var isTagged = AppVeyor.Environment.Repository.Tag.IsTag;
var unitTestProjectFilePath = "./src/Dhgms.GripeWithRoslyn.Analyzer.UnitTests/Dhgms.GripeWithRoslyn.Analyzer.UnitTests.csproj";


var vsPath = VSWhereLatest();

if (vsPath == null)
{
    throw new Exception("Unable to find Visual Studio");
}
Information("Visual Studio Path: " + vsPath);

var msBuildPath = GetFiles(vsPath + "/**/msbuild.exe").FirstOrDefault();
if (msBuildPath == null)
{
    throw new Exception("Unable to find MSBuild path");
}
Information("MSBuild Path: " + msBuildPath);

var androidHome = EnvironmentVariable("ANDROID_HOME");

// Version
var gitVersion = GitVersion();
var majorMinorPatch = gitVersion.MajorMinorPatch;
var informationalVersion = gitVersion.InformationalVersion;
var nugetVersion = gitVersion.NuGetVersionV2;
var buildVersion = gitVersion.FullBuildMetaData;
var assemblyVersion = gitVersion.Major + "." + gitVersion.Minor + ".0.0";
var fileVersion = majorMinorPatch;
var packageVersion = isReleaseBranch ? majorMinorPatch : informationalVersion;
Information("nugetVersion: " + nugetVersion);
Information("informationalVersion: " + informationalVersion);
Information("assemblyVersion: " + assemblyVersion);
Information("fileVersion: " + fileVersion);


// Artifacts
var artifactDirectory = "./artifacts/";
var testCoverageOutputFile = artifactDirectory + "OpenCover.xml";
var packageWhitelist = new[] { "Dhgms.GripeWithRoslyn.Analyzer" };

var runSonarQube = false;
var sonarQubePreview = false;
var sonarQubeLogin = EnvironmentVariable("sonarqubeLogin");
var sonarqubeProjectKey = "gripewithroslyn";
var sonarqubeOrganisationKey = "dpvreony-github";

// sonarqube
if (isRepository && !local && sonarQubeLogin != null)
{
{'fraction_non_alphanumeric': 0.28044193700047015, 'fraction_numerical': 0.010813352139163141, 'mean_word_length': 2.659784946236559, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '40747', 'n_tokens_mistral': 2488, 'n_tokens_neox': 2408, 'n_words': 408}