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

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

Closed
kzu opened this issue Sep 27, 2022 · 0 comments · Fixed by #9
Closed

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

kzu opened this issue Sep 27, 2022 · 0 comments · Fixed by #9
Labels
enhancement New feature or request

Comments

@kzu
Copy link
Contributor

kzu commented Sep 27, 2022

If another package depends on the codegen performed by this project,
the transitive content file for ServiceAttribute.cs is not automatically
added because (amazingly) this is totally broken
in nuget and with uncertain ETA on a transitive content files flow
fix.

We should try our best to aid our users and have things Just Work, though.

@kzu kzu added the bug Something isn't working label Sep 27, 2022
kzu added a commit that referenced this issue 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
kzu added a commit that referenced this issue 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
@kzu kzu closed this as completed in #9 Sep 27, 2022
kzu added a commit that referenced this issue 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
@kzu kzu added enhancement New feature or request and removed bug Something isn't working labels Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant