[msbuild] Bump Xamarin.MacDev and use PDictionary.[Try]OpenFile.#25382
[msbuild] Bump Xamarin.MacDev and use PDictionary.[Try]OpenFile.#25382rolfbjarne wants to merge 2 commits into
Conversation
Use the new PDictionary.OpenFile (throws on failure) and
PDictionary.TryOpenFile (returns false on failure) APIs instead of the older
PDictionary.FromFile which could return null.
- FromFile(...)! → OpenFile(...) for code expecting success
- try/catch { FromFile } with fallback → TryOpenFile where appropriate
- Removed dead null checks after OpenFile (it never returns null)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates msbuild tasks and tests to use the newer PDictionary.OpenFile (throwing) and PDictionary.TryOpenFile (non-throwing) APIs instead of PDictionary.FromFile, aligning plist-loading behavior with explicit success vs failure expectations.
Changes:
- Replaced
PDictionary.FromFile(...)withPDictionary.OpenFile(...)in code paths that expect plist loading to succeed. - Replaced
try/catch+ fallback patterns withPDictionary.TryOpenFile(...)where failure is acceptable and should not throw. - Removed null-handling that was only necessary when
FromFilecould return null.
Reviewed changes
Copilot reviewed 37 out of 37 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/common/Driver.cs | Switches plist loading to OpenFile after an existence check. |
| tests/msbuild/Xamarin.MacDev.Tests/TestHelpers/TestBase.cs | Uses TryOpenFile to fail tests cleanly when Info.plist can’t be loaded. |
| tests/msbuild/Xamarin.MacDev.Tests/TargetTests/CollectAppManifestsTests.cs | Uses OpenFile when the app manifest plist is expected to exist and parse. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ResolveNativeReferencesTaskTest.cs | Uses OpenFile for XCFramework test plist resources. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/IBToolTaskTests.cs | Uses OpenFile to read MinimumOSVersion from Info.plist. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GeneratePlistTaskTests/GeneratePlistTaskTests_Core.cs | Uses OpenFile for compiled manifest plist loading in tests. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileEntitlementsTaskTests.cs | Uses OpenFile for compiled/archived entitlements plist assertions. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CompileAppManifestTaskTests.cs | Uses OpenFile for compiled app manifest plist assertions. |
| tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ACToolTaskTest.cs | Uses OpenFile for partial app manifest plist in ACTool tests. |
| tests/dotnet/UnitTests/TestBaseClass.cs | Uses OpenFile to read entitlements output from codesign. |
| tests/dotnet/UnitTests/ProjectTest.cs | Uses OpenFile for various Info.plist reads in dotnet unit tests. |
| tests/dotnet/UnitTests/PartialAppManifestTest.cs | Uses OpenFile for Info.plist validation after builds. |
| tests/dotnet/UnitTests/MauiTest.cs | Uses OpenFile for Info.plist validation in MAUI test builds. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs | Uses OpenFile when parsing tool output manifests for warnings/errors. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAssetPackManifest.cs | Uses OpenFile for the asset pack manifest template. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/WriteAppManifest.cs | Uses OpenFile for the first manifest (inside existing error handling). |
| msbuild/Xamarin.MacDev.Tasks/Tasks/ValidateAppBundle.cs | Uses OpenFile to load bundle Info.plist files during validation. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/ReadAppManifest.cs | Uses OpenFile for the input app manifest plist. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/LinkNativeCode.cs | Uses TryOpenFile for entitlements inspection without exception control flow. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs | Uses TryOpenFile for validating/deleting malformed log plists; uses OpenFile for manifest parsing. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetPropertyListValue.cs | Uses OpenFile for the primary plist load inside existing try/catch. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetNativeExecutableName.cs | Uses OpenFile for app manifest parsing. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetMlaunchArguments.cs | Uses OpenFile to read device family from the manifest. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/GetAvailableDevices.cs | Uses OpenFile to read the bundle manifest when it exists. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/FilterStaticFrameworks.cs | Uses TryOpenFile when reading framework Info.plist for CFBundleExecutable. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSigningIdentity.cs | Uses OpenFile to check whether entitlements are present. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CreateInstallerPackage.cs | Uses OpenFile and removes unreachable null checks after plist load. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CreateDebugSettings.cs | Uses OpenFile to read debug settings plist if present. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CreateAssetPackManifest.cs | Uses TryOpenFile when iterating ODR pack Info.plist files. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CompileProductDefinition.cs | Uses OpenFile and removes unreachable null checks after plist load. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CompileITunesMetadata.cs | Uses OpenFile to load iTunes metadata plists. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CompileEntitlements.cs | Uses OpenFile for default/project entitlements and archived-entitlements comparison. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs | Uses OpenFile for base and partial plist template loading. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/Codesign.cs | Uses OpenFile to read CFBundleExecutable from Info.plist. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/Archive.cs | Uses OpenFile for various manifest reads during archive creation. |
| msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs | Uses OpenFile to parse ACTool manifest output for warnings/errors. |
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.
✅ [PR Build #979e501] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #979e501] Build passed (Build packages) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #979e501] Build passed (Build macOS tests) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🔥 [CI Build #979e501] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 2 tests failed, 173 tests passed. Failures❌ monotouch tests (macOS)2 tests failed, 16 tests passed.Failed tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Use the new PDictionary.OpenFile (throws on failure) and PDictionary.TryOpenFile (returns false on failure) APIs instead of the older PDictionary.FromFile which could return null.