45 lines
1.4 KiB
Batchfile
45 lines
1.4 KiB
Batchfile
@echo off
|
|
setlocal EnableExtensions
|
|
|
|
set "ROOT=%~dp0.."
|
|
set "SOLUTION=%ROOT%\BizTalkSapEnvironmentInventory.sln"
|
|
|
|
if not defined MSBUILD (
|
|
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
|
|
if exist "%VSWHERE%" (
|
|
for /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do (
|
|
set "MSBUILD=%%i"
|
|
goto :found_msbuild
|
|
)
|
|
)
|
|
)
|
|
|
|
:found_msbuild
|
|
if not defined MSBUILD (
|
|
for /f "tokens=*" %%i in ('where msbuild 2^>nul') do (
|
|
set "MSBUILD=%%i"
|
|
goto :found_msbuild_path
|
|
)
|
|
)
|
|
|
|
:found_msbuild_path
|
|
if not defined MSBUILD (
|
|
echo FEHLER: MSBuild fehlt. Visual Studio 2019 Build Tools und das .NET Framework 4.7.2 Developer Pack installieren.
|
|
exit /b 2
|
|
)
|
|
|
|
echo Verwende MSBuild: %MSBUILD%
|
|
"%MSBUILD%" -version
|
|
echo Baue klassisches .NET-Framework-4.7.2-Projekt ohne .NET-SDK- oder NuGet-Abhaengigkeit ...
|
|
"%MSBUILD%" "%SOLUTION%" /m /t:Rebuild /p:Configuration=Release /p:Platform="Any CPU"
|
|
if errorlevel 1 exit /b %ERRORLEVEL%
|
|
|
|
echo Fuehre Tests aus ...
|
|
"%ROOT%\tests\BizTalkSapEnvironmentInventory.Tests\bin\Release\BizTalkSapEnvironmentInventory.Tests.exe"
|
|
if errorlevel 1 exit /b %ERRORLEVEL%
|
|
|
|
echo Fuehre Self-Test der Anwendung aus ...
|
|
"%ROOT%\src\BizTalkSapEnvironmentInventory\bin\Release\BizTalkSapEnvironmentInventory.exe" --self-test
|
|
exit /b %ERRORLEVEL%
|
|
|