Files
UnrealEngineUWP/Engine/Build/BatchFiles/Mac/SetupDotnet.sh
josh adams f133254485 - Fixed up 3 Linux ContentWorker issues that came from the dotnet 6 upgrade (or other recent UE5 changes):
* Staged the wrong Dotnet directory when making CW from Windows (it would stage Dotnet/6.20.00/windows)
* The ScriptModule code that used the Automation.json files to discover the precompiled UAT script dlls didn't handle \'s on Linux in the paths, and since Windows wrote out the files, there are \'s aplenty. I fixed up the known issue, but possibly all paths loaded from the json files should be fixed up, but it's not easy to do automatically
* We moved to using RunUAT.sh instead of calling dotnet directly, however because we make the CW on Windows, dotnet was not executable, and the code in RunUAT.sh to find the dotnet executable and make it executable (chmod `which dotnet`) only works if dotnet is already executable! So, I moved the +x code into SetupDotnet.sh, on Linux and Mac
#rb eric.knapik
#preflight 62ccd2009922f7e512b6e51a

#ROBOMERGE-OWNER: josh.adams
#ROBOMERGE-AUTHOR: josh.adams
#ROBOMERGE-SOURCE: CL 21055451 via CL 21055464 via CL 21055478
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v972-20964824)
#ROBOMERGE-CONFLICT from-shelf

[CL 21076349 by josh adams in ue5-main branch]
2022-07-13 14:17:50 -04:00

49 lines
1.3 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`
# Select the preferred architecture for the current system
ARCH=x64
[ $(uname -m) == "arm64" ] && ARCH=arm64
export UE_DOTNET_DIR=$CUR_DIR/../../../Binaries/ThirdParty/DotNet/6.0.200/mac-$ARCH
chmod u+x "$UE_DOTNET_DIR/dotnet"
echo $UE_DOTNET_DIR
export PATH=$UE_DOTNET_DIR:$PATH
export DOTNET_ROOT=$UE_DOTNET_DIR
else
export IS_DOTNET_INSTALLED=$IS_DOTNET_INSTALLED
fi
cd "$START_DIR"