<commit_before>using System;
using System.Linq;
using Cake.Common;
using Cake.Common.Diagnostics;
using Cake.Common.Build;
using Cake.Common.Tools.DotNetCore.MSBuild;
using Cake.Frosting;
using Cake.Core.Diagnostics;
using Cake.Core.IO;

public class Lifetime : FrostingLifetime<Context>
{
    public override void Setup(Context context)
    {
        // Arguments
        context.Target = context.Argument<string>("target", "Default");
        context.BuildConfiguration = context.Argument<string>("configuration", "Release");
        context.ForcePublish = context.Argument<bool>("forcepublish", false);
        context.AzureArtifactsSourceUrl = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_URL", "azureartifactssourceurl");
        context.AzureArtifactsPersonalAccessToken = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN", "<PASSWORD>");
        context.AzureArtifactsSourceName = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_NAME", "azureartifactssourcename");
        context.AzureArtifactsSourceUserName = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_USER_NAME", "azureartifactssourceusername");
        context.GitHubToken = GetEnvironmentValueOrArgument(context, "FROSTING_GITHUB_TOKEN", "githubtoken");

        // Directories
        context.Artifacts = new DirectoryPath("./artifacts");

        // Build system information.
        var buildSystem = context.BuildSystem();
        context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.IsLocalBuild = buildSystem.IsLocalBuild;
        context.IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
        context.PrimaryBranchName = "master";
        context.RepositoryOwner = "cake-build";
        context.RepositoryName = "frosting";
        context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals(string.Concat(context.RepositoryOwner, "/", context.RepositoryName), buildSystem.AppVeyor.Environment.Repository.Name);
        context.IsTagged = IsBuildTagged(buildSystem);
        context.IsPrimaryBranch = StringComparer.OrdinalIgnoreCase.Equals(context.PrimaryBranchName, buildSystem.AppVeyor.Environment.Repository.Branch);
        context.BuildSystem = buildSystem;

        // Install tools
        context.Information("Installing tools...");
        context.InstallNuGetExe("5.6.0");

        // Install Global .Net Tools
        context.Information("Installing .Net Global Tools...");
        context.DotNetCoreToolInstall("GitReleaseManager.Tool", "0.11.0", "dotnet-gitreleasemanager");
        context.DotNetCoreToolInstall("SignClient", "1.2.109", "SignClient");
        context.DotNetCoreToolInstall("GitVersion.Tool", "5.1.2", "dotnet-gitversion");

        // Calculate semantic version.
        context.Version = BuildVersion.Calculate(context);
        context.Version.Version = context.Argument<string>("version", context.Version.Version);
        context.Version.SemVersion = context.Argument<string>("suffix", context.Version.SemVersion);

        // MSBuild Settings
        context.MSBuildSettings =  new DotNetCoreMSBuildSettings()
                            .WithProperty("Version", context.Version.SemVersion)
                            .WithProperty("AssemblyVersion", context.Version.Version)
                            .WithProperty("FileVersion", context.Version.Version);

        if(!context.IsRunningOnWindows())
        {
        var frameworkPathOverride = context.Environment.Runtime.IsCoreClr
                                        ?   new []{
                                                new DirectoryPath("/Library/Frameworks/Mono.framework/Versions/Current/lib/mono"),
                                                new DirectoryPath("/usr/lib/mono"),
                                                new DirectoryPath("/usr/local/lib/mono")
                                            }
                                            .Select(directory =>directory.Combine("4.5"))<commit_msg>(GH-72) Ensure deterministic dll genration<commit_after>using System;
using System.Linq;
using Cake.Common;
using Cake.Common.Diagnostics;
using Cake.Common.Build;
using Cake.Common.Tools.DotNetCore.MSBuild;
using Cake.Frosting;
using Cake.Core.Diagnostics;
using Cake.Core.IO;

public class Lifetime : FrostingLifetime<Context>
{
    public override void Setup(Context context)
    {
        // Arguments
        context.Target = context.Argument<string>("target", "Default");
        context.BuildConfiguration = context.Argument<string>("configuration", "Release");
        context.ForcePublish = context.Argument<bool>("forcepublish", false);
        context.AzureArtifactsSourceUrl = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_URL", "azureartifactssourceurl");
        context.AzureArtifactsPersonalAccessToken = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_PERSONAL_ACCESS_TOKEN", "<PASSWORD>");
        context.AzureArtifactsSourceName = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_NAME", "azureartifactssourcename");
        context.AzureArtifactsSourceUserName = GetEnvironmentValueOrArgument(context, "FROSTING_AZURE_ARTIFACTS_SOURCE_USER_NAME", "azureartifactssourceusername");
        context.GitHubToken = GetEnvironmentValueOrArgument(context, "FROSTING_GITHUB_TOKEN", "githubtoken");

        // Directories
        context.Artifacts = new DirectoryPath("./artifacts");

        // Build system information.
        var buildSystem = context.BuildSystem();
        context.AppVeyor = buildSystem.AppVeyor.IsRunningOnAppVeyor;
        context.IsLocalBuild = buildSystem.IsLocalBuild;
        context.IsPullRequest = buildSystem.AppVeyor.Environment.PullRequest.IsPullRequest;
        context.PrimaryBranchName = "master";
        context.RepositoryOwner = "cake-build";
        context.RepositoryName = "frosting";
        context.IsOriginalRepo = StringComparer.OrdinalIgnoreCase.Equals(string.Concat(context.RepositoryOwner, "/", context.RepositoryName), buildSystem.AppVeyor.Environment.Repository.Name);
        context.IsTagged = IsBuildTagged(buildSystem);
        context.IsPrimaryBranch = StringComparer.OrdinalIgnoreCase.Equals(context.PrimaryBranchName, buildSystem.AppVeyor.Environment.Repository.Branch);
        context.BuildSystem = buildSystem;

        // Install tools
        context.Information("Installing tools...");
        context.InstallNuGetExe("5.6.0");

        // Install Global .Net Tools
        context.Information("Installing .Net Global Tools...");
        context.DotNetCoreToolInstall("GitReleaseManager.Tool", "0.11.0", "dotnet-gitreleasemanager");
        context.DotNetCoreToolInstall("SignClient", "1.2.109", "SignClient");
        context.DotNetCoreToolInstall("GitVersion.Tool", "5.1.2", "dotnet-gitversion");

        // Calculate semantic version.
        context.Version = BuildVersion.Calculate(context);
        context.Version.Version = context.Argument<string>("version", context.Version.Version);
        context.Version.SemVersion = context.Argument<string>("suffix", context.Version.SemVersion);

        // MSBuild Settings
        context.MSBuildSettings =  new DotNetCoreMSBuildSettings()
                            .WithProperty("Version", context.Version.SemVersion)
                            .WithProperty("AssemblyVersion", context.Version.Version)
                            .WithProperty("FileVersion", context.Version.Version);

        if (context.AppVeyor)
        {
            context.MSBuildSettings.WithProperty("ContinuousIntegrationBuild", "true");
        }

        if(!context.IsRunningOnWindows())
        {
        var frameworkPathOverride = context.Environment.Runtime.IsCoreClr
                                        ?   new []{
                                                new DirectoryPath("/Library/Frameworks/Mono.framework/Versions/Current/lib/mono"),
                                                new DirectoryPath("/usr/lib/mono"),
                                                new DirectoryPath("/usr/local/lib/mono")
                                            }
                                            .Select(directory =>directory.Combine("4.5"))
{'fraction_non_alphanumeric': 0.10464277122925186, 'fraction_numerical': 0.004330045706038008, 'mean_word_length': 2.929584120982987, 'pattern_counts': {'":': 0, '<': 17, '<?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': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2593343', 'n_tokens_mistral': 2174, 'n_tokens_neox': 2089, 'n_words': 301}