Files
o3de/scripts/build/Platform/Windows/build_windows.cmd
T
Esteban Papp eecf6ab920 Create a nightly job that validates project-centric/engine-prebuilt (#5287)
* adds a test_install_profile_vs2019_pipe job to validate a project can build from the SDK

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* missed escaping these variables and breaks runtime dependencines in the install layout

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Changes to PIPELINE_ENV_OVERRIDE

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Tries to propagate ENV variables from pipeline jobs to jobs under it

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Fixes typo

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* echoing a var to understand why is not going to the right path

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* put the COMMAND_CWD in the wrong job

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* adding similar jobs for linux/mac

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* dont pass an empty LY_PROJECTS

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* cmd -> sh, copy-paste mistake

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* inverting check in linux/mac

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* more fixes for linux/mac

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fixing script paths for macos

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* more fixes for linux/mac

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* Test use of %% instead of !! for windows builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fixes typo

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
2021-11-05 12:30:19 -07:00

74 lines
2.0 KiB
Batchfile

@ECHO OFF
REM
REM Copyright (c) Contributors to the Open 3D Engine Project.
REM For complete copyright and license terms please see the LICENSE at the root of this distribution.
REM
REM SPDX-License-Identifier: Apache-2.0 OR MIT
REM
REM
SETLOCAL EnableDelayedExpansion
REM Jenkins reports MSB8029 when TMP/TEMP is not defined, define a dummy folder
SET TMP=%cd%/temp
SET TEMP=%cd%/temp
IF NOT EXIST %TMP% (
MKDIR temp
)
CALL %~dp0env_windows.cmd
IF NOT EXIST "%OUTPUT_DIRECTORY%" (
MKDIR %OUTPUT_DIRECTORY%.
)
SET SOURCE_DIRECTORY=%CD%
PUSHD %OUTPUT_DIRECTORY%
ECHO [ci_build] cmake --version
cmake --version
IF ERRORLEVEL 1 (
ECHO [ci_build] CMAKE not found!
exit /b 1
)
REM Compute half the amount of processors so some jobs can run
SET /a HALF_PROCESSORS = NUMBER_OF_PROCESSORS / 2
SET LAST_CONFIGURE_CMD_FILE=ci_last_configure_cmd.txt
SET CONFIGURE_CMD=cmake %SOURCE_DIRECTORY% %CMAKE_OPTIONS% %EXTRA_CMAKE_OPTIONS% -DLY_3RDPARTY_PATH="%LY_3RDPARTY_PATH%"
IF NOT "%CMAKE_LY_PROJECTS%"=="" (
SET CONFIGURE_CMD=!CONFIGURE_CMD! -DLY_PROJECTS="%CMAKE_LY_PROJECTS%"
)
IF NOT EXIST CMakeCache.txt (
ECHO [ci_build] First run, generating
SET RUN_CONFIGURE=1
) ELSE IF NOT EXIST %LAST_CONFIGURE_CMD_FILE% (
ECHO [ci_build] Last run command not found, generating
SET RUN_CONFIGURE=1
) ELSE (
REM Detect if the input has changed
FOR /F "delims=" %%x in (%LAST_CONFIGURE_CMD_FILE%) DO SET LAST_CMD=%%x
IF !LAST_CMD! NEQ !CONFIGURE_CMD! (
ECHO [ci_build] Last run command different, generating
SET RUN_CONFIGURE=1
)
)
IF DEFINED RUN_CONFIGURE (
ECHO [ci_build] %CONFIGURE_CMD%
%CONFIGURE_CMD%
IF NOT !ERRORLEVEL!==0 GOTO :error
ECHO !CONFIGURE_CMD!> %LAST_CONFIGURE_CMD_FILE%
)
ECHO [ci_build] cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS%
cmake --build . --target %CMAKE_TARGET% --config %CONFIGURATION% %CMAKE_BUILD_ARGS% -- %CMAKE_NATIVE_BUILD_ARGS%
IF NOT %ERRORLEVEL%==0 GOTO :error
POPD
EXIT /b 0
:error
POPD
EXIT /b 1