Skip to content

Commit 300cdbf

Browse files
committed
Make AppendRuntimeIdentifierToPath=true the default
1 parent b1b92da commit 300cdbf

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/build/Microsoft.NET.RuntimeIdentifierInference.targets

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,8 @@ Copyright (c) .NET Foundation. All rights reserved.
100100
</Choose>
101101

102102
<PropertyGroup>
103-
<!-- AppendRuntimeIdentifierToOutputPath defaults to false since it is a breaking change to change the output path -->
104-
<!-- Projects that build for multiple RIDs can set this to true to get a RID folder in their output path -->
105-
<AppendRuntimeIdentifierToOutputPath Condition="'$(AppendRuntimeIdentifierToOutputPath)' == ''">false</AppendRuntimeIdentifierToOutputPath>
103+
<!-- Projects can opt out of having the RID appended to the output path by setting this to false. -->
104+
<AppendRuntimeIdentifierToOutputPath Condition="'$(AppendRuntimeIdentifierToOutputPath)' == ''">true</AppendRuntimeIdentifierToOutputPath>
106105
</PropertyGroup>
107106

108107
<!--

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildADesktopExe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public void It_generates_binding_redirects_if_needed()
328328
.Should()
329329
.Pass();
330330

331-
var outputDirectory = buildCommand.GetOutputDirectory("net452");
331+
var outputDirectory = buildCommand.GetOutputDirectory("net452", runtimeIdentifier: "win7-x86");
332332

333333
outputDirectory.Should().HaveFiles(new[] {
334334
"DesktopNeedsBindingRedirects.exe",

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildASelfContainedApp.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ public void It_builds_a_runnable_output()
3232
var ns = project.Root.Name.Namespace;
3333
var propertyGroup = project.Root.Elements(ns + "PropertyGroup").First();
3434
propertyGroup.Add(new XElement(ns + "RuntimeIdentifier", runtimeIdentifier));
35-
36-
propertyGroup.Add(new XElement(ns + "AppendRuntimeIdentifierToOutputPath", "true"));
3735
})
3836
.Restore();
3937

test/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAppsWithFrameworkRefs.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ public void It_builds_with_disable_implicit_frameworkRefs()
5656

5757
void VerifyProjectsBuild(TestAsset testAsset, params string[] buildArgs)
5858
{
59-
VerifyBuild(testAsset, "StopwatchLib", "net45", buildArgs,
59+
VerifyBuild(testAsset, "StopwatchLib", "net45", "", buildArgs,
6060
"StopwatchLib.dll",
6161
"StopwatchLib.pdb");
6262

63-
VerifyBuild(testAsset, "EntityFrameworkApp", "net451", buildArgs,
63+
VerifyBuild(testAsset, "EntityFrameworkApp", "net451", "win7-x86", buildArgs,
6464
"EntityFrameworkApp.exe",
6565
"EntityFrameworkApp.pdb",
6666
"EntityFrameworkApp.runtimeconfig.dev.json",
@@ -69,7 +69,7 @@ void VerifyProjectsBuild(TestAsset testAsset, params string[] buildArgs)
6969
// Try running EntityFrameworkApp.exe
7070
var appProjectDirectory = Path.Combine(testAsset.TestRoot, "EntityFrameworkApp");
7171
var buildCommand = new BuildCommand(Stage0MSBuild, appProjectDirectory);
72-
var outputDirectory = buildCommand.GetOutputDirectory("net451");
72+
var outputDirectory = buildCommand.GetOutputDirectory("net451", runtimeIdentifier: "win7-x86");
7373

7474
Command.Create(Path.Combine(outputDirectory.FullName, "EntityFrameworkApp.exe"), Enumerable.Empty<string>())
7575
.CaptureStdOut()
@@ -80,14 +80,14 @@ void VerifyProjectsBuild(TestAsset testAsset, params string[] buildArgs)
8080
.HaveStdOutContaining("Required Test Provider");
8181
}
8282

83-
private void VerifyBuild(TestAsset testAsset, string project, string targetFramework,
83+
private void VerifyBuild(TestAsset testAsset, string project, string targetFramework, string runtimeIdentifier,
8484
string [] buildArgs,
8585
params string [] expectedFiles)
8686
{
8787
var appProjectDirectory = Path.Combine(testAsset.TestRoot, project);
8888

8989
var buildCommand = new BuildCommand(Stage0MSBuild, appProjectDirectory);
90-
var outputDirectory = buildCommand.GetOutputDirectory(targetFramework);
90+
var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: runtimeIdentifier);
9191

9292
buildCommand
9393
.Execute(buildArgs)
@@ -106,30 +106,30 @@ public void The_clean_target_removes_all_files_from_the_output_folder()
106106
}
107107

108108
var testAsset = _testAssetsManager
109-
.CopyTestAsset("AppsWithFrameworkReferences")
109+
.CopyTestAsset("AppsWithFrameworkReferences", "CleanTargetRemovesAll")
110110
.WithSource();
111111

112112
testAsset.Restore("EntityFrameworkApp");
113113
testAsset.Restore("StopwatchLib");
114114

115-
VerifyClean(testAsset, "StopwatchLib", "net45",
115+
VerifyClean(testAsset, "StopwatchLib", "net45", "",
116116
"StopwatchLib.dll",
117117
"StopwatchLib.pdb");
118118

119-
VerifyClean(testAsset, "EntityFrameworkApp", "net451",
119+
VerifyClean(testAsset, "EntityFrameworkApp", "net451", "win7-x86",
120120
"EntityFrameworkApp.exe",
121121
"EntityFrameworkApp.pdb",
122122
"EntityFrameworkApp.runtimeconfig.dev.json",
123123
"EntityFrameworkApp.runtimeconfig.json");
124124
}
125125

126-
private void VerifyClean(TestAsset testAsset, string project, string targetFramework,
126+
private void VerifyClean(TestAsset testAsset, string project, string targetFramework, string runtimeIdentifier,
127127
params string[] expectedFiles)
128128
{
129129
var appProjectDirectory = Path.Combine(testAsset.TestRoot, project);
130130

131131
var buildCommand = new BuildCommand(Stage0MSBuild, appProjectDirectory);
132-
var outputDirectory = buildCommand.GetOutputDirectory(targetFramework);
132+
var outputDirectory = buildCommand.GetOutputDirectory(targetFramework, runtimeIdentifier: runtimeIdentifier);
133133

134134
buildCommand
135135
.Execute()

0 commit comments

Comments
 (0)