<commit_before>@if "%_echo%"=="" echo off

:ARGUMENTS_VALIDATION

if /I "%1" == "--help"   (goto :USAGE)
if /I "%1" == "/help"   (goto :USAGE)
if /I "%1" == "/h"      (goto :USAGE)
if /I "%1" == "/?"      (goto :USAGE)
goto :ARGUMENTS_OK

:USAGE

echo Build and run a subset of test suites
echo.
echo Usage:
echo.
echo build.cmd ^<all^|net40^|coreclr^|pcls^|vs^>
echo           ^<proto^|protofx^>
echo           ^<ci^|ci_part1^|ci_part2^|microbuild^>
echo           ^<debug^|release^>
echo           ^<diag^|publicsign^>
echo           ^<test^|test-smoke^|test-net40-coreunit-suite^|test-coreclr-coreunit-suite^|test-compiler-unit-suite^|test-pcl-coreunit-suite^|test-net40-fsharp-suite^|test-net40-fsharpqa-suite^>
echo.
echo No arguments default to 'default', meaning this (no testing)
echo.
echo     build.cmd net40 
echo.
echo.Other examples:
echo.
echo.    build net40            (build compiler for .NET Framework)
echo.    build coreclr          (build compiler for .NET Core)
echo.    build vs               (build Visual Studio IDE Tools)
echo.    build all              (build everything)
echo.    build test             (build and test default targets)
echo.    build net40 test       (build and test net40)
echo.    build coreclr test     (build and test net40)
echo.    build vs test          (build and test net40)
echo.    build all test         (build and test net40)
echo.
echo The example below run pcls, vs and qa:
echo.
echo     build.cmd pcls vs debug
exit /b 1

:ARGUMENTS_OK

set BUILD_PROTO_WITH_CORECLR_LKG=0

set BUILD_PROTO=0
set BUILD_NET40=0
set BUILD_CORECLR=0
set BUILD_PORTABLE=0
set BUILD_VS=0
set BUILD_CONFIG=release
set BUILD_CONFIG_LOWERCASE=release
set BUILD_DIAG=
set BUILD_PUBLICSIGN=0

set TEST_NET40_COMPILERUNIT_SUITE=0
set TEST_NET40_COREUNIT_SUITE=0
set TEST_NET40_FSHARP_SUITE=0
set TEST_NET40_FSHARPQA_SUITE=0
set TEST_CORECLR_COREUNIT_SUITE=0
set TEST_CORECLR_FSHARP_SUITE=0
set TEST_PORTABLE_COREUNIT_SUITE=0
set TEST_VS_IDEUNIT_SUITE=0
set TEST_TAGS=
set SKIP_EXPENSIVE_TESTS=1

REM ------------------ Parse all arguments -----------------------

setlocal enableDelayedExpansion

set _autoselect=1
set _autoselect_tests=0
set /a counter=0
for /l %%x in (1 1 9) do (
    set /a counter=!counter!+1
    call :SET_CONFIG %%!counter! "!counter!"
)
for %%i in (%BUILD_FSC_DEFAULT%) do ( call :SET_CONFIG %%i )

REM apply defaults

if /i '%_autoselect%' == '1' (
    set BUILD_NET40=1
)

if /i '%_autoselect_tests%' == '1' (
    if /i '%BUILD_NET40%' == '1' (
        set TEST_NET40_COMPILERUNIT_SUITE=1
        set TEST_NET40_COREUNIT_SUITE=1
        set TEST_NET40_FSHARP_SUITE=1
        set TEST_NET40_FSHARPQA_SUITE=1
    )

    if /i '%BUILD_CORECLR%' == '1' (
        set TEST_CORECLR_COREUNIT_SUITE=1
    )

    if /i '%BUILD_PORTABLE%' == '1' (
        set TEST_PORTABLE_COREUNIT_SUITE=1
    )

    if /i '%BUILD_VS%' == '1' (
        set TEST_VS_IDEUNIT_SUITE=1
    )
)

setlocal disableDelayedExpansion
echo.

rem disable setup build by setting FSC_BUILD_SETUP=0
if /i '%FSC_BUILD_SETUP%' == '' (set FSC_BUILD_SETUP=1) 
goto :MAIN

REM ------------------ Procedure to parse one argument -----------------------

:SET_CONFIG
set ARG=%~1
if "%ARG%" == "1" if "%2" == "" (set ARG=default)<commit_msg>Ensure setup build works on microbuild<commit_after>@if "%_echo%"=="" echo off

:ARGUMENTS_VALIDATION

if /I "%1" == "--help"   (goto :USAGE)
if /I "%1" == "/help"   (goto :USAGE)
if /I "%1" == "/h"      (goto :USAGE)
if /I "%1" == "/?"      (goto :USAGE)
goto :ARGUMENTS_OK

:USAGE

echo Build and run a subset of test suites
echo.
echo Usage:
echo.
echo build.cmd ^<all^|net40^|coreclr^|pcls^|vs^>
echo           ^<proto^|protofx^>
echo           ^<ci^|ci_part1^|ci_part2^|microbuild^>
echo           ^<debug^|release^>
echo           ^<diag^|publicsign^>
echo           ^<test^|test-smoke^|test-net40-coreunit-suite^|test-coreclr-coreunit-suite^|test-compiler-unit-suite^|test-pcl-coreunit-suite^|test-net40-fsharp-suite^|test-net40-fsharpqa-suite^>
echo.
echo No arguments default to 'default', meaning this (no testing)
echo.
echo     build.cmd net40 
echo.
echo.Other examples:
echo.
echo.    build net40            (build compiler for .NET Framework)
echo.    build coreclr          (build compiler for .NET Core)
echo.    build vs               (build Visual Studio IDE Tools)
echo.    build all              (build everything)
echo.    build test             (build and test default targets)
echo.    build net40 test       (build and test net40)
echo.    build coreclr test     (build and test net40)
echo.    build vs test          (build and test net40)
echo.    build all test         (build and test net40)
echo.
echo The example below run pcls, vs and qa:
echo.
echo     build.cmd pcls vs debug
exit /b 1

:ARGUMENTS_OK

rem disable setup build by setting FSC_BUILD_SETUP=0
if /i '%FSC_BUILD_SETUP%' == '' (set FSC_BUILD_SETUP=1) 

set BUILD_PROTO_WITH_CORECLR_LKG=0

set BUILD_PROTO=0
set BUILD_NET40=0
set BUILD_CORECLR=0
set BUILD_PORTABLE=0
set BUILD_VS=0
set BUILD_CONFIG=release
set BUILD_CONFIG_LOWERCASE=release
set BUILD_DIAG=
set BUILD_PUBLICSIGN=0

set TEST_NET40_COMPILERUNIT_SUITE=0
set TEST_NET40_COREUNIT_SUITE=0
set TEST_NET40_FSHARP_SUITE=0
set TEST_NET40_FSHARPQA_SUITE=0
set TEST_CORECLR_COREUNIT_SUITE=0
set TEST_CORECLR_FSHARP_SUITE=0
set TEST_PORTABLE_COREUNIT_SUITE=0
set TEST_VS_IDEUNIT_SUITE=0
set TEST_TAGS=
set SKIP_EXPENSIVE_TESTS=1

REM ------------------ Parse all arguments -----------------------

setlocal enableDelayedExpansion

set _autoselect=1
set _autoselect_tests=0
set /a counter=0
for /l %%x in (1 1 9) do (
    set /a counter=!counter!+1
    call :SET_CONFIG %%!counter! "!counter!"
)
for %%i in (%BUILD_FSC_DEFAULT%) do ( call :SET_CONFIG %%i )

REM apply defaults

if /i '%_autoselect%' == '1' (
    set BUILD_NET40=1
)

if /i '%_autoselect_tests%' == '1' (
    if /i '%BUILD_NET40%' == '1' (
        set TEST_NET40_COMPILERUNIT_SUITE=1
        set TEST_NET40_COREUNIT_SUITE=1
        set TEST_NET40_FSHARP_SUITE=1
        set TEST_NET40_FSHARPQA_SUITE=1
    )

    if /i '%BUILD_CORECLR%' == '1' (
        set TEST_CORECLR_COREUNIT_SUITE=1
    )

    if /i '%BUILD_PORTABLE%' == '1' (
        set TEST_PORTABLE_COREUNIT_SUITE=1
    )

    if /i '%BUILD_VS%' == '1' (
        set TEST_VS_IDEUNIT_SUITE=1
    )
)

setlocal disableDelayedExpansion
echo.

goto :MAIN

REM ------------------ Procedure to parse one argument -----------------------

:SET_CONFIG
set ARG=%~1
if "%ARG%" == "1" if "%2" == "" (set ARG=default)
{'fraction_non_alphanumeric': 0.13572303921568626, 'fraction_numerical': 0.02849264705882353, 'mean_word_length': 3.0377241805813235, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '4453590', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2443, 'n_words': 638}