Skip to content

Infer the framework using the TargetPlatformMoniker instead of TPI and TPV, GetReferenceNearestTargetFrameworkTask now handles P2P frameworks with platforms, Add a LockFile.GetTarget utility for aliases#3578

Merged
nkolev92 merged 5 commits intodevfrom
dev-nkolev92-tfmImprovements
Aug 18, 2020

Conversation

@nkolev92
Copy link
Copy Markdown
Member

@nkolev92 nkolev92 commented Aug 13, 2020

Bug

Fixes: NuGet/Home#9895
Fixes: NuGet/Home#9894
Regression: No

  • Last working version:
  • How are we preventing it in future:

Fix

Details:
This is a loaded PR with many small changes.

Things to look for:

  • NuGetFramework.ParseComponents uses TargetFrameworkMoniker and TargetPlatformMoniker instead of the 5 props.
  • Helper utility to detect the target framework now prefers TargetPlatformMoniker if passed, over TargetPlatformIdentifier/TargetPlatformMinVersion.
  • GetReferenceNearestTargetFrameworkTask can now handle P2Ps of TFMs with Platforms.
  • Added a LockFile.GetTarget utility method that can use an alias instead of a NuGetFramework.

Fixed the tests + added a hack covered in NuGet/Home#9913.

Testing/Validation

Tests Added: Yes
Reason for not adding tests:
Validation:

@nkolev92 nkolev92 marked this pull request as ready for review August 13, 2020 22:26
@nkolev92 nkolev92 changed the title Dev nkolev92 tfm improvements Infer the framework using the TargetPlatformMoniker instead of TPI and TPV, GetReferenceNearestTargetFrameworkTask now handles P2P frameworks with platforms, Add a LockFile.GetTarget utility for aliases Aug 13, 2020
@nkolev92
Copy link
Copy Markdown
Member Author

cc @dsplaisted @sfoslund

Copy link
Copy Markdown
Member

@zivkan zivkan left a comment

Choose a reason for hiding this comment

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

I think you need to rebase on the latest dev, because I expect changes needed to VS nomination utilities + tests as well.

Comment thread test/NuGet.Core.Tests/NuGet.Commands.Test/MSBuildRestoreUtilityTests.cs Outdated
Comment thread test/NuGet.Core.Tests/NuGet.Commands.Test/MSBuildRestoreUtilityTests.cs Outdated
Comment thread test/NuGet.Core.Tests/NuGet.Commands.Test/MSBuildRestoreUtilityTests.cs Outdated
@nkolev92 nkolev92 force-pushed the dev-nkolev92-tfmImprovements branch from 9b4a5e9 to b6a23cd Compare August 14, 2020 00:35
Comment thread src/NuGet.Core/NuGet.Frameworks/NuGetFrameworkFactory.cs Outdated
Comment thread test/NuGet.Clients.Tests/NuGet.CommandLine.Test/RestoreNETCoreTest.cs Outdated
@nkolev92 nkolev92 force-pushed the dev-nkolev92-tfmImprovements branch from b6a23cd to 09aa90a Compare August 14, 2020 01:12
@nkolev92 nkolev92 requested review from zivkan and zkat August 14, 2020 01:15
@nkolev92
Copy link
Copy Markdown
Member Author

Fixed all tests + added a property to help tell MSBuild that the new GetNearest Task supports TPM.

cc @dsplaisted

@nkolev92
Copy link
Copy Markdown
Member Author

@zkat @zivkan

Can you please review?

NuGet/Home#9914 would depend on this.

Copy link
Copy Markdown
Member

@zivkan zivkan left a comment

Choose a reason for hiding this comment

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

Just minor nitpicks

Comment thread src/NuGet.Core/NuGet.Build.Tasks/GlobalSuppressions.cs
Comment thread src/NuGet.Core/NuGet.Build.Tasks/NuGet.targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants