Skip to content

Commit e647b4a

Browse files
committed
Remove more unused code
1 parent 17e6704 commit e647b4a

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

src/NUnitEngine/nunit.engine/Services/RuntimeLocators/NetCoreRuntimeLocator.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ public static IEnumerable<RuntimeFramework> FindRuntimes(bool x86)
1313
{
1414
List<Version> alreadyFound = new List<Version>();
1515

16-
//foreach (string dirName in GetRuntimeDirectories(x86))
17-
//{
18-
// Version newVersion;
19-
// if (TryGetVersionFromString(dirName, out newVersion) && !alreadyFound.Contains(newVersion))
20-
// {
21-
// alreadyFound.Add(newVersion);
22-
// yield return new RuntimeFramework(RuntimeType.NetCore, newVersion);
23-
// }
24-
//}
25-
2616
foreach (var runtime in DotNet.GetRuntimes("Microsoft.NETCore.App"))
2717
{
2818
if (!alreadyFound.Contains(runtime.Version))
@@ -32,46 +22,6 @@ public static IEnumerable<RuntimeFramework> FindRuntimes(bool x86)
3222
}
3323
}
3424
}
35-
36-
private static IEnumerable<string> GetRuntimeDirectories(bool x86)
37-
{
38-
string installDir = DotNet.GetInstallDirectory(x86);
39-
40-
if (installDir != null && Directory.Exists(installDir) &&
41-
File.Exists(Path.Combine(installDir, "dotnet.exe")))
42-
{
43-
string runtimeDir = Path.Combine(installDir, Path.Combine("shared", "Microsoft.NETCore.App"));
44-
if (Directory.Exists(runtimeDir))
45-
foreach (var dir in new DirectoryInfo(runtimeDir).GetDirectories())
46-
yield return dir.Name;
47-
}
48-
}
49-
50-
private static bool TryGetVersionFromString(string text, out Version newVersion)
51-
{
52-
const string VERSION_CHARS = ".0123456789";
53-
54-
int len = 0;
55-
foreach (char c in text)
56-
{
57-
if (VERSION_CHARS.IndexOf(c) >= 0)
58-
len++;
59-
else
60-
break;
61-
}
62-
63-
try
64-
{
65-
var fullVersion = new Version(text.Substring(0, len));
66-
newVersion = new Version(fullVersion.Major, fullVersion.Minor);
67-
return true;
68-
}
69-
catch
70-
{
71-
newVersion = new Version();
72-
return false;
73-
}
74-
}
7525
}
7626
}
7727
#endif

0 commit comments

Comments
 (0)