Use shared SimctlOutputParser from Xamarin.MacDev for simctl JSON parsing#24856
Use shared SimctlOutputParser from Xamarin.MacDev for simctl JSON parsing#24856
Conversation
Refactor GetAvailableDevices.RunSimCtlAsync to use the shared SimctlOutputParser from the Xamarin.MacDev submodule instead of inline JSON parsing. This: - Reuses tested parsing logic (65+ unit tests in macios-devtools) - Shares the parser across both MSBuild tasks and the MAUI CLI tool - Keeps devicetypes parsing inline (not yet in shared parser) - Preserves all MSBuild metadata, filtering, and discarding logic Depends on dotnet/macios-devtools PR #158 being merged to main. The submodule currently points to feature/simulator-management. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor GetAvailableDevices to use all three shared parsers: - SimctlOutputParser.ParseDevices: simulator device extraction - SimctlOutputParser.ParseRuntimes: runtime extraction - SimctlOutputParser.ParseDeviceTypes: devicetypes extraction - DeviceCtlOutputParser.ParseDevices: physical device extraction This eliminates all inline JSON parsing (System.Text.Json and Xamarin.Utils JsonExtensions no longer needed in this file). The only remaining code is MSBuild-specific TaskItem mapping, platform filtering, RuntimeIdentifier computation, and CanRunArm64. Net result: -45 lines, zero inline JSON parsing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Fix NU1605 package downgrade error: Xamarin.MacDev references System.Text.Json 9.0.4, while Xamarin.MacDev.Tasks pinned 8.0.5. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- XamarinTask: match ICustomLogger nullable signatures (Exception?, object?[]) - GetAvailableDevices: add using Xamarin.Utils for ApplePlatform - Update submodule to latest (6a2d99b) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
AppleSdkSettings was marked [Obsolete] in macios-devtools PR #140 (XcodeLocator). Existing usages in Sdks.cs, CompileAppManifest.cs, and DetectSdkLocation.cs are intentional pending full migration. TreatWarningsAsErrors=true promotes the warning to an error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Point submodule from feature/simulator-management branch to main, which now includes the merged simulator management APIs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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 looks related to the PR:
|
✅ [CI Build #4243e24] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #4243e24] Build passed (Detect API changes) ✅Pipeline on Agent |
🔥 [CI Build #4243e24] Build failed (Build macOS tests) 🔥Build failed for the job 'Build macOS tests' (with job status 'Failed') Pipeline on Agent |
🔥 [CI Build #4243e24] Test results 🔥Test results❌ Tests failed on VSTS: test results 5 tests crashed, 56 tests failed, 75 tests passed. Failures❌ dotnettests tests (iOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (macOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ dotnettests tests (tvOS)1 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ introspection tests5 tests failed, 1 tests passed.Failed tests
Html Report (VSDrops) Download ❌ linker tests44 tests failed, 0 tests passed.Failed tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)1 tests failed, 10 tests passed.Failed tests
Html Report (VSDrops) Download ❌ msbuild tests1 tests failed, 1 tests passed.Failed tests
Html Report (VSDrops) Download ❌ windows tests1 tests failed, 2 tests passed.Failed tests
Html Report (VSDrops) Download ❌ Tests on macOS Monterey (12) tests🔥 Failed catastrophically on VSTS: test results - mac_monterey (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Ventura (13) tests🔥 Failed catastrophically on VSTS: test results - mac_ventura (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Sonoma (14) tests🔥 Failed catastrophically on VSTS: test results - mac_sonoma (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Sequoia (15) tests🔥 Failed catastrophically on VSTS: test results - mac_sequoia (no summary found). Html Report (VSDrops) Download ❌ Tests on macOS Tahoe (26) tests🔥 Failed catastrophically on VSTS: test results - mac_tahoe (no summary found). Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download macOS testsPipeline on Agent |
✅ 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 |
Summary
This PR refactors
GetAvailableDevices.RunSimCtlAsyncto use the sharedSimctlOutputParserfrom theXamarin.MacDevsubmodule (dotnet/macios-devtools) instead of inline JSON parsing.Replaces #24812 — recreated under
dev/branch prefix so CI pipelines trigger.What this PR does
SimctlOutputParserand model classes (main branch, SHA10a0c3c)RunSimCtlAsyncwith:SimctlOutputParser.ParseDevices(json)— typedSimulatorDeviceInfoobjectsSimctlOutputParser.ParseRuntimes(json)— typedSimulatorRuntimeInfoobjectsSimctlOutputParser.ParseDeviceTypes(json)— typedSimulatorDeviceTypeInfoobjectsDeviceCtlOutputParser.ParseDevices(json)— typed physical device infoBuild fixes included
System.Text.Jsonto 9.0.4 (NU1605 fix from submodule dependency)AppleSdkSettingsobsolete warningsDependencies
mainStatus
xamarin-macios-cimain pipeline passed earliercc @rolfbjarne