<commit_before>using System.Xml.Linq;

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

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

// Variable definitions

var projectName = "NString";
var libraryProject = $"{projectName}/{projectName}.csproj";
var testProject = $"{projectName}.Tests/{projectName}.Tests.csproj";
var outDir = $"{projectName}/bin/{configuration}";

///////////////////////////////////////////////////////////////////////////////
// TASK DEFINITIONS
///////////////////////////////////////////////////////////////////////////////

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

Task("Restore").Does(() => DotNetCoreRestore());

Task("JustBuild")
    .Does(() =>
    {
        DotNetCoreBuild(".", new DotNetCoreBuildSettings { Configuration = configuration });
    });

Task("JustTest")
    .Does(() => DotNetCoreTest(testProject));
    
Task("JustPack")
    .Does(() =>
    {
        DotNetCorePack(libraryProject, new DotNetCorePackSettings
        {
            Configuration = configuration
        });
    });

Task("JustPush")
    .Does(() =>
    {
        var doc = XDocument.Load(libraryProject);
        string version = doc.Root.Elements("PropertyGroup").Elements("Version").First().Value;
        string package = $"{projectName}/bin/{configuration}/{projectName}.{version}.nupkg";
        NuGetPush(package, new NuGetPushSettings());
    });

// Higher level tasks

Task("Build")
    .IsDependentOn("Clean")
    .IsDependentOn("Restore")
    .IsDependentOn("JustBuild");

Task("Test")
    .IsDependentOn("Build")
    .IsDependentOn("JustTest");

Task("Pack")
    .IsDependentOn("Build")
    .IsDependentOn("JustPack");

Task("Push")
    .IsDependentOn("Pack")
    .IsDependentOn("JustPush");

///////////////////////////////////////////////////////////////////////////////
// TARGETS
///////////////////////////////////////////////////////////////////////////////

Task("Default")
    .IsDependentOn("Test")
    .IsDependentOn("Pack");

///////////////////////////////////////////////////////////////////////////////
// EXECUTION
///////////////////////////////////////////////////////////////////////////////

RunTarget(target);
<commit_msg>Fix tests to run in Release configuration<commit_after>using System.Xml.Linq;

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

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

// Variable definitions

var projectName = "NString";
var libraryProject = $"{projectName}/{projectName}.csproj";
var testProject = $"{projectName}.Tests/{projectName}.Tests.csproj";
var outDir = $"{projectName}/bin/{configuration}";

///////////////////////////////////////////////////////////////////////////////
// TASK DEFINITIONS
///////////////////////////////////////////////////////////////////////////////

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

Task("Restore").Does(() => DotNetCoreRestore());

Task("JustBuild")
    .Does(() =>
    {
        DotNetCoreBuild(".", new DotNetCoreBuildSettings { Configuration = configuration });
    });

Task("JustTest")
    .Does(() =>
    {
        DotNetCoreTest(testProject, new DotNetCoreTestSettings { Configuration = configuration });
    });
    
Task("JustPack")
    .Does(() =>
    {
        DotNetCorePack(libraryProject, new DotNetCorePackSettings { Configuration = configuration });
    });

Task("JustPush")
    .Does(() =>
    {
        var doc = XDocument.Load(libraryProject);
        string version = doc.Root.Elements("PropertyGroup").Elements("Version").First().Value;
        string package = $"{projectName}/bin/{configuration}/{projectName}.{version}.nupkg";
        NuGetPush(package, new NuGetPushSettings());
    });

// Higher level tasks

Task("Build")
    .IsDependentOn("Clean")
    .IsDependentOn("Restore")
    .IsDependentOn("JustBuild");

Task("Test")
    .IsDependentOn("Build")
    .IsDependentOn("JustTest");

Task("Pack")
    .IsDependentOn("Build")
    .IsDependentOn("JustPack");

Task("Push")
    .IsDependentOn("Pack")
    .IsDependentOn("JustPush");

///////////////////////////////////////////////////////////////////////////////
// TARGETS
///////////////////////////////////////////////////////////////////////////////

Task("Default")
    .IsDependentOn("Test")
    .IsDependentOn("Pack");

///////////////////////////////////////////////////////////////////////////////
// EXECUTION
///////////////////////////////////////////////////////////////////////////////

RunTarget(target);

{'fraction_non_alphanumeric': 0.38792221084953943, 'fraction_numerical': 0.0, 'mean_word_length': 1.4021632251720748, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1135555', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1137, 'n_words': 180}