| 1 | @setlocal |
| 2 | @pushd %~dp0 |
| 3 | |
| 4 | @set _C=Debug |
| 5 | @set _L=%~dp0..\..\build\logs |
| 6 | |
| 7 | :parse_args |
| 8 | @if /i "%1"=="release" set _C=Release |
| 9 | @if /i "%1"=="inc" set _INC=1 |
| 10 | @if /i "%1"=="clean" set _CLEAN=1 |
| 11 | @if not "%1"=="" shift & goto parse_args |
| 12 | |
| 13 | @set _B=%~dp0..\..\build\api\%_C% |
| 14 | |
| 15 | :: Clean |
| 16 | |
| 17 | @if "%_INC%"=="" call :clean |
| 18 | @if NOT "%_CLEAN%"=="" goto :end |
| 19 | |
| 20 | @echo Building api %_C% |
| 21 | |
| 22 | :: Restore |
| 23 | :: Build |
| 24 | :: Pack |
| 25 | |
| 26 | msbuild api_t.proj -p:Configuration=%_C% -tl -nologo -warnaserror -bl:%_L%\api_build.binlog || exit /b |
| 27 | |
| 28 | :: Test |
| 29 | dotnet test ^ |
| 30 | %_B%\net6.0\WixToolsetTest.Data.dll ^ |
| 31 | %_B%\net6.0\win-x86\WixToolsetTest.BootstrapperApplicationApi.dll ^ |
| 32 | %_B%\x86\BalUtilUnitTest.dll ^ |
| 33 | %_B%\x86\BextUtilUnitTest.dll ^ |
| 34 | --nologo -l "trx;LogFileName=%_L%\TestResults\api.trx" || exit /b |
| 35 | |
| 36 | @goto :end |
| 37 | |
| 38 | :clean |
| 39 | @rd /s/q "..\..\build\api" 2> nul |
| 40 | @del "..\..\build\artifacts\WixToolset.BextUtil.*.nupkg" 2> nul |
| 41 | @del "..\..\build\artifacts\WixToolset.Data.*.nupkg" 2> nul |
| 42 | @del "..\..\build\artifacts\WixToolset.Extensibility.*.nupkg" 2> nul |
| 43 | @del "..\..\build\artifacts\WixToolset.BootstrapperApplicationApi.*.nupkg" 2> nul |
| 44 | @del "..\..\build\artifacts\WixToolset.BootstrapperExtensionApi.*.nupkg" 2> nul |
| 45 | @del "%_L%\TestResults\api.trx" 2> nul |
| 46 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bextutil" 2> nul |
| 47 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.data" 2> nul |
| 48 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.extensibility" 2> nul |
| 49 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bootstrapperapplicationapi" 2> nul |
| 50 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.bootstrapperextensionapi" 2> nul |
| 51 | @exit /b |
| 52 | |
| 53 | :end |
| 54 | @popd |
| 55 | @endlocal |