<commit_before>var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

var artifactsDirectory = Directory("./Artifacts");

Task("Clean")
    .Does(() =>
    {
        CleanDirectory(artifactsDirectory);
    });

Task("Restore")
    .IsDependentOn("Clean")
    .Does(() =>
    {
        DotNetCoreRestore();
    });

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

Task("Test")
    .IsDependentOn("Build")
    .Does(() =>
    {
        var projects = GetFiles("./Tests/**/*.xproj");
        foreach(var project in projects)
        {
            if(IsRunningOnWindows())
            {
                DotNetCoreTest(
                    project.GetDirectory().FullPath,
                    new DotNetCoreTestSettings()
                    {
                        ArgumentCustomization = args => args
                            .Append("-xml")
                            .Append(artifactsDirectory.Path.CombineWithFilePath(project.GetFilenameWithoutExtension()).FullPath + ".xml"),
                        Configuration = configuration,
                        NoBuild = true
                    });
            }
            else
            {
                var name = project.GetFilenameWithoutExtension();
                var dirPath = project.GetDirectory().FullPath;

                foreach (var file in GetFiles(dirPath))
                {
                    Information(file).FullPath;
                }

                var xunit = GetFiles(dirPath + "/bin/" + configuration + "/**/dotnet-test-xunit.exe").First().FullPath;
                Information("dotnet-test-xunit.exe File Path: " + xunit);
                var testfile = GetFiles(dirPath + "/bin/" + configuration + "/**/" + name + ".dll").First().FullPath;
                Information("Assembly File Path: " + xunit);

                using (var process = StartAndReturnProcess("mono", new ProcessSettings{ Arguments = xunit + " " + testfile }))
                {
                    process.WaitForExit();
                    if (process.GetExitCode() != 0)
                    {
                        throw new Exception("Mono tests failed!");
                    }
                }
            }
        }
    });

Task("Pack")
    .IsDependentOn("Test")
    .Does(() =>
    {
        int buildNumber;
        if (AppVeyor.IsRunningOnAppVeyor)<commit_msg>try fix cake script<commit_after>var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

var artifactsDirectory = Directory("./Artifacts");

Task("Clean")
    .Does(() =>
    {
        CleanDirectory(artifactsDirectory);
    });

Task("Restore")
    .IsDependentOn("Clean")
    .Does(() =>
    {
        DotNetCoreRestore();
    });

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

Task("Test")
    .IsDependentOn("Build")
    .Does(() =>
    {
        var projects = GetFiles("./Tests/**/*.xproj");
        foreach(var project in projects)
        {
            if(IsRunningOnWindows())
            {
                DotNetCoreTest(
                    project.GetDirectory().FullPath,
                    new DotNetCoreTestSettings()
                    {
                        ArgumentCustomization = args => args
                            .Append("-xml")
                            .Append(artifactsDirectory.Path.CombineWithFilePath(project.GetFilenameWithoutExtension()).FullPath + ".xml"),
                        Configuration = configuration,
                        NoBuild = true
                    });
            }
            else
            {
                var name = project.GetFilenameWithoutExtension();
                var dirPath = project.GetDirectory().FullPath;

                foreach (var file in GetFiles(dirPath))
                {
                    Information(file.FullPath);
                }

                var xunit = GetFiles(dirPath + "/bin/" + configuration + "/**/dotnet-test-xunit.exe").First().FullPath;
                Information("dotnet-test-xunit.exe File Path: " + xunit);
                var testfile = GetFiles(dirPath + "/bin/" + configuration + "/**/" + name + ".dll").First().FullPath;
                Information("Assembly File Path: " + xunit);

                using (var process = StartAndReturnProcess("mono", new ProcessSettings{ Arguments = xunit + " " + testfile }))
                {
                    process.WaitForExit();
                    if (process.GetExitCode() != 0)
                    {
                        throw new Exception("Mono tests failed!");
                    }
                }
            }
        }
    });

Task("Pack")
    .IsDependentOn("Test")
    .Does(() =>
    {
        int buildNumber;
        if (AppVeyor.IsRunningOnAppVeyor)
{'fraction_non_alphanumeric': 0.12655449890270665, 'fraction_numerical': 0.000365764447695684, 'mean_word_length': 1.4177718832891246, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1583946', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1310, 'n_words': 238}