Skip to content

Fix transitive contentFiles support that's missing in nuget#9

Merged
kzu merged 2 commits intomainfrom
dev/transitive
Sep 27, 2022
Merged

Fix transitive contentFiles support that's missing in nuget#9
kzu merged 2 commits intomainfrom
dev/transitive

Conversation

@kzu
Copy link
Copy Markdown
Member

@kzu kzu commented Sep 27, 2022

So, turns out that nuget is completely broken for transitive assets that aren't specifically buildTransitive assets. Why that scenario was fixed just for that ultra-narrow use case of build assets is anyone's guess.

So, we leverage that one-and-only working transitive scenario to detect the situation where transitive assets are missing (the Compile files we provide as content) and include the missing files ourselves.

This requires changing the way we allow opt-out of the service attribute type, though, since now there is no package reference to set the Exclude on. For that, we provide a new property IncludeServiceAttribute that we use to remove the automatically added contentFiles (in non-transitive) or skip adding ourselves (in transitive).

Fixes #8

So, turns out that nuget is completely broken for transitive assets that
aren't specifically `buildTransitive` assets. Why that scenario was fixed
just for that ultra-narrow use case of build assets is anyone's guess.

So, we leverage that one-and-only working transitive scenario to detect
the situation where transitive assets are missing (the Compile files we
provide as content) and include the missing files ourselves.

This requires changing the way we allow opt-out of the service attribute
type, though, since now there is no package reference to set the Exclude
on. For that, we provide a new property IncludeServiceAttribute that we
use to remove the automatically added contentFiles (in non-transitive)
or skip adding ourselves (in transitive).

Fixes #8
@kzu kzu merged commit 9eb2464 into main Sep 27, 2022
@kzu kzu deleted the dev/transitive branch September 27, 2022 05:24
@devlooped devlooped locked and limited conversation to collaborators Nov 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix transitive contentFiles support that's missing in nuget

1 participant