-
Notifications
You must be signed in to change notification settings - Fork 518
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] Fix computing the output path for SceneKitAsset items with custom Link metadata. Fixes #15104. #15186
[msbuild] Fix computing the output path for SceneKitAsset items with custom Link metadata. Fixes #15104. #15186
Conversation
…custom Link metadata. Fixes xamarin#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 xamarin#15104.
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.
// 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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will link.Length
always be greater than asset.ItemSpec.Length - scnassets.Length
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
This comment has been minimized.
This comment has been minimized.
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2558). |
🔥 [PR Build] Build failed 🔥Build failed for the job 'Generate API diff' Pipeline on Agent |
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
❌ [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' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One spacing nit.
msbuild/Xamarin.MacDev.Tasks.Core/Tasks/CompileSceneKitAssetsTaskBase.cs
Outdated
Show resolved
Hide resolved
…askBase.cs Co-authored-by: Chris Hamons <chris.hamons@xamarin.com>
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2558) |
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.