Skip to content

[msbuild/tools] Add netstandard2.0 helper string functions.#25375

Open
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/netstandard-string-functions
Open

[msbuild/tools] Add netstandard2.0 helper string functions.#25375
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/netstandard-string-functions

Conversation

@rolfbjarne
Copy link
Copy Markdown
Member

  • Add a 'StringUtils.IsNullOrEmpty' with proper nullability attributes, because the netstandard2.0 version doesn't have it.
  • Add a 'string.EndsWith(char)' overload.

* Add a 'StringUtils.IsNullOrEmpty' with proper nullability attributes, because the netstandard2.0 version doesn't have it.
* Add a 'string.EndsWith(char)' overload.
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 PR improves cross-target compatibility for the tooling/MSBuild code by adding small netstandard2.0-friendly string helpers in tools/common, and updating call sites to use them so nullable flow analysis works consistently across target frameworks.

Changes:

  • Added StringUtils.IsNullOrEmpty annotated with [NotNullWhen(false)] to improve nullable flow analysis in netstandard2.0 builds.
  • Added a string.EndsWith(char) extension method for non-NET builds, and simplified a call site to use the char overload.
  • Updated multiple call sites to use StringUtils.IsNullOrEmpty instead of string.IsNullOrEmpty.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/dotnet-linker/LinkerConfiguration.cs Uses StringUtils.IsNullOrEmpty for nullable-friendly optimize-flags handling.
tools/common/StringUtils.cs Introduces IsNullOrEmpty helper and a non-NET EndsWith(char) extension; refactors parsing to use the helper.
tools/common/StaticRegistrar.cs Switches nullable checks on single_assembly to StringUtils.IsNullOrEmpty.
tools/common/Assembly.cs Switches nullable/optional metadata checks to StringUtils.IsNullOrEmpty.
tools/common/Application.cs Switches RuntimeIdentifier check to StringUtils.IsNullOrEmpty; adds an early-return guard in ParseRegistrar.
msbuild/Xamarin.MacDev.Tasks/Tasks/CompileAppManifest.cs Uses StringUtils.IsNullOrEmpty to make minimumOSVersionInManifest nullable flow consistent across TFMs.

Comment thread tools/common/StringUtils.cs
@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.

@rolfbjarne rolfbjarne marked this pull request as ready for review May 15, 2026 06:55
@rolfbjarne rolfbjarne requested a review from mauroa as a code owner May 15, 2026 06:55
@vs-mobiletools-engineering-service2
Copy link
Copy Markdown
Collaborator

✅ [PR Build #4e9bfbe] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 4e9bfbefa07e40212875e895144ba82f330ccca5 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

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

✅ [PR Build #4e9bfbe] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 4e9bfbefa07e40212875e895144ba82f330ccca5 [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: 4e9bfbefa07e40212875e895144ba82f330ccca5 [PR build]

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

✅ [PR Build #4e9bfbe] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 4e9bfbefa07e40212875e895144ba82f330ccca5 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

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

🚀 [CI Build #4e9bfbe] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 175 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 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 16 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 16 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 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

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. [attempt 2] Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 4e9bfbefa07e40212875e895144ba82f330ccca5 [PR build]

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.

3 participants