You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Handle different major version for installed dotnet #jira none [CL 16057564 by jonathan adamczewski in ue5-main branch]
42 lines
1.2 KiB
Bash
Executable File
42 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
# Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
START_DIR=`pwd`
|
|
cd "$1"
|
|
|
|
IS_DOTNET_INSTALLED=0
|
|
DOTNET_VERSION_PATH=$(command -v dotnet) || true
|
|
|
|
if [ "$UE_USE_SYSTEM_DOTNET" == "1" ] && [ ! $DOTNET_VERSION_PATH == "" ] && [ -f $DOTNET_VERSION_PATH ]; then
|
|
# If dotnet is installed, check that it has a new enough version of the SDK
|
|
DOTNET_SDKS=(`dotnet --list-sdks | grep -P "(\d*)\.(\d*)\..* \[(.*)\]"`)
|
|
for DOTNET_SDK in $DOTNET_SDKS
|
|
do
|
|
if [ ${DOTNET_SDK[0]} -gt 3 ]; then
|
|
IS_DOTNET_INSTALLED=1
|
|
fi
|
|
|
|
if [ ${DOTNET_SDK[0]} -eq 3 ]; then
|
|
if [ ${DOTNET_SDK[1]} -ge 1 ]; then
|
|
IS_DOTNET_INSTALLED=1
|
|
fi
|
|
fi
|
|
done
|
|
if [ $IS_DOTNET_INSTALLED -eq 0 ]; then
|
|
echo Unable to find installed dotnet sdk of version 3.1 or newer
|
|
fi
|
|
fi
|
|
|
|
# Setup bundled Dotnet if cannot use installed one
|
|
if [ $IS_DOTNET_INSTALLED -eq 0 ]; then
|
|
echo Setting up bundled DotNet SDK
|
|
CUR_DIR=`pwd`
|
|
export UE_DOTNET_DIR=$CUR_DIR/../../../Binaries/ThirdParty/DotNet/Linux
|
|
export PATH=$UE_DOTNET_DIR:$PATH
|
|
export DOTNET_ROOT=$UE_DOTNET_DIR
|
|
else
|
|
export IS_DOTNET_INSTALLED=$IS_DOTNET_INSTALLED
|
|
fi
|
|
|
|
cd "$START_DIR"
|