Skip to content

Commit d2e470b

Browse files
authored
Respond to ProduceReferenceAssembly default changing to true (dotnet#31598)
2 parents 377caa7 + 039025f commit d2e470b

File tree

5 files changed

+25
-22
lines changed

5 files changed

+25
-22
lines changed

eng/Version.Details.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@
4646
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-runtime</Uri>
4747
<Sha>8042d61b17540e49e53569e3728d2faa1c596583</Sha>
4848
</Dependency>
49-
<Dependency Name="Microsoft.Build" Version="17.7.0-preview-23212-01">
49+
<Dependency Name="Microsoft.Build" Version="17.7.0-preview-23212-02">
5050
<Uri>https://github.com/dotnet/msbuild</Uri>
51-
<Sha>073c84ec2bb2de1e709eb1326402a8760d5651d3</Sha>
51+
<Sha>cb5e760644d04def33c0cafcaef2a6f496fc68cc</Sha>
5252
</Dependency>
53-
<Dependency Name="Microsoft.Build.Localization" Version="17.7.0-preview-23212-01">
53+
<Dependency Name="Microsoft.Build.Localization" Version="17.7.0-preview-23212-02">
5454
<Uri>https://github.com/dotnet/msbuild</Uri>
55-
<Sha>073c84ec2bb2de1e709eb1326402a8760d5651d3</Sha>
55+
<Sha>cb5e760644d04def33c0cafcaef2a6f496fc68cc</Sha>
5656
</Dependency>
57-
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.7.0-preview-23212-01">
57+
<Dependency Name="Microsoft.SourceBuild.Intermediate.msbuild" Version="17.7.0-preview-23212-02">
5858
<Uri>https://github.com/dotnet/msbuild</Uri>
59-
<Sha>073c84ec2bb2de1e709eb1326402a8760d5651d3</Sha>
59+
<Sha>cb5e760644d04def33c0cafcaef2a6f496fc68cc</Sha>
6060
</Dependency>
6161
<Dependency Name="Microsoft.FSharp.Compiler" Version="12.5.0-beta.23213.7">
6262
<Uri>https://github.com/dotnet/fsharp</Uri>

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
</PropertyGroup>
107107
<PropertyGroup>
108108
<!-- Dependencies from https://github.com/Microsoft/msbuild -->
109-
<MicrosoftBuildPackageVersion>17.7.0-preview-23212-01</MicrosoftBuildPackageVersion>
109+
<MicrosoftBuildPackageVersion>17.7.0-preview-23212-02</MicrosoftBuildPackageVersion>
110110
<MicrosoftBuildCurrentPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildCurrentPackageVersion>
111111
<!-- Some tasks and the resolver will need to run in an MSBuild that is older than the very latest,
112112
so target one that matches the version in minimumMSBuildVersion.
@@ -115,7 +115,7 @@
115115
<MicrosoftBuildPackageVersion Condition="exists('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion') and '$(DotNetBuildFromSource)' != 'true'">$([System.IO.File]::ReadAllText('$(RepoRoot)\src\Layout\redist\minimumMSBuildVersion').Trim())</MicrosoftBuildPackageVersion>
116116
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
117117
<MicrosoftBuildRuntimePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildRuntimePackageVersion>
118-
<MicrosoftBuildLocalizationPackageVersion>17.7.0-preview-23212-01</MicrosoftBuildLocalizationPackageVersion>
118+
<MicrosoftBuildLocalizationPackageVersion>17.7.0-preview-23212-02</MicrosoftBuildLocalizationPackageVersion>
119119
<MicrosoftBuildUtilitiesCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildUtilitiesCorePackageVersion>
120120
<MicrosoftBuildTasksCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildTasksCorePackageVersion>
121121
<MicrosoftBuildVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildVersion>

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,6 @@ Copyright (c) .NET Foundation. All rights reserved.
239239
<AppendTargetFrameworkToOutputPath Condition="'$(AppendTargetFrameworkToOutputPath)' == ''">true</AppendTargetFrameworkToOutputPath>
240240
</PropertyGroup>
241241

242-
<PropertyGroup>
243-
<ProduceReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0)) and ('$(ProduceOnlyReferenceAssembly)' != 'true') and '$(MSBuildProjectExtension)' != '.fsproj'" >true</ProduceReferenceAssembly>
244-
<ProduceReferenceAssembly Condition="'$(ProduceReferenceAssembly)' == '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 7.0)) and ('$(ProduceOnlyReferenceAssembly)' != 'true') and '$(MSBuildProjectExtension)' == '.fsproj'" >true</ProduceReferenceAssembly>
245-
</PropertyGroup>
246-
247242
<!--
248243
Append $(TargetFramework) directory to output and intermediate paths to prevent bin clashes between
249244
targets.

src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildANetCoreApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ public void It_errors_when_publishing_single_file_without_apphost()
868868
.Pass();
869869
}
870870

871-
[Theory]
871+
[RequiresMSBuildVersionTheory("17.7.0")]
872872
[InlineData(true)]
873873
[InlineData(false)]
874874
public void It_builds_the_project_successfully_with_only_reference_assembly_set(bool produceOnlyReferenceAssembly)

src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToProduceReferenceAssembly.cs

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
using Xunit.Abstractions;
1010
using Microsoft.NET.TestFramework.Assertions;
1111
using Microsoft.NET.TestFramework.ProjectConstruction;
12-
using System.Collections.Generic;
1312

1413
namespace Microsoft.NET.Build.Tests
1514
{
@@ -18,26 +17,35 @@ public class GivenThatWeWantToProduceReferenceAssembly : SdkTest
1817
public GivenThatWeWantToProduceReferenceAssembly(ITestOutputHelper log) : base(log)
1918
{}
2019

21-
[RequiresMSBuildVersionTheory("16.8.0")]
22-
[InlineData("netcoreapp3.1", false)]
23-
[InlineData(ToolsetInfo.CurrentTargetFramework, true)]
24-
public void It_produces_ref_assembly_for_appropriate_frameworks(string targetFramework, bool expectedExists)
20+
[RequiresMSBuildVersionTheory("17.7.0")]
21+
[InlineData("netcoreapp3.1", ".csproj")]
22+
[InlineData("net5.0", ".csproj")]
23+
[InlineData("net5.0", ".fsproj")]
24+
[InlineData("net6.0", ".csproj")]
25+
[InlineData("net6.0", ".fsproj")]
26+
[InlineData("net7.0", ".csproj")]
27+
[InlineData("net7.0", ".fsproj")]
28+
#pragma warning disable xUnit1025 // InlineData duplicates
29+
[InlineData(ToolsetInfo.CurrentTargetFramework, ".csproj")]
30+
[InlineData(ToolsetInfo.CurrentTargetFramework, ".fsproj")]
31+
#pragma warning restore xUnit1025 // InlineData duplicates
32+
public void It_produces_ref_assembly_for_appropriate_frameworks(string targetFramework, string extension)
2533
{
26-
TestProject testProject = new TestProject()
34+
TestProject testProject = new()
2735
{
2836
Name = "ProduceRefAssembly",
2937
IsExe = true,
3038
TargetFrameworks = targetFramework
3139
};
3240

33-
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFramework);
41+
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFramework + extension, targetExtension: extension);
3442

3543
var buildCommand = new BuildCommand(testAsset);
3644
buildCommand.Execute()
3745
.Should()
3846
.Pass();
3947
var filePath = Path.Combine(testAsset.Path, testProject.Name, "obj", "Debug", targetFramework, "ref", $"{testProject.Name}.dll");
40-
File.Exists(filePath).Should().Be(expectedExists);
48+
File.Exists(filePath).Should().BeTrue();
4149
}
4250
}
4351
}

0 commit comments

Comments
 (0)