| 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\tools\%_C% |
| 14 | |
| 15 | :: Clean |
| 16 | |
| 17 | @if "%_INC%"=="" call :clean |
| 18 | @if NOT "%_CLEAN%"=="" goto :end |
| 19 | |
| 20 | @echo Building tools %_C% |
| 21 | |
| 22 | :: Build |
| 23 | msbuild -Restore tools.sln -p:Configuration=%_C% -tl -nologo -m -warnaserror -bl:%_L%\tools_build.binlog || exit /b |
| 24 | |
| 25 | :: Publish |
| 26 | msbuild publish_t.proj -p:Configuration=%_C% -tl -nologo -m -warnaserror -bl:%_L%\tools_publish.binlog || exit /b |
| 27 | |
| 28 | :: Test |
| 29 | dotnet test ^ |
| 30 | %_B%\test\WixToolsetTest.Heat\net472\WixToolsetTest.Heat.dll ^ |
| 31 | %_B%\test\WixToolsetTest.HeatTasks\net472\WixToolsetTest.HeatTasks.dll ^ |
| 32 | --nologo -l "trx;LogFileName=%_L%\TestResults\tools.trx" || exit /b |
| 33 | |
| 34 | :: Pack |
| 35 | msbuild -t:Pack WixToolset.Heat -p:Configuration=%_C% -p:NoBuild=true -tl -nologo -m -warnaserror -bl:%_L%\tools_pack.binlog || exit /b |
| 36 | |
| 37 | @goto :end |
| 38 | |
| 39 | :clean |
| 40 | @rd /s/q "..\..\build\tools" 2> nul |
| 41 | @del "..\..\build\artifacts\WixToolset.Heat.*.nupkg" 2> nul |
| 42 | @rd /s/q "%USERPROFILE%\.nuget\packages\wixtoolset.heat" 2> nul |
| 43 | @exit /b |
| 44 | |
| 45 | :end |
| 46 | @popd |
| 47 | @endlocal |