Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pack targets extensibility - Make the project reference driven package references possible to overwrite #8133

Open
nkolev92 opened this issue May 15, 2019 · 4 comments

Comments

@nkolev92
Copy link
Member

nkolev92 commented May 15, 2019

This effectively means modifying the information usually processed through the assets file.

There's a related internal thread raised by @AArnott

NuGet's behavior is undefined when the project reference target framework gets changed/stripped out.

Related threads for investigation:

https://github.com/microsoft/vs-threading
microsoft/vs-threading#483

Other scenarios are including references to native projects and making them packable through the targets.

Note that this wouldn't be a recommended scenario, but there should be an escape hatch for special scenarios that are difficult to support natively.

@nkolev92
Copy link
Member Author

A well put "suggestion" describing how to actually handle this refactoring.

A common pattern in MSBuild .targets is to split up steps across targets so that folks can intercept and tweak things with custom targets. If NuGet produced a .nuspec file in one target, and packed in a subsequent target, that would give an intermediate target that I might inject a chance to modify the .nuspec file before it was packed, which would drastically customization.

@nkolev92
Copy link
Member Author

nkolev92 commented Apr 6, 2020

A potential workaround it to call GenerateNuspec https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets#L195, edit through your own task and run pack.

Edit: Not really a valid suggestion. See #8133 (comment)

@nkolev92 nkolev92 closed this as completed Apr 6, 2020
@AArnott
Copy link
Contributor

AArnott commented Apr 7, 2020

@nkolev92 I've noticed that the GenerateNuspec target tends to actually do the packing itself. How would I suppress that, and how would I then get it to pack with my rewritten nuspec later?

@nkolev92 nkolev92 reopened this Apr 7, 2020
@nkolev92
Copy link
Member Author

nkolev92 commented Apr 7, 2020

I actually did not mean to close this issue.
In my triaging I think I forgot the fact that GenerateNuspec calls the pack task today, so I'll just strike through my comment as it's not a valid suggestion.

@nkolev92 nkolev92 added the Priority:2 Issues for the current backlog. label Apr 7, 2020
@aortiz-msft aortiz-msft added the Type:DCR Design Change Request label Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants