From 9dc0371302b9ee3d74ab39f71544b918ddf82583 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 5 Jul 2021 10:54:20 +0200 Subject: [PATCH] Cancel building if code generation fails --- build-windows/generate_code.cmd | 16 ++++++++++++---- build-windows/pEpJNIAdapter.sln | 31 ------------------------------- 2 files changed, 12 insertions(+), 35 deletions(-) delete mode 100644 build-windows/pEpJNIAdapter.sln diff --git a/build-windows/generate_code.cmd b/build-windows/generate_code.cmd index 260e984..50817d2 100644 --- a/build-windows/generate_code.cmd +++ b/build-windows/generate_code.cmd @@ -1,5 +1,3 @@ -@ECHO OFF - SET current_directory=%~dp0 SET dist_directory=%current_directory:~0,-15%\dist SET build_directory=%current_directory:~0,-15%\build @@ -22,23 +20,33 @@ PUSHD .. CD src CD codegen -@ECHO ON PY -m yml2.yml2proc -E utf-8 -y gen_java_Engine.ysl2 pEp.yml2 +IF %ERRORLEVEL% NEQ 0 GOTO end PY -m yml2.yml2proc -E utf-8 -y gen_java_Message.ysl2 pEp.yml2 +IF %ERRORLEVEL% NEQ 0 GOTO end PY -m yml2.yml2proc -E utf-8 -y gen_cpp_Engine.ysl2 pEp.yml2 +IF %ERRORLEVEL% NEQ 0 GOTO end PY -m yml2.yml2proc -E utf-8 -y gen_cpp_Message.ysl2 pEp.yml2 +IF %ERRORLEVEL% NEQ 0 GOTO end PY -m yml2.yml2proc -E utf-8 -y gen_throw_pEp_exception.ysl2 pEp.yml2 -@ECHO OFF +IF %ERRORLEVEL% NEQ 0 GOTO end :: Compile the Java part CD .. CD java javac -encoding UTF-8 -d "%java_build_root%" -h ..\cxx %java_pkg_basename%\*.java +IF %ERRORLEVEL% NEQ 0 GOTO end javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\*.java +IF %ERRORLEVEL% NEQ 0 GOTO end javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\exceptions\*.java +IF %ERRORLEVEL% NEQ 0 GOTO end javac -encoding UTF-8 -d "%java_build_root%" %java_pkg_basename%\interfaces\*.java +IF %ERRORLEVEL% NEQ 0 GOTO end "C:\Program Files\Java\jdk-16\bin\jar" -cvf "%java_build_root%\pEp.jar" -C "%java_build_root%" foundation +IF %ERRORLEVEL% NEQ 0 GOTO end +:end POPD +EXIT /B %ERRORLEVEL% diff --git a/build-windows/pEpJNIAdapter.sln b/build-windows/pEpJNIAdapter.sln deleted file mode 100644 index 0ca7783..0000000 --- a/build-windows/pEpJNIAdapter.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pEpJNIAdapter", "pEpJNIAdapter.vcxproj", "{2A1167BE-F438-4E08-B32E-25F130D97C33}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Debug|x64.ActiveCfg = Debug|x64 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Debug|x64.Build.0 = Debug|x64 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Debug|x86.ActiveCfg = Debug|Win32 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Debug|x86.Build.0 = Debug|Win32 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Release|x64.ActiveCfg = Release|x64 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Release|x64.Build.0 = Release|x64 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Release|x86.ActiveCfg = Release|Win32 - {2A1167BE-F438-4E08-B32E-25F130D97C33}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {429CC90F-89C3-4737-918E-5BCEC8C5C485} - EndGlobalSection -EndGlobal