Merge branch 'GoaLitiuM-dotnet8_validate'

This commit is contained in:
Wojtek Figat
2023-11-20 10:48:35 +01:00
3 changed files with 15 additions and 4 deletions

View File

@@ -249,11 +249,17 @@ namespace Flax.Build
if (dotnetSdkVersions == null)
dotnetSdkVersions = GetVersions(Path.Combine(dotnetPath, "sdk"));
if (dotnetRuntimeVersions == null)
dotnetRuntimeVersions = GetVersions(Path.Combine(dotnetPath, "shared/Microsoft.NETCore.App"));
dotnetRuntimeVersions = GetVersions(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App"));
dotnetSdkVersions = dotnetSdkVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "sdk", x)));
dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App", x)));
dotnetSdkVersions = dotnetSdkVersions.OrderByDescending(ParseVersion);
dotnetRuntimeVersions = dotnetRuntimeVersions.OrderByDescending(ParseVersion);
Log.Verbose($"Found the following .NET SDK versions: {string.Join(", ", dotnetSdkVersions)}");
Log.Verbose($"Found the following .NET runtime versions: {string.Join(", ", dotnetRuntimeVersions)}");
string dotnetSdkVersion = dotnetSdkVersions.FirstOrDefault(x => ParseVersion(x).Major >= MinimumVersion.Major && ParseVersion(x).Major <= MaximumVersion.Major);
string dotnetRuntimeVersion = dotnetRuntimeVersions.FirstOrDefault(x => ParseVersion(x).Major >= MinimumVersion.Major && ParseVersion(x).Major <= MaximumVersion.Major);
if (string.IsNullOrEmpty(dotnetSdkVersion))
@@ -276,7 +282,7 @@ namespace Flax.Build
// Pick SDK runtime
if (!TryAddHostRuntime(platform, architecture, rid) && !TryAddHostRuntime(platform, architecture, ridFallback))
{
var path = Path.Combine(RootPath, $"packs/Microsoft.NETCore.App.Host.{rid}/{RuntimeVersionName}/runtimes/{rid}/native");
var path = Path.Combine(RootPath, "packs", $"Microsoft.NETCore.App.Host.{rid}", RuntimeVersionName, "runtimes", rid, "native");
Log.Warning($"Missing .NET SDK host runtime for {platform} {architecture} ({path}).");
return;
}
@@ -465,6 +471,11 @@ namespace Flax.Build
.FirstOrDefault();
}
private static bool IsValidVersion(string versionPath)
{
return File.Exists(Path.Combine(versionPath, ".version"));
}
private static string SearchForDotnetLocationLinux()
{
if (File.Exists("/etc/dotnet/install_location")) // Officially recommended dotnet location file

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"rollForward": "latestMinor"
"rollForward": "latestMajor"
}
}

View File

@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"rollForward": "latestMinor"
"rollForward": "latestMajor"
}
}