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] Merge the ValidateAppBundle[TaskBase] classes. #19907

Merged
merged 2 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
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
20 changes: 0 additions & 20 deletions msbuild/Xamarin.iOS.Tasks/Tasks/ValidateAppBundleTask.cs

This file was deleted.

12 changes: 11 additions & 1 deletion msbuild/Xamarin.iOS.Tasks/Tasks/ValidateAppBundleTaskBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
using Xamarin.MacDev;
using Xamarin.MacDev.Tasks;
using Xamarin.Utils;
using Xamarin.Messaging.Build.Client;
using Xamarin.Localization.MSBuild;

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

namespace Xamarin.iOS.Tasks {
public abstract class ValidateAppBundleTaskBase : XamarinTask {
public class ValidateAppBundleTask : XamarinTask, ICancelableTask {
#region Inputs

[Required]
Expand Down Expand Up @@ -287,6 +288,9 @@ void ValidateWatchExtension (string path, string watchAppBundleIdentifier, strin

public override bool Execute ()
{
if (ShouldExecuteRemotely ())
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;

var mainInfoPath = PlatformFrameworkHelper.GetAppManifestPath (Platform, AppBundlePath);
if (!File.Exists (mainInfoPath)) {
Log.LogError (7040, AppBundlePath, MSBStrings.E7040, AppBundlePath);
Expand Down Expand Up @@ -377,5 +381,11 @@ public override bool Execute ()

return !Log.HasLoggedErrors;
}

public void Cancel ()
{
if (ShouldExecuteRemotely ())
BuildConnection.CancelAsync (BuildEngine4).Wait ();
}
}
}