SPEC-7135 Provide a method to re-trigger compiler detection for changes that require it (#1092)

* SPEC-7135 Provide a method to re-trigger compiler detection for changes that require it

* removing check (is wrong and is not necessary)

* Invert existance check

* add empty lines at the end

* Clean is triggering on each build

* clearing if the variable is false

* test code to understand what is going on...

* yeap, looks good

* handling "false" in linux/mac

* fix for linux/mac

* Fixing typos
This commit is contained in:
Esteban Papp
2021-06-03 18:05:05 -07:00
committed by GitHub
parent 8ae800f579
commit 29ac17a090
6 changed files with 116 additions and 6 deletions
@@ -13,6 +13,7 @@ REM
SETLOCAL EnableDelayedExpansion
CALL %~dp0env_windows.cmd
CALL %~dp0clean_windows.cmd
IF NOT EXIST "%OUTPUT_DIRECTORY%" (
MKDIR %OUTPUT_DIRECTORY%.
@@ -70,4 +71,4 @@ EXIT /b 0
:error
POPD
EXIT /b 1
EXIT /b 1
@@ -12,6 +12,16 @@ REM
SETLOCAL EnableDelayedExpansion
REM Jenkins defines environment variables for parameters and passes "false" to variables
REM that are not set. Here we clear them if they are false so we can also just define them
REM from command line
IF "%CLEAN_ASSETS%"=="false" (
set CLEAN_ASSETS=
)
IF "%CLEAN_OUTPUT_DIRECTORY%"=="false" (
set CLEAN_OUTPUT_DIRECTORY=
)
IF DEFINED CLEAN_ASSETS (
ECHO [ci_build] CLEAN_ASSETS option set
FOR %%P in (%CMAKE_LY_PROJECTS%) do (
@@ -19,7 +29,26 @@ IF DEFINED CLEAN_ASSETS (
ECHO [ci_build] Deleting "%%P\Cache"
DEL /s /q /f %%P\Cache 1>nul
)
)
)
)
REM If the node label changes, we issue a clean output since node changes can change SDK/CMake/toolchains/etc
SET LAST_CONFIGURE_NODE_LABEL_FILE=ci_last_node_label.txt
IF DEFINED NODE_LABEL (
IF EXIST %OUTPUT_DIRECTORY% (
PUSHD %OUTPUT_DIRECTORY%
IF EXIST !LAST_CONFIGURE_NODE_LABEL_FILE! (
FOR /F "delims=" %%x in (%LAST_CONFIGURE_NODE_LABEL_FILE%) DO SET LAST_NODE_LABEL=%%x
) ELSE (
SET LAST_NODE_LABEL=
)
REM Detect if the node label has changed
IF !LAST_NODE_LABEL! NEQ !NODE_LABEL! (
ECHO [ci_build] Last run was done with node label "!LAST_NODE_LABEL!", new node label is "!NODE_LABEL!", forcing CLEAN_OUTPUT_DIRECTORY
SET CLEAN_OUTPUT_DIRECTORY=1
)
POPD
)
)
IF DEFINED CLEAN_OUTPUT_DIRECTORY (
@@ -28,4 +57,12 @@ IF DEFINED CLEAN_OUTPUT_DIRECTORY (
ECHO [ci_build] Deleting "%OUTPUT_DIRECTORY%"
DEL /s /q /f %OUTPUT_DIRECTORY% 1>nul
)
)
)
IF NOT EXIST "%OUTPUT_DIRECTORY%" (
MKDIR %OUTPUT_DIRECTORY%.
)
REM Save the node label
PUSHD %OUTPUT_DIRECTORY%
ECHO !NODE_LABEL!> !LAST_CONFIGURE_NODE_LABEL_FILE!
POPD