<commit_before>﻿$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$createReleasePackageExe = Join-Path $toolsDir "CreateReleasePackage.exe"

$wixDir = Join-Path $toolsDir "wix"
$support = Join-Path $toolsDir "support.ps1"
$echoArgs = Join-Path $toolsDir "EchoArgs.exe"

$candleExe = Join-Path $wixDir "candle.exe"
$lightExe = Join-Path $wixDir "light.exe"

function Generate-TemplateFromPackage {
    param(
        [Parameter(Mandatory = $true)]
        [string]$packageFile,
        [Parameter(Mandatory = $true)]
        [string]$templateFile
    )

    $resultFile = & $createReleasePackageExe --preprocess-template $templateFile $pkg.FullName
    $resultFile
}

function Create-ReleaseForProject {
    param(
        [Parameter(Mandatory = $true)]
        [string]$solutionDir,
        [Parameter(Mandatory = $true)]
        [string]$buildDirectory
    )

    $releaseDir = Join-Path $solutionDir "Releases"
    if (!(Test-Path $releaseDir)) { `
        New-Item -ItemType Directory -Path $releaseDir | Out-Null
    }

    Write-Message "Checking $buildDirectory for packages`n"

    $nugetPackages = ls "$buildDirectory\*.nupkg" | ?{ $_.Name.EndsWith(".symbols.nupkg") -eq $false }

    if ($nugetPackages.length -eq 0) {
        Write-Error "No .nupkg files were found in the build directory"
        Write-Error "Have you built the solution lately?"

        return
    } else {
        foreach($pkg in $nugetPackages) {
            $pkgFullName = $pkg.FullName
            Write-Message "Found package $pkgFullName"
        }
    }

    Write-Host ""
    Write-Message "Publishing artifacts to $releaseDir"

    $releasePackages = @()<commit_msg>sort the packages by last write date - 1.9 < 1.10 is what we need<commit_after>﻿$toolsDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$createReleasePackageExe = Join-Path $toolsDir "CreateReleasePackage.exe"

$wixDir = Join-Path $toolsDir "wix"
$support = Join-Path $toolsDir "support.ps1"
$echoArgs = Join-Path $toolsDir "EchoArgs.exe"

$candleExe = Join-Path $wixDir "candle.exe"
$lightExe = Join-Path $wixDir "light.exe"

function Generate-TemplateFromPackage {
    param(
        [Parameter(Mandatory = $true)]
        [string]$packageFile,
        [Parameter(Mandatory = $true)]
        [string]$templateFile
    )

    $resultFile = & $createReleasePackageExe --preprocess-template $templateFile $pkg.FullName
    $resultFile
}

function Create-ReleaseForProject {
    param(
        [Parameter(Mandatory = $true)]
        [string]$solutionDir,
        [Parameter(Mandatory = $true)]
        [string]$buildDirectory
    )

    $releaseDir = Join-Path $solutionDir "Releases"
    if (!(Test-Path $releaseDir)) { `
        New-Item -ItemType Directory -Path $releaseDir | Out-Null
    }

    Write-Message "Checking $buildDirectory for packages`n"

    $nugetPackages = ls "$buildDirectory\*.nupkg" `
        | ?{ $_.Name.EndsWith(".symbols.nupkg") -eq $false } `
        | sort @{expression={$_.LastWriteTime};Descending=$false}

    if ($nugetPackages.length -eq 0) {
        Write-Error "No .nupkg files were found in the build directory"
        Write-Error "Have you built the solution lately?"

        return
    } else {
        foreach($pkg in $nugetPackages) {
            $pkgFullName = $pkg.FullName
            Write-Message "Found package $pkgFullName"
        }
    }

    Write-Host ""
    Write-Message "Publishing artifacts to $releaseDir"

    $releasePackages = @()
{'fraction_non_alphanumeric': 0.12254335260115606, 'fraction_numerical': 0.002601156069364162, 'mean_word_length': 3.01508120649652, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '3510916', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1077, 'n_words': 244}