Merge branch 'stabilization/2106' into FixLinuxBenchmarks
This commit is contained in:
@@ -20,9 +20,6 @@ IF NOT EXIST "%LY_3RDPARTY_PATH%" (
|
||||
GOTO :error
|
||||
)
|
||||
|
||||
IF NOT EXIST "%LY_ANDROID_SDK%" (
|
||||
SET LY_ANDROID_SDK=!LY_3RDPARTY_PATH!/android-sdk/platform-29
|
||||
)
|
||||
IF NOT EXIST "%LY_ANDROID_SDK%" (
|
||||
ECHO [ci_build] FAIL: LY_ANDROID_SDK=!LY_ANDROID_SDK!
|
||||
GOTO :error
|
||||
|
||||
@@ -13,27 +13,11 @@
|
||||
set -o errexit # exit on the first failure encountered
|
||||
|
||||
if ! command -v cmake &> /dev/null; then
|
||||
if [[ -z $LY_CMAKE_PATH ]]; then LY_CMAKE_PATH=${LY_3RDPARTY_PATH}/CMake/3.19.1/Linux/bin; fi
|
||||
if [[ ! -d $LY_CMAKE_PATH ]]; then
|
||||
echo "[ci_build] CMake path not found"
|
||||
exit 1
|
||||
fi
|
||||
PATH=${LY_CMAKE_PATH}:${PATH}
|
||||
if ! command -v cmake &> /dev/null; then
|
||||
echo "[ci_build] CMake not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "[ci_build] CMake not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v ninja &> /dev/null; then
|
||||
if [[ -z $LY_NINJA_PATH ]]; then LY_NINJA_PATH=${LY_3RDPARTY_PATH}/ninja/1.10.1/Linux; fi
|
||||
if [[ ! -d $LY_NINJA_PATH ]]; then
|
||||
echo "[ci_build] Ninja path not found"
|
||||
exit 1
|
||||
fi
|
||||
PATH=${LY_NINJA_PATH}:${PATH}
|
||||
if ! command -v ninja &> /dev/null; then
|
||||
echo "[ci_build] Ninja not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "[ci_build] Ninja not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -13,14 +13,6 @@
|
||||
set -o errexit # exit on the first failure encountered
|
||||
|
||||
if ! command -v cmake &> /dev/null; then
|
||||
if [[ -z $LY_CMAKE_PATH ]]; then LY_CMAKE_PATH=${LY_3RDPARTY_PATH}/CMake/3.19.1/Mac/CMake.app/Contents/bin; fi
|
||||
if [[ ! -d $LY_CMAKE_PATH ]]; then
|
||||
echo "[ci_build] CMake path not found"
|
||||
exit 1
|
||||
fi
|
||||
PATH=${LY_CMAKE_PATH}:${PATH}
|
||||
if ! command -v cmake &> /dev/null; then
|
||||
echo "[ci_build] CMake not found"
|
||||
exit 1
|
||||
fi
|
||||
echo "[ci_build] CMake not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -12,19 +12,10 @@ REM
|
||||
|
||||
SETLOCAL EnableDelayedExpansion
|
||||
|
||||
IF NOT EXIST "%LY_NINJA_PATH%" (
|
||||
SET LY_NINJA_PATH=%LY_3RDPARTY_PATH%/ninja/1.10.1/Windows
|
||||
)
|
||||
IF NOT EXIST "%LY_NINJA_PATH%" (
|
||||
ECHO [ci_build] FAIL: LY_NINJA_PATH=%LY_NINJA_PATH%
|
||||
GOTO :error
|
||||
)
|
||||
PATH %LY_NINJA_PATH%;%PATH%
|
||||
|
||||
CALL "%~dp0build_windows.cmd"
|
||||
IF NOT %ERRORLEVEL%==0 GOTO :error
|
||||
|
||||
EXIT /b 0
|
||||
|
||||
:error
|
||||
EXIT /b 1
|
||||
EXIT /b 1
|
||||
|
||||
@@ -12,17 +12,8 @@ REM
|
||||
|
||||
where /Q cmake
|
||||
IF NOT %ERRORLEVEL%==0 (
|
||||
IF "%LY_CMAKE_PATH%"=="" (SET LY_CMAKE_PATH=%LY_3RDPARTY_PATH%/CMake/3.19.1/Windows/bin)
|
||||
IF NOT EXIST !LY_CMAKE_PATH! (
|
||||
ECHO [ci_build] CMake path not found
|
||||
GOTO :error
|
||||
)
|
||||
PATH !LY_CMAKE_PATH!;!PATH!
|
||||
where /Q cmake
|
||||
IF NOT !ERRORLEVEL!==0 (
|
||||
ECHO [ci_build] CMake not found
|
||||
GOTO :error
|
||||
)
|
||||
ECHO [ci_build] CMake not found
|
||||
GOTO :error
|
||||
)
|
||||
|
||||
EXIT /b 0
|
||||
|
||||
@@ -1232,10 +1232,12 @@ def create_from_template(destination_path: str,
|
||||
with_this = replace.pop(0)
|
||||
replacements.append((replace_this, with_this))
|
||||
|
||||
sanitized_cpp_name = utils.sanitize_identifier_for_cpp(destination_name)
|
||||
# dst name is Name
|
||||
replacements.append(("${Name}", destination_name))
|
||||
replacements.append(("${NameUpper}", destination_name.upper()))
|
||||
replacements.append(("${NameLower}", destination_name.lower()))
|
||||
replacements.append(("${SanitizedCppName}", sanitized_cpp_name))
|
||||
|
||||
if _instantiate_template(template_json_data,
|
||||
destination_name,
|
||||
@@ -1536,10 +1538,12 @@ def create_project(project_path: str,
|
||||
with_this = replace.pop(0)
|
||||
replacements.append((replace_this, with_this))
|
||||
|
||||
sanitized_cpp_name = utils.sanitize_identifier_for_cpp(project_name)
|
||||
# project name
|
||||
replacements.append(("${Name}", project_name))
|
||||
replacements.append(("${NameUpper}", project_name.upper()))
|
||||
replacements.append(("${NameLower}", project_name.lower()))
|
||||
replacements.append(("${SanitizedCppName}", sanitized_cpp_name))
|
||||
|
||||
# module id is a uuid with { and -
|
||||
if module_id:
|
||||
@@ -1890,6 +1894,10 @@ def create_gem(gem_path: str,
|
||||
# gem name is now the last component of the gem_path
|
||||
gem_name = os.path.basename(gem_path)
|
||||
|
||||
if not utils.validate_identifier(gem_name):
|
||||
logger.error(f'Gem name must be fewer than 64 characters, contain only alphanumeric, "_" or "-" characters, and start with a letter. {gem_name}')
|
||||
return 1
|
||||
|
||||
# gem name cannot be the same as a restricted platform name
|
||||
if gem_name in restricted_platforms:
|
||||
logger.error(f'Gem path cannot be a restricted name. {gem_name}')
|
||||
@@ -1927,10 +1935,13 @@ def create_gem(gem_path: str,
|
||||
with_this = replace.pop(0)
|
||||
replacements.append((replace_this, with_this))
|
||||
|
||||
sanitized_cpp_name = utils.sanitize_identifier_for_cpp(gem_name)
|
||||
# gem name
|
||||
replacements.append(("${Name}", gem_name))
|
||||
replacements.append(("${NameUpper}", gem_name.upper()))
|
||||
replacements.append(("${NameLower}", gem_name.lower()))
|
||||
replacements.append(("${SanitizedCppName}", sanitized_cpp_name))
|
||||
|
||||
|
||||
# module id is a uuid with { and -
|
||||
if module_id:
|
||||
|
||||
@@ -401,13 +401,6 @@ def get_templates_for_generic_creation(): # temporary until we have a better wa
|
||||
return list(filter(filter_project_and_gem_templates_out, get_all_templates()))
|
||||
|
||||
|
||||
def get_all_restricted() -> list:
|
||||
engine_restricted = get_engine_restricted()
|
||||
restricted_data = get_restricted()
|
||||
restricted_data.extend(engine_restricted)
|
||||
return restricted_data
|
||||
|
||||
|
||||
def find_engine_data(json_data: dict,
|
||||
engine_path: str or pathlib.Path = None) -> dict or None:
|
||||
if not engine_path:
|
||||
|
||||
@@ -36,6 +36,23 @@ def validate_identifier(identifier: str) -> bool:
|
||||
return True
|
||||
|
||||
|
||||
def sanitize_identifier_for_cpp(identifier: str) -> str:
|
||||
"""
|
||||
Convert the provided identifier to a valid C++ identifier
|
||||
:param identifier: the name which needs to to sanitized
|
||||
:return: str: sanitized identifier
|
||||
"""
|
||||
if not identifier:
|
||||
return ''
|
||||
|
||||
sanitized_identifier = list(identifier)
|
||||
for index, character in enumerate(sanitized_identifier):
|
||||
if not (character.isalnum() or character == '_'):
|
||||
sanitized_identifier[index] = '_'
|
||||
|
||||
return "".join(sanitized_identifier)
|
||||
|
||||
|
||||
def validate_uuid4(uuid_string: str) -> bool:
|
||||
"""
|
||||
Determine if the uuid supplied is valid.
|
||||
|
||||
Reference in New Issue
Block a user