-
Notifications
You must be signed in to change notification settings - Fork 510
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
[msbuild] Add support for bundling original resources in libraries. Fixes #19028. #20822
Draft
rolfbjarne
wants to merge
40
commits into
main
Choose a base branch
from
dev/rolf/msbuild-bundle-original-resources-in-libraries
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[msbuild] Add support for bundling original resources in libraries. Fixes #19028. #20822
rolfbjarne
wants to merge
40
commits into
main
from
dev/rolf/msbuild-bundle-original-resources-in-libraries
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ixes #19028. If a library references resources, until now we've pre-compile/pre-processed some of those before embedding them the library. This applies to resources of the following item groups: * AtlasTexture * BundleResource * Collada * CoreMLModel * ImageAsset * InterfaceDefinition * SceneKitAsset However, pre-processing resources as a few problems: * It requires a native (Xcode) toolchain. * This is unfortunate when building from Windows: the current approach is that when building a library as a referenced project, the remoting part is skipped, so all such resources are just dropped. * It also means building on Linux doesn't work. * It makes it impossible to merge resources with the same name, if we wanted to do that. So I'm adding support for bundling the original resources in library projects. This is enabled using the MSBuild property `BundleOriginalResources=true`, which is turned off by default for .NET 8 and turned on by default for .NET 9. Fixes #19028.
Also enable nullability and fix any issues.
The SceneKitAsset items contains all the resources within a .scnasset directory. However, we need to pass the .scnasset directory to the native tooling, so we compute the path to the .scnasset directory, and create a new item for it. This new item must have the correct LogicalName set, which is accomplished by: * Not deleting the LogicalName from the original item before using it to compute the new item's LogicalName. * Compute the correct LogicalName for the .scnasset, and actually set it. This fixes an issue where we'd be unable to detec previously processed SceneKitAsset items in universal builds, because the files wouldn't located where they should be on disk.
…Resources targets remotely. They don't seem to need it.
…riginal resources.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…le-original-resources-in-libraries
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
If a library references resources, until now we've pre-compile/pre-processed
some of those before embedding them the library. This applies to resources of
the following item groups:
However, pre-processing resources as a few problems:
that when building a library as a referenced project, the remoting part
is skipped, so all such resources are just dropped.
to do that.
So I'm adding support for bundling the original resources in library projects.
This is enabled using the MSBuild property
BundleOriginalResources=true
,which is turned off by default for .NET 8 and turned on by default for .NET 9+.
Additionally I've added
PartialAppManifest
items to the list of bundledresources from class libraries.
Fixes #19028.