<commit_before>#addin "Cake.FileHelpers"
#addin "Cake.Coveralls"
#tool "nuget:?package=OpenCover"
#tool "nuget:?package=ReportGenerator"
#tool coveralls.io

var target = Argument<string>("target", "Default");

var githubApiKey = Argument<string>("githubApiKey", "");
var coverallsApiKey = Argument<string>("coverallsApiKey", "");
var nugetApiKey = Argument("nugetApiKey", "");

var configuration =
    HasArgument("Configuration") ? Argument<string>("Configuration") :
    EnvironmentVariable("Configuration") != null ? EnvironmentVariable("Configuration") :
    "Release";
var preReleaseSuffix =
    HasArgument("PreReleaseSuffix") ? Argument<string>("PreReleaseSuffix") :
    (AppVeyor.IsRunningOnAppVeyor && AppVeyor.Environment.Repository.Tag.IsTag) ? null :
    EnvironmentVariable("PreReleaseSuffix") != null ? EnvironmentVariable("PreReleaseSuffix") :
    "beta";
var buildNumber =
    HasArgument("BuildNumber") ? Argument<int>("BuildNumber") :
    AppVeyor.IsRunningOnAppVeyor ? AppVeyor.Environment.Build.Number :
    TravisCI.IsRunningOnTravisCI ? TravisCI.Environment.Build.BuildNumber :
    EnvironmentVariable("BuildNumber") != null ? int.Parse(EnvironmentVariable("BuildNumber")) :
    0;

 var restoreSources = new [] {
     "https://www.myget.org/F/xunit/api/v3/index.json",
     "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
     "https://dotnet.myget.org/F/cli-deps/api/v3/index.json",
     "https://api.nuget.org/v3/index.json"
};

var githubOwner = "jrgcubano";
var githubRepo = "GildedRose";
var githubRawUri = "http://raw.githubusercontent.com";
var output = Directory("build");
var publish = Directory("publish");
var release = Directory("release");
var outputNuGet = output + Directory("nuget");
var coverageAssemblies = new[] { "GildedRose" };

Task("Clean")
	.Does(() => 
    {        
        CleanDirectories(output);
        CleanDirectories(publish);
        CleanDirectories(release);
        DeleteDirectories(GetDirectories("**/bin"), true);
        DeleteDirectories(GetDirectories("**/obj"), true);
	});


Task("Restore")
    .IsDependentOn("Clean")
    .Does(() => 
    {        
        var settings = new DotNetCoreRestoreSettings {
            Sources = restoreSources
        };
        var srcProjects = GetFiles("./src/**/*.csproj");
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in srcProjects)
        {
            DotNetCoreRestore(project.GetDirectory().FullPath, settings);
        }    
        foreach(var project in testProjects)
        {
            DotNetCoreRestore(project.GetDirectory().FullPath, settings);
        }    
    });

 Task("Build")
    .IsDependentOn("Restore")
    .Does(() =>
    { 
        var srcProjects = GetFiles("./src/**/*.csproj");
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in srcProjects)
        {
            DotNetCoreBuild(
                project.GetDirectory().FullPath,
                new DotNetCoreBuildSettings()
                {                
                    Configuration = configuration
                });
        }           
        foreach(var project in testProjects)
        {
            DotNetCoreBuild(
                project.GetDirectory().FullPath,
                new DotNetCoreBuildSettings()
                {                
                    Configuration = configuration
                });
        }           
    });

Task("Test")
    .IsDependentOn("Build")
    .Does(() =>
    {
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in testProjects)
        {
            DotNetCoreTest(
                project.ToString(),
                new DotNetCoreTestSettings()
                {
                    //ArgumentCustomization = args => args
                    //    .Append("-xml")
                    //    .Append(artifactsDirectory.Path.CombineWithFilePath(project.GetFilenameWithoutExtension()).FullPath + ".xml"),
                    Configuration = configuration,
                    NoBuild = true
                });
        }
    });

Task("Package")
    .IsDependentOn("Test")
    .Does(() => 
    {
        string versionSuffix = null;
        if (!string.IsNullOrEmpty(preReleaseSuffix))
        {
            versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
        }
        var srcProjects = GetFiles("./src/**/*.csproj");<commit_msg>build(build cake): fixed buld cake package<commit_after>#addin "Cake.FileHelpers"
#addin "Cake.Coveralls"
#tool "nuget:?package=OpenCover"
#tool "nuget:?package=ReportGenerator"
#tool coveralls.io

var target = Argument<string>("target", "Default");

var githubApiKey = Argument<string>("githubApiKey", "");
var coverallsApiKey = Argument<string>("coverallsApiKey", "");
var nugetApiKey = Argument("nugetApiKey", "");

var configuration =
    HasArgument("Configuration") ? Argument<string>("Configuration") :
    EnvironmentVariable("Configuration") != null ? EnvironmentVariable("Configuration") :
    "Release";
var preReleaseSuffix =
    HasArgument("PreReleaseSuffix") ? Argument<string>("PreReleaseSuffix") :
    (AppVeyor.IsRunningOnAppVeyor && AppVeyor.Environment.Repository.Tag.IsTag) ? null :
    EnvironmentVariable("PreReleaseSuffix") != null ? EnvironmentVariable("PreReleaseSuffix") :
    "beta";
var buildNumber =
    HasArgument("BuildNumber") ? Argument<int>("BuildNumber") :
    AppVeyor.IsRunningOnAppVeyor ? AppVeyor.Environment.Build.Number :
    TravisCI.IsRunningOnTravisCI ? TravisCI.Environment.Build.BuildNumber :
    EnvironmentVariable("BuildNumber") != null ? int.Parse(EnvironmentVariable("BuildNumber")) :
    0;

 var restoreSources = new [] {
     "https://www.myget.org/F/xunit/api/v3/index.json",
     "https://dotnet.myget.org/F/dotnet-core/api/v3/index.json",
     "https://dotnet.myget.org/F/cli-deps/api/v3/index.json",
     "https://api.nuget.org/v3/index.json"
};

var githubOwner = "jrgcubano";
var githubRepo = "GildedRose";
var githubRawUri = "http://raw.githubusercontent.com";
var output = Directory("build");
var publish = Directory("publish");
var release = Directory("release");
var outputNuGet = output + Directory("nuget");
var coverageAssemblies = new[] { "GildedRose" };

Task("Clean")
	.Does(() => 
    {        
        CleanDirectories(output);
        CleanDirectories(publish);
        CleanDirectories(release);
        DeleteDirectories(GetDirectories("**/bin"), true);
        DeleteDirectories(GetDirectories("**/obj"), true);
	});


Task("Restore")
    .IsDependentOn("Clean")
    .Does(() => 
    {        
        var settings = new DotNetCoreRestoreSettings {
            Sources = restoreSources
        };
        var srcProjects = GetFiles("./src/**/*.csproj");
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in srcProjects)
        {
            DotNetCoreRestore(project.GetDirectory().FullPath, settings);
        }    
        foreach(var project in testProjects)
        {
            DotNetCoreRestore(project.GetDirectory().FullPath, settings);
        }    
    });

 Task("Build")
    .IsDependentOn("Restore")
    .Does(() =>
    { 
        var srcProjects = GetFiles("./src/**/*.csproj");
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in srcProjects)
        {
            DotNetCoreBuild(
                project.GetDirectory().FullPath,
                new DotNetCoreBuildSettings()
                {                
                    Configuration = configuration
                });
        }           
        foreach(var project in testProjects)
        {
            DotNetCoreBuild(
                project.GetDirectory().FullPath,
                new DotNetCoreBuildSettings()
                {                
                    Configuration = configuration
                });
        }           
    });

Task("Test")
    .IsDependentOn("Build")
    .Does(() =>
    {
        var testProjects = GetFiles("./test/**/*.csproj");
        foreach(var project in testProjects)
        {
            DotNetCoreTest(
                project.ToString(),
                new DotNetCoreTestSettings()
                {
                    //ArgumentCustomization = args => args
                    //    .Append("-xml")
                    //    .Append(artifactsDirectory.Path.CombineWithFilePath(project.GetFilenameWithoutExtension()).FullPath + ".xml"),
                    Configuration = configuration,
                    NoBuild = true
                });
        }
    });

Task("Package")
    .IsDependentOn("Test")
    .Does(() => 
    {
        string versionSuffix = null;
        if (!string.IsNullOrEmpty(preReleaseSuffix))
        {
            versionSuffix = preReleaseSuffix + "-" + buildNumber.ToString("D4");
        }
        var srcProjects = GetFiles("./src/GildedRose/*.csproj");
{'fraction_non_alphanumeric': 0.1395218318554271, 'fraction_numerical': 0.0013469525199236727, 'mean_word_length': 2.3521444695259595, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 27, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3332028', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2477, 'n_words': 384}