From 75bb0f24ad06a16a17e4c13f2dfdb3c54c7c8c51 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 23 Nov 2021 13:16:04 -0800 Subject: [PATCH] Msbuild warning fix for jenkins (#5818) --- .../build/Platform/Windows/env_windows.cmd | 28 +++++++++++-------- .../Platform/Windows/installer_windows.cmd | 8 ------ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/scripts/build/Platform/Windows/env_windows.cmd b/scripts/build/Platform/Windows/env_windows.cmd index a78946caf6..78b5ca6c1a 100644 --- a/scripts/build/Platform/Windows/env_windows.cmd +++ b/scripts/build/Platform/Windows/env_windows.cmd @@ -8,8 +8,7 @@ REM REM REM To get recursive folder creation -SETLOCAL EnableExtensions -SETLOCAL EnableDelayedExpansion +SETLOCAL EnableExtensions EnableDelayedExpansion where /Q cmake IF NOT %ERRORLEVEL%==0 ( @@ -22,21 +21,26 @@ IF NOT "%COMMAND_CWD%"=="" ( CD %COMMAND_CWD% ) -REM Jenkins reports MSB8029 when TMP/TEMP is not defined, define a dummy folder -IF NOT "%TMP%"=="" ( - IF NOT "%WORKSPACE_TMP%"=="" ( - SET TMP=%WORKSPACE_TMP% - SET TEMP=%WORKSPACE_TMP% +REM Ending the local environment to be able to propagate the TMP/TEMP variables to the calling script +ENDLOCAL + +REM Jenkins does not defined TMP +IF "%TMP%"=="" ( + IF "%WORKSPACE%"=="" ( + SET TMP=%APPDATA%\Local\Temp + SET TEMP=%APPDATA%\Local\Temp ) ELSE ( - SET TMP=%cd%/temp - SET TEMP=%cd%/temp + SET TMP=%WORKSPACE%\Temp + SET TEMP=%WORKSPACE%\Temp + REM This folder may not be created in the workspace + IF NOT EXIST "!TMP!" ( + MKDIR "!TMP!" + ) ) ) -IF NOT EXIST "!TMP!" ( - MKDIR "!TMP!" -) EXIT /b 0 :error +ENDLOCAL EXIT /b 1 \ No newline at end of file diff --git a/scripts/build/Platform/Windows/installer_windows.cmd b/scripts/build/Platform/Windows/installer_windows.cmd index bbde450973..8dc111c256 100644 --- a/scripts/build/Platform/Windows/installer_windows.cmd +++ b/scripts/build/Platform/Windows/installer_windows.cmd @@ -17,14 +17,6 @@ IF NOT EXIST %OUTPUT_DIRECTORY% ( ) PUSHD %OUTPUT_DIRECTORY% -REM Override the temporary directory used by wix to the workspace (if we have a WORKSPACE_TMP) -IF NOT "%WORKSPACE_TMP%"=="" ( - SET "WIX_TEMP=!WORKSPACE_TMP!/wix" - IF NOT EXIST "!WIX_TEMP!" ( - MKDIR "!WIX_TEMP!" - ) -) - REM Make sure we are using the CMake version of CPack and not the one that comes with chocolatey SET CPACK_PATH= IF "%LY_CMAKE_PATH%"=="" (