[msbuild] Fix computing the output path for SceneKitAsset items with custom Link metadata. Fixes #15104.#15186
Merged
rolfbjarne merged 4 commits intodotnet:mainfrom Jun 7, 2022
Conversation
…custom Link metadata. Fixes dotnet#15104. All files in a *.scnassets directory are included as SceneKitAsset items, but when we process these files, Apple's tool take the *.scnassets directory as input. This means that we use the first file inside a *.scnassets directory, compute the path to the actual *.scnassets directory, and work with that path from then on. The problem was that the Link metadata (if present) would be copied from the file's metadata to the directory's metadata, and thus any computations involving the Link metadata for the directory would be wrong. Fix this by computing the correct Link metadata for the directory if the file has it. Also add a test. Fixes dotnet#15104.
dalexsoto
approved these changes
Jun 2, 2022
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.
mandel-macaque
approved these changes
Jun 2, 2022
| // so we need to update the Link metadata accordingly (if it exists). | ||
| var link = scnassetsItem.GetMetadata ("Link"); | ||
| if (!string.IsNullOrEmpty (link)) { | ||
| link = link.Substring (0, link.Length - (asset.ItemSpec.Length - scnassets.Length)); |
Contributor
There was a problem hiding this comment.
Will link.Length always be greater than asset.ItemSpec.Length - scnassets.Length?
This comment has been minimized.
This comment has been minimized.
Member
Author
|
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2558). |
Collaborator
🔥 [PR Build] Build failed 🔥Build failed for the job 'Generate API diff' Pipeline on Agent |
Collaborator
Collaborator
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
Collaborator
❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌Tests failed on VSTS: simulator tests iOS. Test results5 tests failed, 143 tests passed.Failed tests
Pipeline on Agent XAMBOT-1109.Monterey' |
chamons
approved these changes
Jun 6, 2022
msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs
Outdated
Show resolved
Hide resolved
emaf
approved these changes
Jun 6, 2022
…askBase.cs Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
Member
Author
|
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2558) |
This file contains hidden or 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
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.
All files in a *.scnassets directory are included as SceneKitAsset items, but
when we process these files, Apple's tool take the *.scnassets directory as
input. This means that we use the first file inside a *.scnassets directory,
compute the path to the actual *.scnassets directory, and work with that path
from then on. The problem was that the Link metadata (if present) would be
copied from the file's metadata to the directory's metadata, and thus any
computations involving the Link metadata for the directory would be wrong.
Fix this by computing the correct Link metadata for the directory if the file
has it.
Also add a test.
Fixes #15104.