Add manual dotnet versions search on windows
This commit is contained in:
@@ -264,10 +264,9 @@ namespace Flax.Build
|
|||||||
Log.Warning($"Missing .NET SDK ({dotnetPath})");
|
Log.Warning($"Missing .NET SDK ({dotnetPath})");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (dotnetSdkVersions == null)
|
|
||||||
dotnetSdkVersions = GetVersions(Path.Combine(dotnetPath, "sdk"));
|
dotnetSdkVersions = MergeVersions(dotnetSdkVersions, GetVersions(Path.Combine(dotnetPath, "sdk")));
|
||||||
if (dotnetRuntimeVersions == null)
|
dotnetRuntimeVersions = MergeVersions(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)));
|
dotnetSdkVersions = dotnetSdkVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "sdk", x)));
|
||||||
dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App", x)));
|
dotnetRuntimeVersions = dotnetRuntimeVersions.Where(x => IsValidVersion(Path.Combine(dotnetPath, "shared", "Microsoft.NETCore.App", x)));
|
||||||
@@ -476,6 +475,18 @@ namespace Flax.Build
|
|||||||
return Path.Combine(root, version);
|
return Path.Combine(root, version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static IEnumerable<string> MergeVersions(IEnumerable<string> a, IEnumerable<string> b)
|
||||||
|
{
|
||||||
|
if (a == null || !a.Any())
|
||||||
|
return b;
|
||||||
|
if (b == null || !b.Any())
|
||||||
|
return a;
|
||||||
|
var result = new HashSet<string>();
|
||||||
|
result.AddRange(a);
|
||||||
|
result.AddRange(b);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private static Version ParseVersion(string version)
|
private static Version ParseVersion(string version)
|
||||||
{
|
{
|
||||||
// Give precedence to final releases over release candidate / beta releases
|
// Give precedence to final releases over release candidate / beta releases
|
||||||
|
|||||||
Reference in New Issue
Block a user