Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), testAsset.props))\testAsset.props" />

<PropertyGroup>
<TargetFrameworks>net461;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net461;$(CurrentTargetFramework)</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am torn about the naming here (and all other instances). This project now forces me to double check what CurrentTargetFramework is to understand what is going on. But I guess it is better at communicating the intent than having the variable named net6 and then having to rename it every time there is an upgrade.

</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp3.1;net461</TargetFrameworks>
<TargetFrameworks>$(CurrentTargetFramework);net461</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Tests/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void ItCanBuildAMultiTFMProjectWithImplicitRestore()
string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp");

new DotnetBuildCommand(Log, projectDirectory)
.Execute("--framework", "netcoreapp3.1")
.Execute("--framework", ToolsetInfo.CurrentTargetFramework)
.Should().Pass();
}

Expand Down Expand Up @@ -183,7 +183,7 @@ public void It_warns_on_rid_without_self_contained_options()
{
var testInstance = _testAssetsManager.CopyTestAsset("HelloWorld")
.WithSource()
.WithTargetFrameworkOrFrameworks("net6.0", false)
.WithTargetFrameworkOrFrameworks(ToolsetInfo.CurrentTargetFramework, false)
.Restore(Log);

new DotnetBuildCommand(Log)
Expand Down Expand Up @@ -223,7 +223,7 @@ public void It_does_not_warn_on_rid_with_self_contained_options(string commandNa
{
var testInstance = _testAssetsManager.CopyTestAsset("HelloWorld", identifier: commandName)
.WithSource()
.WithTargetFrameworkOrFrameworks("net6.0", false)
.WithTargetFrameworkOrFrameworks(ToolsetInfo.CurrentTargetFramework, false)
.Restore(Log);

new DotnetCommand(Log)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void ItImplicitlyRestoresAProjectWhenPublishing()
.Should().Pass();
}

[Fact(Skip = "https://github.com/dotnet/sdk/issues/19487")]
[Fact]
public void ItCanPublishAMultiTFMProjectWithImplicitRestore()
{
var testInstance = _testAssetsManager.CopyTestAsset(
Expand Down
6 changes: 3 additions & 3 deletions src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public void ItCanRunAMultiTFMProjectWithImplicitRestore()

new DotnetCommand(Log, "run")
.WithWorkingDirectory(projectDirectory)
.Execute("--framework", "netcoreapp3.1")
.Execute("--framework", ToolsetInfo.CurrentTargetFramework)
.Should().Pass()
.And.HaveStdOutContaining("This string came from the test library!");
}
Expand Down Expand Up @@ -127,7 +127,7 @@ public void ItBuildsTheProjectBeforeRunning()
.And.HaveStdOutContaining("Hello World!");
}

[Fact(Skip = "https://github.com/dotnet/sdk/issues/19487#issuecomment-898765210")]
[Fact]
public void ItCanRunAMSBuildProjectWhenSpecifyingAFramework()
{
var testAppName = "MSBuildTestApp";
Expand All @@ -138,7 +138,7 @@ public void ItCanRunAMSBuildProjectWhenSpecifyingAFramework()

new DotnetCommand(Log, "run")
.WithWorkingDirectory(testProjectDirectory)
.Execute("--framework", "netcoreapp3.1")
.Execute("--framework", ToolsetInfo.CurrentTargetFramework)
.Should().Pass()
.And.HaveStdOut("Hello World!");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void ItCanTestAMultiTFMProjectWithImplicitRestore()

new DotnetTestCommand(Log, ConsoleLoggerOutputNormal)
.WithWorkingDirectory(projectDirectory)
.Execute("--framework", "netcoreapp3.0")
.Execute("--framework", ToolsetInfo.CurrentTargetFramework)
.Should().Pass();
}

Expand Down