[Vcxproj] Support explicit path to NuGet .targets, and clean up existing packages.config if no longer needed #390
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.
Context
While attempting to add support for Microsoft.GameInput to my project, I noticed the path to its
.targets
-file was different to the two paths that were supported by Sharpmake as is. I was unable to find any examples of the same issue being solved previously, or clear ways to alter the path, so I figured adding a way to explicitly define that path could be useful.Additionally, I noticed the generated
packages.config
would remain after regenerating the solution having removed all packages from the project.Description
The change adds a field to supply an explicit
.targets
-path, which then allows a simplified XML-string to be used to resolve the final.vcxproj
line for the import and error. If an explicit path is not defined, the behaviour with the two possible paths is used so previous sharpmake-files still function.Usage:
Also changes
Vcxproj.GenerateImpl()
to run thePackagesConfig
generator even if there are no NuGet packages defined, to allow it to clean up existing files that are no longer meant to exist, in case the project is not generated from a clean slate.Additional info
All regression tests have run fine as far as I can tell, both using the script and via Visual Studio. I couldn't actually locate any specific tests related to vcxproj files though, so I'm uncertain how well covered the changes I've made here are.