- Notifications
You must be signed in to change notification settings - Fork564
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ty patternsCo-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/CheckForInvalidResourceFileNames.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/CollectJarContentFilesForArchive.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/CollectNativeFilesForArchive.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateAdditionalProviderSources.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateCompressedAssembliesNativeSourceFiles.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaCallableWrappers.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
…ionsCo-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Fixed in commitd8dd047. 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 OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/GenerateNativeApplicationConfigSources.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/ReadImportedLibrariesCache.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Xamarin.Android.Build.Tasks/Tasks/ReadLibraryProjectImportsCache.cs OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
…filesCo-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
868acb2 intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
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! Clickhere to start the survey.