Skip to content

Commit

Permalink
chore(build.bat): fail on error [skip travis]
Browse files Browse the repository at this point in the history
  • Loading branch information
lotem committed Jun 23, 2019
1 parent 364b17e commit b9f7028
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 43 deletions.
14 changes: 7 additions & 7 deletions appveyor.install.bat
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
setlocal

call appveyor_build_boost.bat
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

call appveyor_build_thirdparty.bat
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

if defined RIME_PLUGINS (
for %%s in (%RIME_PLUGINS%) do call :install_plugin %%s
)

goto EXIT
goto exit

:ERROR
set EXITCODE=%ERRORLEVEL%
:error
set exitcode=%errorlevel%

:EXIT
exit /b %EXITCODE%
:exit
exit /b %exitcode%

:install_plugin
set slug=%1
Expand Down
12 changes: 6 additions & 6 deletions appveyor_build_boost.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if %nocache% == 1 (
call .\bootstrap.bat
.\b2.exe %boost_build_options% -q -d0 stage
popd
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

date /t > boost.cached & time /t >> boost.cached
echo.
Expand All @@ -37,10 +37,10 @@ if %nocache% == 1 (
echo.
)

goto EXIT
goto exit

:ERROR
set EXITCODE=%ERRORLEVEL%
:error
set exitcode=%errorlevel%

:EXIT
exit /b %EXITCODE%
:exit
exit /b %exitcode%
12 changes: 6 additions & 6 deletions appveyor_build_thirdparty.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if not exist thirdparty.cached set nocache=1
if %nocache% == 1 (
git submodule update --init
call .\build.bat thirdparty
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

date /t > thirdparty.cached & time /t >> thirdparty.cached
echo.
Expand All @@ -20,10 +20,10 @@ if %nocache% == 1 (
echo.
)

goto EXIT
goto exit

:ERROR
set EXITCODE=%ERRORLEVEL%
:error
set exitcode=%errorlevel%

:EXIT
exit /b %EXITCODE%
:exit
exit /b %exitcode%
47 changes: 23 additions & 24 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,14 @@ set BJAM_OPTIONS_X64=%BJAM_OPTIONS_COMMON%^
if %build_boost% == 1 (
cd /d %BOOST_ROOT%
if not exist bjam.exe call bootstrap.bat
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

bjam %BJAM_OPTIONS_X86% stage %BOOST_COMPILED_LIBS%
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

if %build_boost_x64% == 1 (
bjam %BJAM_OPTIONS_X64% stage %BOOST_COMPILED_LIBS%
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
)
)

Expand All @@ -137,18 +137,18 @@ if %build_thirdparty% == 1 (
cmake . -Bcmake-build %THIRDPARTY_COMMON_CMAKE_FLAGS%^
-DBUILD_TESTING:BOOL=OFF^
-DWITH_GFLAGS:BOOL=OFF
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build cmake-build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo building leveldb.
cd %THIRDPARTY%\src\leveldb
cmake . -Bbuild %THIRDPARTY_COMMON_CMAKE_FLAGS%^
-DLEVELDB_BUILD_BENCHMARKS:BOOL=OFF^
-DLEVELDB_BUILD_TESTS:BOOL=OFF
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo building yaml-cpp.
cd %THIRDPARTY%\src\yaml-cpp
Expand All @@ -157,36 +157,36 @@ if %build_thirdparty% == 1 (
-DYAML_CPP_BUILD_CONTRIB:BOOL=OFF^
-DYAML_CPP_BUILD_TESTS:BOOL=OFF^
-DYAML_CPP_BUILD_TOOLS:BOOL=OFF
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo building gtest.
cd %THIRDPARTY%\src\googletest
cmake . -Bbuild %THIRDPARTY_COMMON_CMAKE_FLAGS%^
-DBUILD_GMOCK:BOOL=OFF
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo building marisa.
cd %THIRDPARTY%\src\marisa-trie
cmake %THIRDPARTY%\src -Bbuild %THIRDPARTY_COMMON_CMAKE_FLAGS%
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo building opencc.
cd %THIRDPARTY%\src\opencc
cmake . -Bbuild %THIRDPARTY_COMMON_CMAKE_FLAGS%^
-DBUILD_SHARED_LIBS=OFF^
-DBUILD_TESTING=OFF
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error
)

if %build_librime% == 0 goto EXIT
if %build_librime% == 0 goto exit

set RIME_CMAKE_FLAGS=-G%CMAKE_GENERATOR%^
-T%PLATFORM_TOOLSET%^
Expand All @@ -201,26 +201,25 @@ set RIME_CMAKE_FLAGS=-G%CMAKE_GENERATOR%^
cd /d %RIME_ROOT%
echo cmake %RIME_ROOT% -B%build% %RIME_CMAKE_FLAGS%
call cmake %RIME_ROOT% -B%build% %RIME_CMAKE_FLAGS%
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo.
echo building librime.
cmake --build build --config Release --target INSTALL
if %ERRORLEVEL% NEQ 0 goto ERROR
if errorlevel 1 goto error

echo.
echo ready.
echo.
goto EXIT
goto exit

:ERROR
set EXITCODE=%ERRORLEVEL%
:error
set exitcode=%errorlevel%
echo.
echo error building la rime.
echo.

:EXIT
:exit
set PATH=%OLD_PATH%
cd /d %BACK%
rem pause
exit /b %EXITCODE%
exit /b %exitcode%

0 comments on commit b9f7028

Please sign in to comment.