Skip to content

[msbuild] Add a XamarinTask.SdkDevPath property and deduplicate a lot of code in child classes.#24523

Merged
rolfbjarne merged 3 commits intomainfrom
dev/rolf/msbuild-sdkdevpath-unification
Jan 22, 2026
Merged

[msbuild] Add a XamarinTask.SdkDevPath property and deduplicate a lot of code in child classes.#24523
rolfbjarne merged 3 commits intomainfrom
dev/rolf/msbuild-sdkdevpath-unification

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request consolidates the SdkDevPath property by moving it from multiple child task classes to the base XamarinTask class, eliminating code duplication. Additionally, it standardizes error messaging by using the new MSBStrings.E7169 error message format.

Changes:

  • Moved SdkDevPath property from child classes to the base XamarinTask class
  • Added validation logic in the SdkDevPath getter to log an error if the property is not set
  • Updated DetectSdkLocation to use the new pattern with new keyword and pass-through to base class
  • Added new error message E7169 for property validation

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
XamarinTask.cs Added SdkDevPath property with validation logic to base class
XcodeTool.cs Removed duplicate SdkDevPath property declaration
XcodeCompilerToolTask.cs Removed custom SdkDevPath property and updated usage to access backing field
XcodeBuildTask.cs Removed duplicate SdkDevPath property declaration
ScnTool.cs Removed duplicate SdkDevPath property declaration
OptimizeImage.cs Removed duplicate SdkDevPath property declaration
MetalLib.cs Removed duplicate SdkDevPath property declaration
Metal.cs Removed duplicate SdkDevPath property declaration
MergeAppBundles.cs Removed duplicate SdkDevPath property declaration
LinkNativeCode.cs Removed duplicate SdkDevPath property declaration
InstallNameTool.cs Removed duplicate SdkDevPath property declaration
GetMlaunchArguments.cs Removed duplicate SdkDevPath property declaration
DetectSdkLocation.cs Updated to expose base class property as output with new keyword
DSymUtil.cs Removed duplicate SdkDevPath property declaration
CoreMLCompiler.cs Removed custom SdkDevPath property implementation
CompileSceneKitAssets.cs Removed duplicate SdkDevPath property declaration
CompileNativeCode.cs Removed duplicate SdkDevPath property declaration
AlTool.cs Removed duplicate SdkDevPath property declaration
AOTCompile.cs Removed duplicate SdkDevPath property declaration
MSBStrings.resx Added new error message E7169 for property validation
Comments suppressed due to low confidence (1)

msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs:212

  • The code is directly accessing the protected field sdkDevPath instead of using the property SdkDevPath. This is inconsistent with other task classes (e.g., DSymUtil, LinkNativeCode) that pass SdkDevPath to ExecuteAsync. Change sdkDevPath to SdkDevPath to use the property accessor.
			var rv = ExecuteAsync (tool, args, sdkDevPath, environment: environment).Result;

Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/XamarinTask.cs Outdated
Comment thread msbuild/Xamarin.MacDev.Tasks/Tasks/XcodeCompilerToolTask.cs Outdated
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #2955eba] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #2955eba] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [CI Build #2955eba] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #2955eba] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #2955eba] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #2955eba] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #2955eba] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

💻 [CI Build #2955eba] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

🚀 [CI Build #2955eba] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 117 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 2955eba4be3aab4dc82029bca8daa20aada24c1e [PR build]

@rolfbjarne rolfbjarne merged commit 14ce746 into main Jan 22, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants