<commit_before>$TestsRegex = '\.Tests$'

function AllProjects() {
    Get-ChildItem */project.json
}

function PackageProjects() {
    AllProjects | Where {$_.Directory.Name -notmatch $TestsRegex}
}

function TestProjects() {
    AllProjects | Where {$_.Directory.Name -match $TestsRegex}
}

function GlobalSdk($path) {
    (ConvertFrom-Json ((Get-Content $path) -join "`n")).sdk
}

function CleanCmd() {
    AllProjects | %{$_.Directory} | %{
        if (Test-Path $_/bin) {Remove-Item -Recurse $_/bin}
        if (Test-Path $_/obj) {Remove-Item -Recurse $_/obj}
    }
    if (Test-Path artifacts) {Remove-Item -Recurse artifacts}
}

function RestoreCmd() {
    dnu restore
}

function InstallCmd() {
    nuget sources add -Name Sharper.C -Source $env:SHARPER_C_FEED
    $sdk = GlobalSdk 'global.json'
    dnvm install $sdk.version -r $sdk.runtime -arch $sdk.architecture
    dnu restore
}

function BuildCmd() {
    if ($env:APPVEYOR_BUILD_NUMBER) {
      $env:DNX_BUILD_VERSION =
          'build-{0}' -f (([string]$env:APPVEYOR_BUILD_NUMBER).PadLeft(5, '0'))
    }
    else {
      $env:DNX_BUILD_VERSION = 'z'
    }
    dnu pack --configuration Release (PackageProjects)
}

function TestCmd() {
    $codes = (TestProjects) | %{dnx -p $_ test | Write-Host; $LASTEXITCODE}
    $code = ($codes | Measure-Object -Sum).Sum
    exit $code
}<commit_msg>Update for VSTS<commit_after>$TestsRegex = '\.Tests$'

function AllProjects() {
    Get-ChildItem */project.json
}

function PackageProjects() {
    AllProjects | Where {$_.Directory.Name -notmatch $TestsRegex}
}

function TestProjects() {
    AllProjects | Where {$_.Directory.Name -match $TestsRegex}
}

function GlobalSdk($path) {
    (ConvertFrom-Json ((Get-Content $path) -join "`n")).sdk
}

function CleanCmd() {
    AllProjects | %{$_.Directory} | %{
        if (Test-Path $_/bin) {Remove-Item -Recurse $_/bin}
        if (Test-Path $_/obj) {Remove-Item -Recurse $_/obj}
    }
    if (Test-Path artifacts) {Remove-Item -Recurse artifacts}
}

function RestoreCmd() {
    dnu restore
}

function InstallCmd() {
    $sdk = GlobalSdk 'global.json'
    dnvm install $sdk.version -r $sdk.runtime -arch $sdk.architecture
    dnu restore
}

function BuildCmd() {
    if ($env:BUILD_BUILDNUMBER) {
      $env:DNX_BUILD_VERSION = $env:BUILD_BUILDNUMBER
    }
    else {
      $env:DNX_BUILD_VERSION = 'z'
    }
    dnu pack --configuration Release (PackageProjects)
}

function TestCmd() {
    $codes = (TestProjects) | %{dnx -p $_ test | Write-Host; $LASTEXITCODE}
    $code = ($codes | Measure-Object -Sum).Sum
    exit $code
}
{'fraction_non_alphanumeric': 0.1478463329452852, 'fraction_numerical': 0.0011641443538998836, 'mean_word_length': 3.233169129720854, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2568833', 'n_tokens_mistral': 908, 'n_tokens_neox': 884, 'n_words': 204}