Skip to content
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

[msbuild] Make the IBTool task nullable. #20550

Merged
merged 2 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/IBTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
using Xamarin.Messaging.Build.Client;
using Xamarin.Utils;

// Disable until we get around to enable + fix any issues.
#nullable disable

namespace Xamarin.MacDev.Tasks {
public class IBTool : XcodeCompilerToolTask, ICancelableTask {
static readonly string [] WatchAppExtensions = { "-glance.plist", "-notification.plist" };
Expand All @@ -22,14 +19,14 @@ public class IBTool : XcodeCompilerToolTask, ICancelableTask {
public bool EnableOnDemandResources { get; set; }

[Required]
public ITaskItem [] InterfaceDefinitions { get; set; }
public ITaskItem [] InterfaceDefinitions { get; set; } = Array.Empty<ITaskItem> ();

public bool IsWatchApp { get; set; }
public bool IsWatch2App { get; set; }

public bool IsAppExtension { get; set; }

public string SdkRoot { get; set; }
public string SdkRoot { get; set; } = string.Empty;

#endregion

Expand All @@ -55,7 +52,7 @@ protected bool CanLinkStoryboards {
get { return AppleSdkSettings.XcodeVersion.Major > 7 || (AppleSdkSettings.XcodeVersion.Major == 7 && AppleSdkSettings.XcodeVersion.Minor >= 2); }
}

protected override void AppendCommandLineArguments (IDictionary<string, string> environment, CommandLineArgumentBuilder args, ITaskItem [] items)
protected override void AppendCommandLineArguments (IDictionary<string, string?> environment, CommandLineArgumentBuilder args, ITaskItem [] items)
{
environment.Add ("IBSC_MINIMUM_COMPATIBILITY_VERSION", MinimumOSVersion);
environment.Add ("IBC_MINIMUM_COMPATIBILITY_VERSION", MinimumOSVersion);
Expand Down Expand Up @@ -242,7 +239,7 @@ bool CompileInterfaceDefinitions (string baseManifestDir, string baseOutputDir,
}

try {
var dict = PDictionary.FromFile (manifest.ItemSpec);
var dict = PDictionary.FromFile (manifest.ItemSpec)!;

LogWarningsAndErrors (dict, item);
} catch (Exception ex) {
Expand Down
Loading