Commit dcd5f0a
authored
fix: support robust NuGetize pack delegation for PackFolder=build projects (#39)
### Problem
Projects using NuGetizer + `PackFolder=build` (the standard way to
author MSBuild/ tool packages) would get their assets incorrectly placed
under `content/` + `contentFiles/` when packed via `dotnet pack`.
This is the same root cause that affected the nugetizer 1.4.8 release.
### Root cause
- The shared `Directory.Build.targets` always imported the real
`NuGet.Build.Tasks.Pack.targets`.
- "dotnet pack" flows did not reliably go through the `NuGetize=true`
path.
- Result: SDK pack defaults won instead of NuGetizer's `PackFolder`
inference.
### Fix
* Condition the import of the real pack targets: `And '$(NuGetize)' !=
'true'`. When a project opts into NuGetizer via `NuGetize`, don't pull
in the conflicting SDK pack targets.
* Add a late `<Target Name="Pack">` delegator (after the pack import)
that, for any project with `PackFolder=build` or `buildTransitive`,
re-invokes MSBuild with `NuGetize=true`. This guarantees the correct
packaging logic runs.
The delegator is declared late in the file so it takes precedence.
See also the consuming change in
devlooped/nugetizer#7261 parent ff61659 commit dcd5f0a
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments