Fix .NET files deploy regression on AOT platforms
This commit is contained in:
@@ -214,31 +214,39 @@ bool DeployDataStep::Perform(CookingData& data)
|
|||||||
FileSystem::NormalizePath(srcDotnet);
|
FileSystem::NormalizePath(srcDotnet);
|
||||||
LOG(Info, "Using .NET Runtime {} at {}", TEXT("Host"), srcDotnet);
|
LOG(Info, "Using .NET Runtime {} at {}", TEXT("Host"), srcDotnet);
|
||||||
|
|
||||||
// Get major Version
|
// Get .NET runtime version
|
||||||
Array<String> pathParts;
|
|
||||||
srcDotnet.Split('/', pathParts);
|
|
||||||
String version;
|
String version;
|
||||||
for (int i = 0; i < pathParts.Count(); i++)
|
if (usAOT)
|
||||||
{
|
{
|
||||||
if (pathParts[i] == TEXT("runtimes"))
|
// Precompiled
|
||||||
|
version = StringUtils::ToString(GAME_BUILD_DOTNET_RUNTIME_MIN_VER);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Detect from path
|
||||||
|
Array<String> pathParts;
|
||||||
|
srcDotnet.Split('/', pathParts);
|
||||||
|
for (int i = 0; i < pathParts.Count(); i++)
|
||||||
{
|
{
|
||||||
Array<String> versionParts;
|
if (pathParts[i] == TEXT("runtimes"))
|
||||||
pathParts[i - 1].Split('.', versionParts);
|
|
||||||
if (!versionParts.IsEmpty())
|
|
||||||
{
|
{
|
||||||
const String majorVersion = versionParts[0].TrimTrailing();
|
Array<String> versionParts;
|
||||||
int32 versionNum;
|
pathParts[i - 1].Split('.', versionParts);
|
||||||
StringUtils::Parse(*majorVersion, majorVersion.Length(), &versionNum);
|
if (!versionParts.IsEmpty())
|
||||||
if (Math::IsInRange(versionNum, GAME_BUILD_DOTNET_RUNTIME_MIN_VER, GAME_BUILD_DOTNET_RUNTIME_MAX_VER)) // Check for major part
|
{
|
||||||
version = majorVersion;
|
const String majorVersion = versionParts[0].TrimTrailing();
|
||||||
|
int32 versionNum;
|
||||||
|
StringUtils::Parse(*majorVersion, majorVersion.Length(), &versionNum);
|
||||||
|
if (Math::IsInRange(versionNum, GAME_BUILD_DOTNET_RUNTIME_MIN_VER, GAME_BUILD_DOTNET_RUNTIME_MAX_VER)) // Check for major part
|
||||||
|
version = majorVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (version.IsEmpty())
|
||||||
|
{
|
||||||
if (version.IsEmpty())
|
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
|
||||||
{
|
return true;
|
||||||
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deploy runtime files
|
// Deploy runtime files
|
||||||
|
|||||||
Reference in New Issue
Block a user