diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.props b/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.props index 2272634f3935..11890881832a 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.props +++ b/src/Tasks/Microsoft.NET.Build.Tasks/sdk/Sdk.props @@ -34,7 +34,7 @@ Copyright (c) .NET Foundation. All rights reserved. - - - true - - artifacts\ - $([MSBuild]::EnsureTrailingSlash($(BaseArtifactsPath))) + + + true - $(BaseArtifactsPath)bin\ - $(BaseArtifactsPath)intermediates\ + bin\ + $([MSBuild]::EnsureTrailingSlash($(BaseStandardOutputPath))) + + $(BaseStandardOutputPath)build\ + $(BaseStandardOutputPath)obj\ diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets index 2b29b904b665..517d43af2278 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.DefaultOutputPaths.targets @@ -25,23 +25,23 @@ Copyright (c) .NET Foundation. All rights reserved. true - - - true + true - - - artifacts\ - $([MSBuild]::EnsureTrailingSlash($(BaseArtifactsPath))) + + + bin\ + $([MSBuild]::EnsureTrailingSlash($(BaseStandardOutputPath))) - $(BaseArtifactsPath)bin\ + $(BaseStandardOutputPath)build\ - + bin\ $(BaseOutputPath)\ $(BaseOutputPath)$(Configuration)\ @@ -49,9 +49,9 @@ Copyright (c) .NET Foundation. All rights reserved. $(OutputPath)\ - - + + obj\ $(BaseIntermediateOutputPath)\ $(BaseIntermediateOutputPath)$(Configuration)\ @@ -61,43 +61,37 @@ Copyright (c) .NET Foundation. All rights reserved. - $(OutputPath) - $(BaseArtifactsPath)\package\$(Configuration.ToLowerInvariant())\ + $(OutputPath) + $(BaseStandardOutputPath)\package\$(Configuration.ToLowerInvariant())\ - + $(DefaultItemExcludes);$(OutputPath)/** $(DefaultItemExcludes);$(IntermediateOutputPath)/** - - $(DefaultItemExcludes);$(BaseArtifactsPath)/** - - - $(DefaultItemExcludes);bin/** - $(DefaultItemExcludes);obj/** + + $(DefaultItemExcludes);$(BaseStandardOutputPath)/** - $(OutputPath)$(TargetFramework.ToLowerInvariant())\ - $(IntermediateOutputPath)$(TargetFramework.ToLowerInvariant())\ - + <_ArtifactPivots>$(Configuration.ToLowerInvariant()) publish - $(BaseArtifactsPath)$(PublishDirName)\$(_ArtifactPivots)\ + $(BaseStandardOutputPath)$(PublishDirName)\$(_ArtifactPivots)\ - + $(BaseIntermediateOutputPath)$(_ArtifactPivots)\ diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets index 07d07e979990..e333fc879839 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets +++ b/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.RuntimeIdentifierInference.targets @@ -302,8 +302,8 @@ Copyright (c) .NET Foundation. All rights reserved. append a RID the user never mentioned in the path and do so even in the AnyCPU case. --> - $(IntermediateOutputPath)$(RuntimeIdentifier)\ - $(OutputPath)$(RuntimeIdentifier)\ + $(IntermediateOutputPath)$(RuntimeIdentifier)\ + $(OutputPath)$(RuntimeIdentifier)\ - + If using standard output path format, PublishDir is already set in Microsoft.NET.DefaultOutputPaths.targets --> + publish GetValues() DirectoryInfo GetValuesDirectory(string targetFramework = "", string configuration = "Debug") { // Use a consistent directory format to put the values text file in, so we don't have to worry about - // whether the project uses the artifacts output format or not + // whether the project uses the standard output path format or not targetFramework = targetFramework ?? string.Empty; configuration = configuration ?? string.Empty; diff --git a/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs b/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs index 2ff862a9b508..97f6e977dd58 100644 --- a/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs +++ b/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs @@ -20,7 +20,7 @@ public class OutputPathCalculator public string ProjectPath { get; set; } public string TargetFramework { get; set; } public string RuntimeIdentifier { get; set; } - public bool? UseArtifactsOutput { get; set; } + public bool? UseStandardOutputPaths { get; set; } public bool IsSdkProject { get; set; } = true; @@ -53,7 +53,7 @@ public static OutputPathCalculator FromTestProject(string projectPath, TestProje ProjectPath = projectPath, TargetFramework = testProject.TargetFrameworks, RuntimeIdentifier = testProject.RuntimeIdentifier, - UseArtifactsOutput = testProject.UseArtifactsOutput, + UseStandardOutputPaths = testProject.UseStandardOutputPaths, IsSdkProject = testProject.IsSdkProject }; @@ -111,11 +111,11 @@ public bool IsMultiTargeted() } - private bool UsesArtifactsFolder() + private bool UsesStandardOutputPaths() { - if (UseArtifactsOutput.HasValue) + if (UseStandardOutputPaths.HasValue) { - return UseArtifactsOutput.Value; + return UseStandardOutputPaths.Value; } if (!IsSdkProject) @@ -152,7 +152,7 @@ private bool UsesArtifactsFolder() public string GetOutputDirectory(string targetFramework = null, string configuration = "Debug", string runtimeIdentifier = "") { - if (UsesArtifactsFolder()) + if (UsesStandardOutputPaths()) { string pivot = configuration.ToLowerInvariant(); if (IsMultiTargeted() && !string.IsNullOrEmpty(targetFramework)) @@ -167,7 +167,7 @@ public string GetOutputDirectory(string targetFramework = null, string configura { pivot += "_" + runtimeIdentifier; } - return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "artifacts", "bin", pivot); + return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", "build", pivot); } else { @@ -186,7 +186,7 @@ public string GetOutputDirectory(string targetFramework = null, string configura public string GetPublishDirectory(string targetFramework = null, string configuration = "Debug", string runtimeIdentifier = "") { - if (UsesArtifactsFolder()) + if (UsesStandardOutputPaths()) { string pivot = configuration.ToLowerInvariant(); if (IsMultiTargeted() && !string.IsNullOrEmpty(targetFramework)) @@ -201,7 +201,7 @@ public string GetPublishDirectory(string targetFramework = null, string configur { pivot += "_" + runtimeIdentifier; } - return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "artifacts", "publish", pivot); + return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", "publish", pivot); } else { @@ -234,9 +234,9 @@ public string GetIntermediateDirectory(string targetFramework = null, string con public string GetPackageDirectory(string configuration = "Debug") { - if (UsesArtifactsFolder()) + if (UsesStandardOutputPaths()) { - return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "artifacts", "package", configuration.ToLowerInvariant()); + return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", "package", configuration.ToLowerInvariant()); } else { diff --git a/src/Tests/Microsoft.NET.TestFramework/ProjectConstruction/TestProject.cs b/src/Tests/Microsoft.NET.TestFramework/ProjectConstruction/TestProject.cs index c1e055b36e0a..54461c2301e9 100644 --- a/src/Tests/Microsoft.NET.TestFramework/ProjectConstruction/TestProject.cs +++ b/src/Tests/Microsoft.NET.TestFramework/ProjectConstruction/TestProject.cs @@ -49,7 +49,7 @@ public TestProject([CallerMemberName] string name = null) public string TargetFrameworkProfile { get; set; } - public bool? UseArtifactsOutput { get; set; } + public bool? UseStandardOutputPaths { get; set; } public List ReferencedProjects { get; } = new List(); diff --git a/src/Tests/dotnet-pack.Tests/PackTests.cs b/src/Tests/dotnet-pack.Tests/PackTests.cs index 5900d9cc3733..8795ea4a19af 100644 --- a/src/Tests/dotnet-pack.Tests/PackTests.cs +++ b/src/Tests/dotnet-pack.Tests/PackTests.cs @@ -267,7 +267,7 @@ public void ItPacksAppWhenRestoringToSpecificPackageDirectory() .Should() .Pass(); - new DirectoryInfo(Path.Combine(rootPath, "artifacts")) + new DirectoryInfo(Path.Combine(rootPath, "bin")) .Should().HaveFilesMatching("*.nupkg", SearchOption.AllDirectories); }