-
Notifications
You must be signed in to change notification settings - Fork 564
Fix NRT annotations in MSBuild Tasks #10298
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
Conversation
…ty patterns Co-authored-by: jonathanpeppers <[email protected]>
Co-authored-by: jonathanpeppers <[email protected]>
jonathanpeppers
left a comment
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.
Remove any empty lines you put before #nullable enable. I don't want to check them all, but you go check them, please.
src/Xamarin.Android.Build.Tasks/Tasks/CheckForInvalidResourceFileNames.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/CollectJarContentFilesForArchive.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/CollectNativeFilesForArchive.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/GenerateAdditionalProviderSources.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/GenerateCompressedAssembliesNativeSourceFiles.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaCallableWrappers.cs
Outdated
Show resolved
Hide resolved
…ions Co-authored-by: jonathanpeppers <[email protected]>
Fixed in commit d8dd047. Removed all empty lines before #nullable enable in 61 MSBuild task files and updated copilot-instructions.md to prevent future occurrences. |
src/Xamarin.Android.Build.Tasks/Tasks/GenerateManagedAidlProxies.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeApplicationConfigSources.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/GenerateResourceCaseMap.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/ReadImportedLibrariesCache.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/ReadLibraryProjectImportsCache.cs
Outdated
Show resolved
Hide resolved
src/Xamarin.Android.Build.Tasks/Tasks/RemoveRegisterAttribute.cs
Outdated
Show resolved
Hide resolved
…files Co-authored-by: jonathanpeppers <[email protected]>
This PR addresses nullable reference type (NRT) annotations in MSBuild task classes according to the repository's nullable reference types guidelines in
copilot-instructions.md.Changes Made
✅ Added
#nullable enableto 84 MSBuild task files#nullable enableheader to previously unannotated task files✅ Fixed string pattern usage across all files
.IsNullOrEmpty()extension method instead ofstring.IsNullOrEmpty()✅ Verified property patterns follow repository guidelines
Many files already follow or were updated to follow the correct patterns:
Required properties with default values:
Non-required properties as nullable:
Output properties as nullable:
Files Not Modified
8 complex files with
#nullable disablewere left unchanged due to extensive nullable scenarios involving:These files require individual attention and significant refactoring:
Aapt2.cs,Aapt2Link.csCalculateLayoutCodeBehind.csGenerateJavaStubs.csGenerateLayoutBindings.*.csGenerateResourceDesigner*.csTesting
This work significantly improves nullable reference type adoption across the MSBuild tasks codebase, enabling better null safety and compiler assistance for future development.
Fixes #10277.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.