[Vcxproj] Improve NuGet handling in packages.config mode & add necessary logic for package reference mode #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Improve
.targets
import logic when using NuGet packages.config modeOld Behaviour:
/build/native/*.targets
and/build/*.targets
are both imported.Problem: in common,
/build/native/*.targets
for C++ project is firstly chosen if presented, old logic will make/build/*.targets
also be imported, and in before of/build/native/*.targets
, causing troubles.e.g. Microsoft.WindowsAppSDK
Current Behaviour:
/build/native/*.targets
import is made before/build/*.targets
, it will check if/build/native/*.targets
is not presented, then do the
/build/*.targets
import.2. Add support codes for NuGet package reference mode in
.vcxproj
The current NuGet support for C++ project is incomplete.
.props
file import is not supported..targets
and.props
files are initially presented in order to generate correct error check..targets
and.props
files are not supported.[Vcxproj] Support explicit path to NuGet .targets, and clean up existing packages.config if no longer needed #390
here and NuGet/NuGet.Client#3145 have shown the way to force package reference mode for
.vcxproj
.To achieve this in Sharpmake, it requires
Directory.Build.props
<PackageReference>
element generation support inside SharpmakeThis PR contains the 2. part.
I haven't figure out the best way to automatically handle 1., but since
Directory.Build.props
is originally a thing that users manually add to their projects, so it should be no harm to let them also add that custom configuration manually (for now?)P.S. the default NuGet mode for C++ project still keeps as packages.config.