<commit_before>#tool nuget:?package=Fixie
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

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

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var isLocalBuild = !Jenkins.IsRunningOnJenkins;
var solution = "./src/Cake.ActiveDirectory.sln";
var artifactsDir = Directory("./artifacts");
var version = "0.1.0";
var semVersion = isLocalBuild ? version : string.Concat(version, ".", Jenkins.Environment.Build.BuildNumber.ToString("0000"));
var assemblyInfo = ParseAssemblyInfo("./src/Cake.ActiveDirectory/Properties/AssemblyInfo.cs");

EnsureDirectoryExists(artifactsDir);
//////////////////////////////////////////////////////////////////////
// Environment Variables
//////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
    .Does(() => {
        CleanDirectories("./src/**/bin/" + configuration);
        CleanDirectory(artifactsDir);
});

Task("Restore-NuGet-Packages")
    .IsDependentOn("Clean")
    .Does(() => {
        NuGetRestore(solution);
});

Task("Build")
    .IsDependentOn("Restore-NuGet-Packages")
    .Does(() => {
      // Use MSBuild
      MSBuild(solution, settings => settings.SetConfiguration(configuration));
});

Task("Unit-Tests")
    .IsDependentOn("Build")
    .Does(() => {
        Fixie("./src/**/bin/" + configuration + "/*.Tests.dll", new FixieSettings {
            NUnitXml = "TestResult.xml"
        });
});


Task("Package")
    .IsDependentOn("Unit-Tests")
    .Does(() => {
        var nugetPackSettings = new NuGetPackSettings {
            Id = assemblyInfo.Product,
            Version = semVersion,
            Title = assemblyInfo.Title,
            Authors = new []{assemblyInfo.Company},
            Owners = new []{assemblyInfo.Company},
            Description = assemblyInfo.Description,
            ProjectUrl = new Uri("https://github.com/RadioSystems/Cake.ActiveDirectory"),
            LicenseUrl = new Uri("https://github.com/RadioSystems/Cake.ActiveDirectory/blob/master/LICENSE"),
            Copyright = assemblyInfo.Copyright,
            Tags = new []{"Cake", "ActiveDirectory", "AD"},
            RequireLicenseAcceptance = false,
            Symbols =  false,
            NoPackageAnalysis = true,
            Files = new [] {
                new NuSpecContent {Source = "Cake.ActiveDirectory.dll", Target="lib/net45/Cake.ActiveDirectory.dll"},
                new NuSpecContent {Source = "Cake.ActiveDirectory.xml", Target="lib/net45/Cake.ActiveDirectory.xml"},
                new NuSpecContent {Source = "Landpy.ActiveDirectory.dll", Target="lib/net45/Landpy.ActiveDirectory.dll"}
            }
            BasePath = "./src/Cake.ActiveDirectory/bin/" + configuration,
            OutputDirectory = artifactsDir
        };      
      
        NuGetPack(nugetPackSettings);
});

Task("Deploy")
    .IsDependentOn("Package")
    .WithCriteria(()=> Jenkins.IsRunningOnJenkins)
    .Does(() => {
     
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////
<commit_msg>Updating build config<commit_after>#tool nuget:?package=Fixie
//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

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

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////
var solution = "./src/Cake.ActiveDirectory.sln";
var artifactsDir = Directory("./artifacts");
var assemblyInfo = ParseAssemblyInfo("./src/Cake.ActiveDirectory/Properties/AssemblyInfo.cs");
var version = assemblyInfo.AssemblyVersion; 

EnsureDirectoryExists(artifactsDir);
//////////////////////////////////////////////////////////////////////
// Environment Variables
//////////////////////////////////////////////////////////////////////


//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
    .Does(() => {
        CleanDirectories("./src/**/bin/" + configuration);
        CleanDirectory(artifactsDir);
});

Task("Restore-NuGet-Packages")
    .IsDependentOn("Clean")
    .Does(() => {
        NuGetRestore(solution);
});

Task("Build")
    .IsDependentOn("Restore-NuGet-Packages")
    .Does(() => {
      // Use MSBuild
      MSBuild(solution, settings => settings.SetConfiguration(configuration));
});

Task("Unit-Tests")
    .IsDependentOn("Build")
    .Does(() => {
        Fixie("./src/**/bin/" + configuration + "/*.Tests.dll", new FixieSettings {
            NUnitXml = "TestResult.xml"
        });
});


Task("Package")
    .IsDependentOn("Unit-Tests")
    .Does(() => {
        var nugetPackSettings = new NuGetPackSettings {
            Id = assemblyInfo.Product,
            Version = version,
            Title = assemblyInfo.Title,
            Authors = new []{assemblyInfo.Company},
            Owners = new []{assemblyInfo.Company},
            Description = assemblyInfo.Description,
            ProjectUrl = new Uri("https://github.com/RadioSystems/Cake.ActiveDirectory"),
            LicenseUrl = new Uri("https://github.com/RadioSystems/Cake.ActiveDirectory/blob/master/LICENSE"),
            Copyright = assemblyInfo.Copyright,
            Tags = new []{"Cake", "Active Directory", "AD"},
            RequireLicenseAcceptance = false,
            Symbols =  false,
            NoPackageAnalysis = true,
            Files = new [] {
                new NuSpecContent {Source = "Cake.ActiveDirectory.dll", Target="lib/net45/Cake.ActiveDirectory.dll"},
                new NuSpecContent {Source = "Cake.ActiveDirectory.xml", Target="lib/net45/Cake.ActiveDirectory.xml"},
                new NuSpecContent {Source = "Landpy.ActiveDirectory.dll", Target="lib/net45/Landpy.ActiveDirectory.dll"}
            },
            BasePath = "./src/Cake.ActiveDirectory/bin/" + configuration,
            OutputDirectory = artifactsDir
        };      
      
        NuGetPack(nugetPackSettings);
});

Task("Deploy")
    .IsDependentOn("Package")
    .WithCriteria(()=> AppVeyor.IsRunningOnAppVeyor)
    .Does(() => {
        var apiKey = EnvironmentVariable("NUGET_API_KEY");
        if(string.IsNullOrEmpty(apiKey)) {
            throw new InvalidOperationException("Could not resolve Nuget API key.");
        }

        // Push the package.
        var package = "./src/artifacts/Cake.ActiveDirectory." + version + ".nupkg";

        NuGetPush(package, new NuGetPushSettings { 
            Source = "https://api.nuget.org/v3/index.json",
            ApiKey = apiKey
        });
});

//////////////////////////////////////////////////////////////////////
// TASK TARGETS
//////////////////////////////////////////////////////////////////////

{'fraction_non_alphanumeric': 0.3092140921409214, 'fraction_numerical': 0.0027100271002710027, 'mean_word_length': 1.4416142904399603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '4568428', 'n_tokens_mistral': 1782, 'n_tokens_neox': 1714, 'n_words': 289}