Clean up dead code
These are old usages of GetRuntimeIdentifier() that are no longer needed.
This commit is contained in:
parent
c492e714e6
commit
8e239a4825
4 changed files with 0 additions and 101 deletions
|
@ -25,16 +25,5 @@ namespace Microsoft.DotNet.Cli
|
||||||
{
|
{
|
||||||
get { return s_versionFileObject.Value; }
|
get { return s_versionFileObject.Value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Reads the version file and adds runtime specific information
|
|
||||||
/// </summary>
|
|
||||||
public static string ReadAndInterpretVersionFile()
|
|
||||||
{
|
|
||||||
var content = File.ReadAllText(DotnetFiles.VersionFile);
|
|
||||||
content += Environment.NewLine;
|
|
||||||
content += RuntimeEnvironment.GetRuntimeIdentifier();
|
|
||||||
return content;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Cli.Utils
|
|
||||||
{
|
|
||||||
internal static class DotnetRuntimeIdentifiers
|
|
||||||
{
|
|
||||||
public static IEnumerable<string> InferCurrentRuntimeIdentifiers(DotnetVersionFile versionFile)
|
|
||||||
{
|
|
||||||
IEnumerable<string> fallbackIdentifiers = null;
|
|
||||||
|
|
||||||
// If the machine's RID isn't supported by the shared framework (i.e. the CLI
|
|
||||||
// is being used on a newer version of an OS), add the RID that the CLI was built
|
|
||||||
// with as a fallback. The RID the CLI was built with will have the correct
|
|
||||||
// runtime.* NuGet packages available.
|
|
||||||
// For example, when a user is using osx.10.12, but we only support osx.10.10 and
|
|
||||||
// osx.10.11, the project.json "runtimes" section cannot contain osx.10.12, since
|
|
||||||
// that RID isn't contained in the runtime graph - users will get a restore error.
|
|
||||||
FrameworkDependencyFile fxDepsFile = new FrameworkDependencyFile();
|
|
||||||
if (!fxDepsFile.SupportsCurrentRuntime())
|
|
||||||
{
|
|
||||||
string buildRid = versionFile.BuildRid;
|
|
||||||
if (!string.IsNullOrEmpty(buildRid))
|
|
||||||
{
|
|
||||||
fallbackIdentifiers = new string[] { buildRid };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return RuntimeEnvironmentRidExtensions.GetAllCandidateRuntimeIdentifiers(fallbackIdentifiers);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -29,59 +29,5 @@ namespace Microsoft.DotNet.Cli.Utils
|
||||||
return "win7-" + arch;
|
return "win7-" + arch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IEnumerable<string> GetAllCandidateRuntimeIdentifiers()
|
|
||||||
{
|
|
||||||
return GetAllCandidateRuntimeIdentifiers(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static IEnumerable<string> GetAllCandidateRuntimeIdentifiers(IEnumerable<string> fallbackIdentifiers = null)
|
|
||||||
{
|
|
||||||
List<string> result = new List<string>();
|
|
||||||
|
|
||||||
if (RuntimeEnvironment.OperatingSystemPlatform != Platform.Windows)
|
|
||||||
{
|
|
||||||
result.Add(RuntimeEnvironment.GetRuntimeIdentifier());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var arch = RuntimeEnvironment.RuntimeArchitecture.ToLowerInvariant();
|
|
||||||
if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.1", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
result.Add("win7-" + arch);
|
|
||||||
}
|
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.2", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
result.Add("win8-" + arch);
|
|
||||||
result.Add("win7-" + arch);
|
|
||||||
}
|
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("6.3", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
result.Add("win81-" + arch);
|
|
||||||
result.Add("win8-" + arch);
|
|
||||||
result.Add("win7-" + arch);
|
|
||||||
}
|
|
||||||
else if (RuntimeEnvironment.OperatingSystemVersion.StartsWith("10.0", StringComparison.Ordinal))
|
|
||||||
{
|
|
||||||
result.Add("win10-" + arch);
|
|
||||||
result.Add("win81-" + arch);
|
|
||||||
result.Add("win8-" + arch);
|
|
||||||
result.Add("win7-" + arch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fallbackIdentifiers != null)
|
|
||||||
{
|
|
||||||
foreach (string fallbackIdentifier in fallbackIdentifiers)
|
|
||||||
{
|
|
||||||
if (!result.Contains(fallbackIdentifier))
|
|
||||||
{
|
|
||||||
result.Add(fallbackIdentifier);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,6 @@ namespace StreamForwarderTests
|
||||||
{
|
{
|
||||||
public class StreamForwarderTests : TestBase
|
public class StreamForwarderTests : TestBase
|
||||||
{
|
{
|
||||||
private static readonly string s_rid = DotnetLegacyRuntimeIdentifiers.InferLegacyRestoreRuntimeIdentifier();
|
|
||||||
|
|
||||||
public static IEnumerable<object[]> ForwardingTheoryVariations
|
public static IEnumerable<object[]> ForwardingTheoryVariations
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
Loading…
Add table
Reference in a new issue