Replaces references to Microsoft.Extensions.PlatformAbstractions with Microsoft.Extensions.PlatformAbstractions.Internal
This commit is contained in:
parent
2a49edbb6e
commit
1e753f7781
110 changed files with 886 additions and 954 deletions
|
@ -2,20 +2,11 @@
|
|||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using Xunit;
|
||||
using Moq;
|
||||
using Microsoft.DotNet.Cli.Utils;
|
||||
using Microsoft.DotNet.ProjectModel;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using System.Threading;
|
||||
using FluentAssertions;
|
||||
using NuGet.Frameworks;
|
||||
using Microsoft.DotNet.InternalAbstractions;
|
||||
using Microsoft.DotNet.Tools.Test.Utilities;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Utils.Tests
|
||||
{
|
||||
|
@ -31,7 +22,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = null,
|
||||
CommandArguments = new string[] {""},
|
||||
CommandArguments = new string[] { "" },
|
||||
ProjectDirectory = "/some/directory"
|
||||
};
|
||||
|
||||
|
@ -48,7 +39,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "command",
|
||||
CommandArguments = new string[] {""},
|
||||
CommandArguments = new string[] { "" },
|
||||
ProjectDirectory = null
|
||||
};
|
||||
|
||||
|
@ -130,7 +121,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
var commandResolverArguments = new CommandResolverArguments()
|
||||
{
|
||||
CommandName = "projectpathtestcommand1",
|
||||
CommandArguments = new [] { "arg with space"},
|
||||
CommandArguments = new[] { "arg with space" },
|
||||
ProjectDirectory = s_testProjectDirectory
|
||||
};
|
||||
|
||||
|
@ -143,7 +134,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
[Fact]
|
||||
public void It_resolves_commands_with_extensions_defined_in_InferredExtensions()
|
||||
{
|
||||
var extensions = new string[] {".sh", ".cmd", ".foo", ".exe"};
|
||||
var extensions = new string[] { ".sh", ".cmd", ".foo", ".exe" };
|
||||
var projectPathCommandResolver = SetupPlatformProjectPathCommandResolver(forceGeneric: true);
|
||||
|
||||
foreach (var extension in extensions)
|
||||
|
@ -166,7 +157,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
|
||||
var commandFileName = Path.GetFileName(result.Path);
|
||||
commandFileName.Should().Be("projectpathexttest" + extension);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -218,12 +209,12 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
|
||||
public void It_wraps_command_with_CMD_EXE_when_command_has_CMD_Extension_and_using_WindowsExePreferredCommandSpecFactory()
|
||||
{
|
||||
var environment = new EnvironmentProvider(new [] {".cmd"});
|
||||
var environment = new EnvironmentProvider(new[] { ".cmd" });
|
||||
var platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory();
|
||||
|
||||
var pathCommandResolver = new PathCommandResolver(environment, platformCommandSpecFactory);
|
||||
|
||||
var testCommandPath =
|
||||
var testCommandPath =
|
||||
CommandResolverTestUtils.CreateNonRunnableTestCommand(s_testProjectDirectory, "cmdWrapCommand", ".cmd");
|
||||
|
||||
var commandResolverArguments = new CommandResolverArguments()
|
||||
|
@ -250,7 +241,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
|
|||
|
||||
IPlatformCommandSpecFactory platformCommandSpecFactory = new GenericPlatformCommandSpecFactory();
|
||||
|
||||
if (PlatformServices.Default.Runtime.OperatingSystemPlatform == Platform.Windows
|
||||
if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows
|
||||
&& !forceGeneric)
|
||||
{
|
||||
platformCommandSpecFactory = new WindowsExePreferredCommandSpecFactory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue