Fix usage of ERRORLEVEL in Windows build scripts

This commit is contained in:
dcristoloveanu 2016-07-19 20:51:28 -07:00
Родитель 5ac47178f4
Коммит be8138826c
5 изменённых файлов: 29 добавлений и 28 удалений

@ -1 +1 @@
Subproject commit 1872905b643c510512aee3687ac0ae9100eef1bc
Subproject commit 0b13eb8da66372ef736a4cdf820da7f5a624a8bb

Просмотреть файл

@ -17,17 +17,17 @@ rem -- build (clean) compilembed tool
rem -----------------------------------------------------------------------------
call "%repo-build-root%\azure-c-shared-utility\tools\compilembed\build.cmd" --clean
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
rem -----------------------------------------------------------------------------
rem -- build uMQTT and samples
rem -----------------------------------------------------------------------------
call %repo-build-root%\azure-c-shared-utility\tools\mbed_build_scripts\release_mbed_project.cmd %repo-build-root%\build_all
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
call :compile mqtt_client_sample %repo-build-root%\samples\mqtt_client_sample\mbed
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
goto :eof
@ -41,7 +41,7 @@ set "cmake_project_bin_path=%project_name%_cmake_build"
mkdir %cmake_project_bin_path%
cd %cmake_project_bin_path%
cmake -Dmbed_repo_name:string=%project_name% -Dmbed_output_bin_path:string=%download_bin_path% %project_path%
set CMAKE_ERROR_CODE=%ERRORLEVEL%
set CMAKE_ERROR_CODE=!ERRORLEVEL!
cd ..
exit /b %CMAKE_ERROR_CODE%
goto:eof

Просмотреть файл

@ -67,11 +67,11 @@ rem -- Copy all Win32 files from cmake build directory to the repo directory
echo copying %build-path%\umqtt_win32\win32\debug
xcopy /q /y /R %build-path%\umqtt_win32\Debug\*.* %build-path%\azure_mqtt_output\win32\debug\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all Win32 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\umqtt_win32\Release\*.* %build-path%\azure_mqtt_output\win32\Release\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -----------------------------------------------------------------------------
rem -- build with CMAKE x64
@ -79,11 +79,11 @@ rem ----------------------------------------------------------------------------
rem -- Copy all x64 files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\umqtt_x64\Debug\*.* %build-path%\azure_mqtt_output\x64\debug\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all x64 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\umqtt_x64\Release\*.* %build-path%\azure_mqtt_output\x64\Release\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -----------------------------------------------------------------------------
@ -92,11 +92,11 @@ rem ----------------------------------------------------------------------------
rem -- Copy all ARM files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\umqtt_arm\Debug\*.* %build-path%\azure_mqtt_output\arm\debug\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
rem -- Copy all x64 Release files from cmake build directory to the repo directory
xcopy /q /y /R %build-path%\umqtt_arm\Release\*.* %build-path%\azure_mqtt_output\arm\Release\*.*
if %errorlevel% neq 0 exit /b %errorlevel%
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
if exist *.nupkg (
del *.nupkg

Просмотреть файл

@ -104,7 +104,7 @@ pushd %build-root%\cmake\%CMAKE_DIR%
if %MAKE_NUGET_PKG% == yes (
echo ***Running CMAKE for Win32***
cmake %build-root% -Dskip_unittests:BOOL=%CMAKE_skip_unittests%
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
popd
echo ***Running CMAKE for Win64***
@ -114,7 +114,7 @@ if %MAKE_NUGET_PKG% == yes (
mkdir %build-root%\cmake\umqtt_x64
pushd %build-root%\cmake\umqtt_x64
cmake -Dskip_unittests:BOOL=%CMAKE_skip_unittests% %build-root% -G "Visual Studio 14 Win64"
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
popd
echo ***Running CMAKE for ARM***
@ -125,39 +125,39 @@ if %MAKE_NUGET_PKG% == yes (
pushd %build-root%\cmake\umqtt_arm
echo ***Running CMAKE for ARM***
cmake -Dskip_unittests:BOOL=%CMAKE_skip_unittests% %build-root% -G "Visual Studio 14 ARM"
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else if %build-platform% == Win32 (
echo ***Running CMAKE for Win32***
cmake %build-root% -Dskip_unittests:BOOL=%CMAKE_skip_unittests%
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else if %build-platform% == arm (
echo ***Running CMAKE for ARM***
cmake -Dskip_unittests:BOOL=%CMAKE_skip_unittests% %build-root% -G "Visual Studio 14 ARM"
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else (
echo ***Running CMAKE for Win64***
cmake -Dskip_unittests:BOOL=%CMAKE_skip_unittests% %build-root% -G "Visual Studio 14 Win64"
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
)
if %MAKE_NUGET_PKG% == yes (
echo ***Building all configurations***
msbuild /m %build-root%\cmake\umqtt_win32\umqtt.sln /p:Configuration=Release
msbuild /m %build-root%\cmake\umqtt_win32\umqtt.sln /p:Configuration=Debug
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
msbuild /m %build-root%\cmake\umqtt_x64\umqtt.sln /p:Configuration=Release
msbuild /m %build-root%\cmake\umqtt_x64\umqtt.sln /p:Configuration=Debug
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
msbuild /m %build-root%\cmake\umqtt_arm\umqtt.sln /p:Configuration=Release
msbuild /m %build-root%\cmake\umqtt_arm\umqtt.sln /p:Configuration=Debug
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
) else (
rem msbuild /m umqtt.sln
call :_run-msbuild "Build" umqtt.sln %2 %3
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
echo Build Config: %build-config%
echo Build Platform: %build-platform%
@ -167,7 +167,7 @@ if %MAKE_NUGET_PKG% == yes (
if "%build-config%" == "Debug" (
ctest -C "debug" -V
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
)
)
)
@ -216,7 +216,7 @@ if "%~3" neq "" set build-config=%~3
if "%~4" neq "" set build-platform=%~4
msbuild /m %build-target% "/p:Configuration=%build-config%;Platform=%build-platform%" %2
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
goto :eof
:_run-tests
@ -234,7 +234,7 @@ rem // run tests
echo Test DLLs: %test-dlls-list%
echo.
vstest.console.exe %test-dlls-list%
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
goto :eof
echo done

Просмотреть файл

@ -1,4 +1,5 @@
@setlocal
@setlocal EnableExtensions EnableDelayedExpansion
@echo off
set current-path=%~dp0
@ -12,7 +13,7 @@ for %%i in ("%build-root%") do set build-root=%%~fi
REM check that we have java handy
call :checkExists java
if not %errorlevel%==0 exit /b %errorlevel%
if not !ERRORLEVEL!==0 exit /b !ERRORLEVEL!
REM check that jenkins-cli.jar is in the repository's tools folder
if not exist %build-root%\tools\jenkins-cli.jar (
@ -85,9 +86,9 @@ rem -- helper subroutines
rem -----------------------------------------------------------------------------
:checkExists
where %~1 >nul 2>nul
if not %errorlevel%==0 (
if not !ERRORLEVEL!==0 (
echo "%~1" not found. Please make sure that "%~1" is installed and available in the path.
exit /b %errorlevel%
exit /b !ERRORLEVEL!
)
goto :eof