Skip to content

Commit b2b323f

Browse files
authored
Merge branch 'main' into darc-main-3179108c-c6b8-45ea-ab29-d26b162530ec
2 parents 9da1999 + 779ecfa commit b2b323f

File tree

10 files changed

+31
-211
lines changed

10 files changed

+31
-211
lines changed

eng/Versions.props

Lines changed: 1 addition & 172 deletions
Large diffs are not rendered by default.

sdk.slnx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<File Path="eng/dogfood.cmd" />
44
<File Path="eng/dogfood.sh" />
55
<File Path="eng/Versions.props" />
6+
<File Path="eng/Version.Details.props" />
67
</Folder>
78
<Folder Name="/Solution Items/">
89
<File Path=".editorconfig" />

src/Cli/dotnet/Commands/Run/RunCommand.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,20 +467,6 @@ static void InvokeRunArgumentsTarget(ProjectInstance project, bool noBuild, Faca
467467

468468
static readonly string ComputeRunArgumentsTarget = "ComputeRunArguments";
469469

470-
private static LoggerVerbosity ToLoggerVerbosity(VerbosityOptions? verbosity)
471-
{
472-
// map all cases of VerbosityOptions enum to the matching LoggerVerbosity enum
473-
return verbosity switch
474-
{
475-
VerbosityOptions.quiet | VerbosityOptions.q => LoggerVerbosity.Quiet,
476-
VerbosityOptions.minimal | VerbosityOptions.m => LoggerVerbosity.Minimal,
477-
VerbosityOptions.normal | VerbosityOptions.n => LoggerVerbosity.Normal,
478-
VerbosityOptions.detailed | VerbosityOptions.d => LoggerVerbosity.Detailed,
479-
VerbosityOptions.diagnostic | VerbosityOptions.diag => LoggerVerbosity.Diagnostic,
480-
_ => LoggerVerbosity.Quiet // default to quiet because run should be invisible if possible
481-
};
482-
}
483-
484470
private static void ThrowUnableToRunError(ProjectInstance project)
485471
{
486472
string targetFrameworks = project.GetPropertyValue("TargetFrameworks");

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ Copyright (c) .NET Foundation. All rights reserved.
5050

5151
</CreateWindowsSdkKnownFrameworkReferences>
5252
</Target>
53-
53+
54+
<!-- TODO: https://github.com/dotnet/sdk/issues/49917 Remove the framework based condition when the data for netcoreapp2.1 and below is fixed-->
5455
<Target Name="AddPrunePackageReferences" BeforeTargets="CollectPrunePackageReferences"
5556
DependsOnTargets="ProcessFrameworkReferences"
5657
Condition="'$(RestoreEnablePackagePruning)' == 'true'
57-
AND '$(TargetFrameworkIdentifier)' == '.NETCoreApp'
58+
AND (('$(TargetFrameworkIdentifier)' == '.NETCoreApp'
5859
AND '$(TargetFrameworkVersion)' != ''
59-
AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '8.0'))">
60-
60+
AND $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '3.0')))
61+
OR ('$(TargetFrameworkIdentifier)' != '.NETCoreApp'))">
6162
<PropertyGroup>
6263
<PrunePackageDataRoot Condition="'$(PrunePackageDataRoot)' == ''">$(NetCoreRoot)\sdk\$(NETCoreSdkVersion)\PrunePackageData\</PrunePackageDataRoot>
6364
<PrunePackageTargetingPackRoots Condition="'$(PrunePackageTargetingPackRoots)' == ''">$(NetCoreTargetingPackRoot)</PrunePackageTargetingPackRoots>

src/WebSdk/Publish/Tasks/Microsoft.NET.Sdk.Publish.Tasks.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<Reference Include="System.Net.Http" />
3636
<Reference Include="System.Xml" />
3737
<PackageReference Include="Microsoft.Web.Deployment" />
38-
<PackageReference Include="System.Text.Json" />
38+
<PackageReference Include="System.Text.Json" VersionOverride="$(PinnedSystemTextJsonPackageVersion)" />
3939
</ItemGroup>
4040
<ItemGroup>
4141
<Compile Include="**\*.cs" />

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -316,21 +316,21 @@ public void PlatformPackagesCanBePruned(bool prunePackages)
316316
[InlineData(ToolsetInfo.CurrentTargetFramework)]
317317
[InlineData("net9.0")]
318318
[InlineData("net8.0")]
319-
// [InlineData("net7.0", false)] TODO: https://github.com/NuGet/Home/issues/14424
320-
// [InlineData("net6.0", false)] TODO: https://github.com/NuGet/Home/issues/14424
321-
// [InlineData("netcoreapp3.1")] TODO: https://github.com/NuGet/Home/issues/14424
322-
// [InlineData("netcoreapp3.0")] TODO: https://github.com/NuGet/Home/issues/14424
323-
[InlineData("netcoreapp2.1", false)]
324-
[InlineData("netcoreapp2.0", false)]
319+
[InlineData("net7.0")]
320+
[InlineData("net6.0")]
321+
[InlineData("netcoreapp3.1")]
322+
[InlineData("netcoreapp3.0")]
323+
[InlineData("netcoreapp2.1", false)] //TODO: https://github.com/dotnet/sdk/issues/49917
324+
[InlineData("netcoreapp2.0", false)] //TODO: https://github.com/dotnet/sdk/issues/49917
325325
[InlineData("netcoreapp1.1", false)]
326326
[InlineData("netcoreapp1.0", false)]
327-
[InlineData("netstandard2.1", false)]
328-
[InlineData("netstandard2.0", false)]
327+
[InlineData("netstandard2.1")]
328+
[InlineData("netstandard2.0")]
329329
[InlineData("netstandard1.1", false)]
330330
[InlineData("netstandard1.0", false)]
331331
[InlineData("net451", false)]
332-
[InlineData("net462", false)]
333-
[InlineData("net481", false)]
332+
[InlineData("net462")]
333+
[InlineData("net481")]
334334
public void PrunePackageDataSucceeds(string targetFramework, bool shouldPrune = true)
335335
{
336336
var nugetFramework = NuGetFramework.Parse(targetFramework);

test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishASingleFileApp.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ public void EnableSingleFile_warns_when_expected_for_not_correctly_multitargeted
736736
testProject.AdditionalProperties["CheckEolTargetFramework"] = "false"; // Silence warning about targeting EOL TFMs
737737
var testAsset = _testAssetsManager.CreateTestProject(testProject, identifier: targetFrameworks)
738738
.WithProjectChanges(AddTargetFrameworkAliases);
739-
739+
740740
var buildCommand = new BuildCommand(testAsset);
741741
var resultAssertion = buildCommand.Execute("/p:CheckEolTargetFramework=false")
742742
.Should().Pass();

test/Microsoft.NET.TestFramework/TestAsset.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,14 +270,14 @@ public TestAsset Restore(ITestOutputHelper log, string relativePath = "", params
270270
return this;
271271
}
272272

273-
public string ReadMSTestVersionFromProps(string propsFilePath)
273+
public string ReadMSTestPackageVersionFromProps(string propsFilePath)
274274
{
275275
XDocument doc = XDocument.Load(propsFilePath);
276-
XElement? msTestVersionElement = doc.Descendants("MSTestVersion").FirstOrDefault();
277-
return msTestVersionElement?.Value ?? throw new InvalidOperationException("MSTestVersion not found in Version.props");
276+
XElement? msTestVersionElement = doc.Descendants("MSTestPackageVersion").FirstOrDefault();
277+
return msTestVersionElement?.Value ?? throw new InvalidOperationException("MSTestPackageVersion not found in Version.props");
278278
}
279279

280-
public void UpdateProjectFileWithMSTestVersion(string projectPath, string msTestVersion)
280+
public void UpdateProjectFileWithMSTestPackageVersion(string projectPath, string msTestVersion)
281281
{
282282
if (projectPath is null)
283283
{

test/UnitTests.proj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@
101101
<TestExecutionDirectoryFiles Include="$(RepoRoot)eng\Versions.props">
102102
<DestinationFolder>eng/</DestinationFolder>
103103
</TestExecutionDirectoryFiles>
104+
<TestExecutionDirectoryFiles Include="$(RepoRoot)eng\Version.Details.props">
105+
<DestinationFolder>eng/</DestinationFolder>
106+
</TestExecutionDirectoryFiles>
104107
<TestExecutionDirectoryFiles Include="$(RepoRoot)eng\ManualVersions.props">
105108
<DestinationFolder>eng/</DestinationFolder>
106109
</TestExecutionDirectoryFiles>

test/dotnet.Tests/CommandTests/Test/GivenDotnetTestBuildsAndRunsTestsWithArtifacts.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ public void RunTestProjectWithCodeCoverage_ShouldReturnExitCodeGenericFailure(st
5252
{
5353
TestAsset testInstance = _testAssetsManager.CopyTestAsset("TestProjectSolutionWithCodeCoverage", Guid.NewGuid().ToString()).WithSource();
5454

55-
// Read MSTestVersion from Versions.props and update the .csproj file
56-
// Search for Versions.props file from the current directory up to the root
57-
string? versionsPropsPath = PathUtility.FindFileInParentDirectories(TestContext.Current.TestExecutionDirectory, $"eng{Path.DirectorySeparatorChar}Versions.props") ?? throw new FileNotFoundException("Versions.props file not found.");
58-
string msTestVersion = testInstance.ReadMSTestVersionFromProps(versionsPropsPath);
59-
testInstance.UpdateProjectFileWithMSTestVersion(Path.Combine($@"{testInstance.Path}{PathUtility.GetDirectorySeparatorChar()}TestProject", "TestProject.csproj"), msTestVersion);
55+
// Read MSTestPackageVersion from Version.Details.props and update the .csproj file
56+
// Search for Version.Details.props file from the current directory up to the root
57+
string? versionsPropsPath = PathUtility.FindFileInParentDirectories(TestContext.Current.TestExecutionDirectory, $"eng{Path.DirectorySeparatorChar}Version.Details.props") ?? throw new FileNotFoundException("Version.Details.props file not found.");
58+
string msTestVersion = testInstance.ReadMSTestPackageVersionFromProps(versionsPropsPath);
59+
testInstance.UpdateProjectFileWithMSTestPackageVersion(Path.Combine($@"{testInstance.Path}{PathUtility.GetDirectorySeparatorChar()}TestProject", "TestProject.csproj"), msTestVersion);
6060

6161
CommandResult result = new DotnetTestCommand(Log, disableNewOutput: false)
6262
.WithWorkingDirectory(testInstance.Path)

0 commit comments

Comments
 (0)