Skip to content

[XABT] Fix build errors caused by enabling nullable checks in the tasks #10110

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

grendello
Copy link
Contributor

@grendello grendello commented May 6, 2025

Context: #10099
Context: #9918

#10099 enabled NRT checks for a number of XABT Tasks and was merged because all the tests passed. However, #10099 was not rebased on the tip of main which, in the meantime, contained code from the recently merged #9918 PR. #9918 introduced a couple of string properties to the AndroidComputeResPaths and CreateAar tasks, which were not nullable annotated.

This resulted in the following build errors once #10099 was merged:

src/Xamarin.Android.Build.Tasks/Tasks/AndroidComputeResPaths.cs(52,17): error CS8618: Non-nullable property 'PrefixProperty' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

src/Xamarin.Android.Build.Tasks/Tasks/CreateAar.cs(37,17): error CS8618: Non-nullable property 'PrefixProperty' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.

This PR makes the PrefixProperty properties [Required] (because of the way they are used in the tasks) and assigns default values to them, as per convention introduced in #10099

@grendello grendello requested a review from jonathanpeppers as a code owner May 6, 2025 06:50
@grendello grendello requested a review from jpobst May 6, 2025 06:50
Copy link
Member

@jonathanpeppers jonathanpeppers left a comment

Choose a reason for hiding this comment

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

Merging to fix our build, don't think we need to rerun the test lanes.

@jonathanpeppers jonathanpeppers merged commit 1453dfe into main May 6, 2025
55 of 59 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/grendel/nrt-fix branch May 6, 2025 13:15
@jpobst
Copy link
Contributor

jpobst commented May 6, 2025

Thanks for getting this fixed!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants