Fix .NET libs deploy regression
This commit is contained in:
@@ -213,20 +213,16 @@ 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);
|
||||||
|
const bool srcDotnetFromEngine = srcDotnet.Contains(TEXT("Source/Platforms"));
|
||||||
|
String packFolder = srcDotnet / TEXT("../../../");
|
||||||
|
|
||||||
// Get .NET runtime version
|
// Get .NET runtime version
|
||||||
String version;
|
String version;
|
||||||
if (usAOT)
|
|
||||||
{
|
{
|
||||||
// Precompiled
|
// Detect from path provided by build tool
|
||||||
version = StringUtils::ToString(GAME_BUILD_DOTNET_RUNTIME_MIN_VER);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Detect from path
|
|
||||||
Array<String> pathParts;
|
Array<String> pathParts;
|
||||||
srcDotnet.Split('/', pathParts);
|
srcDotnet.Split('/', pathParts);
|
||||||
for (int i = 0; i < pathParts.Count(); i++)
|
for (int32 i = 1; i < pathParts.Count(); i++)
|
||||||
{
|
{
|
||||||
if (pathParts[i] == TEXT("runtimes"))
|
if (pathParts[i] == TEXT("runtimes"))
|
||||||
{
|
{
|
||||||
@@ -244,15 +240,32 @@ bool DeployDataStep::Perform(CookingData& data)
|
|||||||
}
|
}
|
||||||
if (version.IsEmpty())
|
if (version.IsEmpty())
|
||||||
{
|
{
|
||||||
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
|
if (srcDotnetFromEngine)
|
||||||
return true;
|
{
|
||||||
|
// Detect version from runtime files inside Engine Platform folder
|
||||||
|
for (int32 i = GAME_BUILD_DOTNET_RUNTIME_MAX_VER; i >= GAME_BUILD_DOTNET_RUNTIME_MIN_VER; i--)
|
||||||
|
{
|
||||||
|
// Check runtime files inside Engine Platform folder
|
||||||
|
String testPath1 = srcDotnet / String::Format(TEXT("lib/net{}.0"), i);
|
||||||
|
String testPath2 = packFolder / String::Format(TEXT("Dotnet/lib/net{}.0"), i);
|
||||||
|
if ((FileSystem::DirectoryExists(testPath1) && FileSystem::GetDirectorySize(testPath1) > 0) ||
|
||||||
|
(FileSystem::DirectoryExists(testPath2) && FileSystem::GetDirectorySize(testPath2) > 0))
|
||||||
|
{
|
||||||
|
version = StringUtils::ToString(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (version.IsEmpty())
|
||||||
|
{
|
||||||
|
data.Error(TEXT("Failed to find supported .NET version for the current host platform."));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deploy runtime files
|
// Deploy runtime files
|
||||||
const Char* corlibPrivateName = TEXT("System.Private.CoreLib.dll");
|
const Char* corlibPrivateName = TEXT("System.Private.CoreLib.dll");
|
||||||
const bool srcDotnetFromEngine = srcDotnet.Contains(TEXT("Source/Platforms"));
|
|
||||||
String packFolder = srcDotnet / TEXT("../../../");
|
|
||||||
String dstDotnetLibs = dstDotnet, srcDotnetLibs = srcDotnet;
|
String dstDotnetLibs = dstDotnet, srcDotnetLibs = srcDotnet;
|
||||||
StringUtils::PathRemoveRelativeParts(packFolder);
|
StringUtils::PathRemoveRelativeParts(packFolder);
|
||||||
if (usAOT)
|
if (usAOT)
|
||||||
|
|||||||
Reference in New Issue
Block a user