Skip to content

Commit 1453dfe

Browse files
authoredMay 6, 2025··
[XABT] Fix build errors due to NRT (#10110)
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
1 parent 0fd7d0c commit 1453dfe

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎src/Xamarin.Android.Build.Tasks/Tasks/AndroidComputeResPaths.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public class AndroidComputeResPaths : AndroidTask
4949

5050
public string? Prefixes { get; set; }
5151

52-
public string PrefixProperty { get; set; }
52+
[Required]
53+
public string PrefixProperty { get; set; } = "";
5354

5455
public bool LowercaseFilenames { get; set; }
5556

‎src/Xamarin.Android.Build.Tasks/Tasks/CreateAar.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ public class CreateAar : AndroidTask
3434
[Required]
3535
public string OutputFile { get; set; } = "";
3636

37-
public string PrefixProperty { get; set; }
37+
[Required]
38+
public string PrefixProperty { get; set; } = "";
3839

3940
public override bool RunTask ()
4041
{

0 commit comments

Comments
 (0)
Please sign in to comment.