Replaces references to Microsoft.Extensions.PlatformAbstractions with Microsoft.Extensions.PlatformAbstractions.Internal

This commit is contained in:
Pranav K 2016-04-28 16:30:32 -07:00
parent 2a49edbb6e
commit 1e753f7781
110 changed files with 886 additions and 954 deletions

View file

@ -1,18 +1,15 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using static Microsoft.DotNet.Cli.Build.FS;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using System.Text.RegularExpressions;
using System.Reflection.PortableExecutable;
using Newtonsoft.Json.Linq;
using Microsoft.DotNet.InternalAbstractions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using static Microsoft.DotNet.Cli.Build.FS;
namespace Microsoft.DotNet.Cli.Build
{
@ -37,9 +34,9 @@ namespace Microsoft.DotNet.Cli.Build
};
public static string HostPackagePlatformRid => HostPackageSupportedRids[
(PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows)
? $"win7-{PlatformServices.Default.Runtime.RuntimeArchitecture}"
: PlatformServices.Default.Runtime.GetRuntimeIdentifier()];
(RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
? $"win7-{RuntimeEnvironment.RuntimeArchitecture}"
: RuntimeEnvironment.GetRuntimeIdentifier()];
public static readonly Dictionary<string, string> HostPackageSupportedRids = new Dictionary<string, string>()
{
@ -479,13 +476,13 @@ namespace Microsoft.DotNet.Cli.Build
string SharedFrameworkNugetVersion = c.BuildContext.Get<string>("SharedFrameworkNugetVersion");
string sharedFrameworkRid;
if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows)
if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows)
{
sharedFrameworkRid = $"win7-{PlatformServices.Default.Runtime.RuntimeArchitecture}";
sharedFrameworkRid = $"win7-{RuntimeEnvironment.RuntimeArchitecture}";
}
else
{
sharedFrameworkRid = PlatformServices.Default.Runtime.GetRuntimeIdentifier();
sharedFrameworkRid = RuntimeEnvironment.GetRuntimeIdentifier();
}
string SharedFrameworkSourceRoot = GenerateSharedFrameworkProject(c, SharedFrameworkTemplateSourceRoot, sharedFrameworkRid);
@ -524,7 +521,7 @@ namespace Microsoft.DotNet.Cli.Build
// Generate RID fallback graph
string runtimeGraphGeneratorRuntime = null;
switch (PlatformServices.Default.Runtime.OperatingSystemPlatform)
switch (RuntimeEnvironment.OperatingSystemPlatform)
{
case Platform.Windows:
runtimeGraphGeneratorRuntime = "win";
@ -553,7 +550,7 @@ namespace Microsoft.DotNet.Cli.Build
}
else
{
c.Error($"Could not determine rid graph generation runtime for platform {PlatformServices.Default.Runtime.OperatingSystemPlatform}");
c.Error($"Could not determine rid graph generation runtime for platform {RuntimeEnvironment.OperatingSystemPlatform}");
}
File.Copy(

View file

@ -4,7 +4,7 @@ using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;

View file

@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using Microsoft.DotNet.Cli.Build.Framework;
namespace Microsoft.DotNet.Cli.Build
{

View file

@ -5,7 +5,7 @@ using System.IO.Compression;
using System.Net.Http;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;

View file

@ -4,8 +4,7 @@ using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
@ -261,11 +260,11 @@ namespace Microsoft.DotNet.Cli.Build
// This is overkill, but I want to cover all the variables used in all OSes (including where some have the same names)
var buildVersion = c.BuildContext.Get<BuildVersion>("BuildVersion");
var configuration = c.BuildContext.Get<string>("Configuration");
var architecture = PlatformServices.Default.Runtime.RuntimeArchitecture;
var architecture = RuntimeEnvironment.RuntimeArchitecture;
var env = new Dictionary<string, string>()
{
{ "RID", PlatformServices.Default.Runtime.GetRuntimeIdentifier() },
{ "OSNAME", PlatformServices.Default.Runtime.OperatingSystem },
{ "RID", RuntimeEnvironment.GetRuntimeIdentifier() },
{ "OSNAME", RuntimeEnvironment.OperatingSystem },
{ "TFM", "dnxcore50" },
{ "REPOROOT", Dirs.RepoRoot },
{ "OutputDir", Dirs.Output },

View file

@ -4,7 +4,7 @@ using System.IO;
using System.IO.Compression;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;

View file

@ -7,8 +7,7 @@ using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Newtonsoft.Json;
using Microsoft.DotNet.InternalAbstractions;
using Newtonsoft.Json.Linq;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using static Microsoft.DotNet.Cli.Build.FS;
@ -37,8 +36,6 @@ namespace Microsoft.DotNet.Cli.Build
[Target(nameof(GenerateVersions), nameof(UpdateTemplateVersions), nameof(CheckPrereqs), nameof(LocateStage0), nameof(ExpectedBuildArtifacts))]
public static BuildTargetResult Init(BuildTargetContext c)
{
var runtimeInfo = PlatformServices.Default.Runtime;
var configEnv = Environment.GetEnvironmentVariable("CONFIGURATION");
if (string.IsNullOrEmpty(configEnv))
@ -51,8 +48,8 @@ namespace Microsoft.DotNet.Cli.Build
c.Info($"Building {c.BuildContext["Configuration"]} to: {Dirs.Output}");
c.Info("Build Environment:");
c.Info($" Operating System: {runtimeInfo.OperatingSystem} {runtimeInfo.OperatingSystemVersion}");
c.Info($" Platform: {runtimeInfo.OperatingSystemPlatform}");
c.Info($" Operating System: {RuntimeEnvironment.OperatingSystem} {RuntimeEnvironment.OperatingSystemVersion}");
c.Info($" Platform: {RuntimeEnvironment.OperatingSystemPlatform}");
return c.Success();
}

View file

@ -1,14 +1,5 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using static Microsoft.DotNet.Cli.Build.FS;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
using static Microsoft.DotNet.Cli.Build.Utils;
namespace Microsoft.DotNet.Cli.Build
{
public static class TestPackageProjects

View file

@ -2,10 +2,8 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using Microsoft.DotNet.InternalAbstractions;
using static Microsoft.DotNet.Cli.Build.Framework.BuildHelpers;
namespace Microsoft.DotNet.Cli.Build
@ -28,7 +26,7 @@ namespace Microsoft.DotNet.Cli.Build
private string GetCrossgenPathForVersion()
{
string arch = PlatformServices.Default.Runtime.RuntimeArchitecture;
string arch = RuntimeEnvironment.RuntimeArchitecture;
string packageId;
if (CurrentPlatform.IsWindows)
{

View file

@ -1,7 +1,7 @@
using Microsoft.Extensions.PlatformAbstractions;
using System;
using System;
using System.IO;
using System.Runtime.InteropServices;
using Microsoft.DotNet.InternalAbstractions;
namespace Microsoft.DotNet.Cli.Build
{
@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Cli.Build
public static readonly string Output = Path.Combine(
RepoRoot,
"artifacts",
PlatformServices.Default.Runtime.GetRuntimeIdentifier());
RuntimeEnvironment.GetRuntimeIdentifier());
public static readonly string Intermediate = Path.Combine(Output, "intermediate");
public static readonly string PackagesIntermediate = Path.Combine(Output, "packages/intermediate");

View file

@ -1,8 +1,8 @@
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.Extensions.PlatformAbstractions;
using System.IO;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.DotNet.Cli.Build.Framework;
using Microsoft.DotNet.InternalAbstractions;
namespace Microsoft.DotNet.Cli.Build
{
@ -43,12 +43,12 @@ namespace Microsoft.DotNet.Cli.Build
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return Path.Combine(Directory.GetCurrentDirectory(), ".dotnet_stage0",
PlatformServices.Default.Runtime.OperatingSystemPlatform.ToString(),
PlatformServices.Default.Runtime.RuntimeArchitecture);
RuntimeEnvironment.OperatingSystemPlatform.ToString(),
RuntimeEnvironment.RuntimeArchitecture);
}
else
{
return Path.Combine(Directory.GetCurrentDirectory(), ".dotnet_stage0", PlatformServices.Default.Runtime.OperatingSystemPlatform.ToString());
return Path.Combine(Directory.GetCurrentDirectory(), ".dotnet_stage0", RuntimeEnvironment.OperatingSystemPlatform.ToString());
}
}