<commit_before>using System;
using System.Linq;
using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.NUnit;
using Nuke.Common.Tools.Xunit;
using Nuke.Common.Utilities.Collections;
using static Nuke.Common.EnvironmentInfo;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.NUnit.NUnitTasks;
using static Nuke.Common.Tools.Xunit.XunitTasks;

[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
[DotNetVerbosityMapping]
class Build : NukeBuild
{
    /// Support plugins are available for:
    ///   - JetBrains ReSharper        https://nuke.build/resharper
    ///   - JetBrains Rider            https://nuke.build/rider
    ///   - Microsoft VisualStudio     https://nuke.build/visualstudio
    ///   - Microsoft VSCode           https://nuke.build/vscode
    public static int Main() => Execute<Build>(
        x => x.Test,
        x => x.Pack);

    [Solution] readonly Solution Solution;
    [GitVersion] readonly GitVersion GitVersion;

    AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";
    AbsolutePath TestsDirectory => RootDirectory / "Tests";
    AbsolutePath TestFrameworkDirectory => TestsDirectory / "TestFrameworks";
    Target Clean => _ => _
        .Before(Restore)
        .Executes(() =>
        {
            EnsureCleanDirectory(ArtifactsDirectory);
        });

    Target Restore => _ => _
        .Executes(() =>
        {
            DotNetRestore(s => s
                .SetProjectFile(Solution)
                .EnableNoCache()
                .SetConfigFile(RootDirectory / "nuget.config"));
        });

    Target Compile => _ => _
        .DependsOn(Restore)
        .Executes(() =>
        {
            DotNetBuild(s => s
                .SetProjectFile(Solution)
                .SetConfiguration(Configuration.Debug)
                .SetAssemblyVersion(GitVersion.AssemblySemVer)
                .SetFileVersion(GitVersion.AssemblySemFileVer)
                .SetInformationalVersion(GitVersion.InformationalVersion));
        });

    const string XunitFramework = "net47";
    [PackageExecutable("nspec", "NSpecRunner.exe", Version = "3.1.0")] Tool NSpec3;

    Target Test => _ => _
        .DependsOn(Compile)
        .Executes(() =>
        {
            Xunit2(s => s
                .SetFramework(XunitFramework)
                .AddTargetAssemblies(GlobFiles(
                    TestsDirectory,
                    $"Net4*.Specs/bin/Debug/**/*.Specs.dll").NotEmpty()));

            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore20.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore21.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore30.Specs"))));

            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("MSpec.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("MSTestV2.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NUnit3.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("XUnit2.Specs"))));

            NSpec3(TestFrameworkDirectory / "NSpec3.Net47.Specs" / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll");

            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("Approval.Tests"))));
        });

    Target Pack => _ => _
        .DependsOn(Compile)
        .Executes(() =>
        {
            DotNetPack(s => s
                .SetProject(Solution.GetProject("FluentAssertions"))
                .SetOutputDirectory(ArtifactsDirectory)
                .SetConfiguration(Configuration.Release)
                .SetVersion(GitVersion.NuGetVersionV2));
        });
}<commit_msg>Split the testing targets to simplify local building (#1231)<commit_after>using Nuke.Common;
using Nuke.Common.Execution;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Nuke.Common.Tools.GitVersion;
using Nuke.Common.Tools.Xunit;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.Xunit.XunitTasks;

[CheckBuildProjectConfigurations]
[UnsetVisualStudioEnvironmentVariables]
[DotNetVerbosityMapping]
class Build : NukeBuild
{
    /// Support plugins are available for:
    ///   - JetBrains ReSharper        https://nuke.build/resharper
    ///   - JetBrains Rider            https://nuke.build/rider
    ///   - Microsoft VisualStudio     https://nuke.build/visualstudio
    ///   - Microsoft VSCode           https://nuke.build/vscode
    public static int Main() => Execute<Build>(
        x => x.UnitTests,
        x => x.Pack);

    [Solution] readonly Solution Solution;
    [GitVersion] readonly GitVersion GitVersion;
    [PackageExecutable("nspec", "NSpecRunner.exe", Version = "3.1.0")] Tool NSpec3;

    AbsolutePath ArtifactsDirectory => RootDirectory / "Artifacts";
    AbsolutePath TestsDirectory => RootDirectory / "Tests";
    AbsolutePath TestFrameworkDirectory => TestsDirectory / "TestFrameworks";

    Target Clean => _ => _
        .Before(Restore)
        .Executes(() =>
        {
            EnsureCleanDirectory(ArtifactsDirectory);
        });

    Target Restore => _ => _
        .Executes(() =>
        {
            DotNetRestore(s => s
                .SetProjectFile(Solution)
                .EnableNoCache()
                .SetConfigFile(RootDirectory / "nuget.config"));
        });

    Target Compile => _ => _
        .DependsOn(Restore)
        .Executes(() =>
        {
            DotNetBuild(s => s
                .SetProjectFile(Solution)
                .SetConfiguration(Configuration.Debug)
                .SetAssemblyVersion(GitVersion.AssemblySemVer)
                .SetFileVersion(GitVersion.AssemblySemFileVer)
                .SetInformationalVersion(GitVersion.InformationalVersion));
        });


    Target ApiChecks => _ => _
        .DependsOn(Compile)
        .Executes(() =>
        {
            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("Approval.Tests"))));
        });

    Target UnitTests => _ => _
        .DependsOn(Compile)
        .Executes(() =>
        {
            Xunit2(s => s
                .SetFramework("net47")
                .AddTargetAssemblies(GlobFiles(
                    TestsDirectory,
                    $"Net4*.Specs/bin/Debug/**/*.Specs.dll").NotEmpty()));

            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore20.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore21.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NetCore30.Specs"))));


        });

    Target TestFrameworks => _ => _
        .DependsOn(Compile)
        .Executes(() =>
        {
            DotNetTest(s => s
                .SetConfiguration(Configuration.Debug)
                .CombineWith(
                    cc => cc.SetProjectFile(Solution.GetProject("MSpec.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("MSTestV2.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("NUnit3.Specs")),
                    cc => cc.SetProjectFile(Solution.GetProject("XUnit2.Specs"))));

            NSpec3(TestFrameworkDirectory / "NSpec3.Net47.Specs" / "bin" / "Debug" / "net47" / "NSpec3.Specs.dll");
        });

    Target Pack => _ => _
        .DependsOn(ApiChecks)
        .DependsOn(TestFrameworks)
        .DependsOn(UnitTests)
        .Executes(() =>
        {
            DotNetPack(s => s
                .SetProject(Solution.GetProject("FluentAssertions"))
                .SetOutputDirectory(ArtifactsDirectory)
                .SetConfiguration(Configuration.Release)
                .SetVersion(GitVersion.NuGetVersionV2));
        });
}
{'fraction_non_alphanumeric': 0.12024582560296845, 'fraction_numerical': 0.006261595547309833, 'mean_word_length': 2.089183381088825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 83, 'https://': 8, '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': '1820249', 'n_tokens_mistral': 2540, 'n_tokens_neox': 2368, 'n_words': 364}