diff --git a/scripts/dotnet-cli-build/CompileTargets.cs b/scripts/dotnet-cli-build/CompileTargets.cs index 70279cc76..60136fe78 100644 --- a/scripts/dotnet-cli-build/CompileTargets.cs +++ b/scripts/dotnet-cli-build/CompileTargets.cs @@ -230,7 +230,6 @@ namespace Microsoft.DotNet.Cli.Build public static BuildTargetResult CompileStage1(BuildTargetContext c) { CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "src")); - CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test")); if (Directory.Exists(Dirs.Stage1)) { @@ -258,7 +257,6 @@ namespace Microsoft.DotNet.Cli.Build var configuration = c.BuildContext.Get("Configuration"); CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "src")); - CleanBinObj(c, Path.Combine(c.BuildContext.BuildDirectory, "test")); if (Directory.Exists(Dirs.Stage2)) { diff --git a/scripts/dotnet-cli-build/PrepareTargets.cs b/scripts/dotnet-cli-build/PrepareTargets.cs index 56c06a8e6..ce65668ad 100644 --- a/scripts/dotnet-cli-build/PrepareTargets.cs +++ b/scripts/dotnet-cli-build/PrepareTargets.cs @@ -228,7 +228,7 @@ namespace Microsoft.DotNet.Cli.Build { var dotnet = DotNetCli.Stage0; - dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--infer-runtimes", "--fallbacksource", Dirs.Corehost) + dotnet.Restore("--verbosity", "verbose", "--disable-parallel", "--fallbacksource", Dirs.Corehost) .WorkingDirectory(Path.Combine(c.BuildContext.BuildDirectory, "src")) .Execute() .EnsureSuccessful(); diff --git a/src/dotnet/commands/dotnet-build/CompileContext.cs b/src/dotnet/commands/dotnet-build/CompileContext.cs index 885904a5a..7469d5e9e 100644 --- a/src/dotnet/commands/dotnet-build/CompileContext.cs +++ b/src/dotnet/commands/dotnet-build/CompileContext.cs @@ -547,7 +547,7 @@ namespace Microsoft.DotNet.Tools.Build private class ProjectComparer : IEqualityComparer { - public bool Equals(ProjectDescription x, ProjectDescription y) => string.Equals(x.Identity.Name, y.Identity.Name); + public bool Equals(ProjectDescription x, ProjectDescription y) => string.Equals(x.Identity.Name, y.Identity.Name, StringComparison.Ordinal); public int GetHashCode(ProjectDescription obj) => obj.Identity.Name.GetHashCode(); } diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs index fee3a0417..a8889d522 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/GivenAProjectToolsCommandResolver.cs @@ -28,7 +28,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests { public class GivenAProjectToolsCommandResolver { - private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetStandardApp15; + private static readonly NuGetFramework s_toolPackageFramework = FrameworkConstants.CommonFrameworks.NetCoreApp10; private static readonly string s_liveProjectDirectory = Path.Combine(AppContext.BaseDirectory, "TestAssets/TestProjects/AppWithToolDependency"); diff --git a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs index e431ca7ee..be0286aaf 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToRunTestsInTheConsole.cs @@ -21,7 +21,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests { var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets")); var testInstance = - testAssetManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests").WithLockFiles(); + testAssetManager.CreateTestInstance("ProjectWithTests", identifier: "ConsoleTests"); _projectFilePath = Path.Combine(testInstance.TestRoot, "project.json"); var contexts = ProjectContext.CreateContextForEachFramework( @@ -29,6 +29,11 @@ namespace Microsoft.Dotnet.Tools.Test.Tests null, PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers()); + // Restore the project again in the destination to resolve projects + // Since the lock file has project relative paths in it, those will be broken + // unless we re-restore + new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass(); + _defaultOutputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0"); } diff --git a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs index a3e4fd1af..65ed16756 100644 --- a/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs +++ b/test/dotnet-test.Tests/GivenThatWeWantToUseDotnetTestE2EInDesignTime.cs @@ -20,7 +20,7 @@ namespace Microsoft.Dotnet.Tools.Test.Tests public GivenThatWeWantToUseDotnetTestE2EInDesignTime() { var testAssetManager = new TestAssetsManager(Path.Combine(RepoRoot, "TestAssets")); - var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests").WithLockFiles(); + var testInstance = testAssetManager.CreateTestInstance("ProjectWithTests"); _projectFilePath = Path.Combine(testInstance.TestRoot, "project.json"); var contexts = ProjectContext.CreateContextForEachFramework( @@ -28,6 +28,11 @@ namespace Microsoft.Dotnet.Tools.Test.Tests null, PlatformServices.Default.Runtime.GetAllCandidateRuntimeIdentifiers()); + // Restore the project again in the destination to resolve projects + // Since the lock file has project relative paths in it, those will be broken + // unless we re-restore + new RestoreCommand() { WorkingDirectory = testInstance.TestRoot }.Execute().Should().Pass(); + _outputPath = Path.Combine(testInstance.TestRoot, "bin", "Debug", "netcoreapp1.0"); var buildCommand = new BuildCommand(_projectFilePath); var result = buildCommand.Execute();