-
Notifications
You must be signed in to change notification settings - Fork 515
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[msbuild] Port the ALToolUpload and ALToolValidate tasks to subclass …
…XamarinTask. This has a few advantages: * We simplify and unify more of our code. * We have more control over the error reporting / logging behavior. Additionally: * Use 'xcrun' to invoke 'altool' (partial fix for #3931). * Allow for overriding the path to the command-line tool in question. * Add support for cancellation. * Fix nullability.
- Loading branch information
1 parent
377f0f0
commit 2c1e027
Showing
5 changed files
with
64 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
using Microsoft.Build.Framework; | ||
using Xamarin.Messaging.Build.Client; | ||
#nullable enable | ||
|
||
namespace Xamarin.MacDev.Tasks { | ||
public class ALToolUpload : ALToolTaskBase, ICancelableTask { | ||
public class ALToolUpload : ALToolTaskBase { | ||
protected override string ALToolAction => "--upload-app"; | ||
|
||
public override bool Execute () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result; | ||
|
||
return base.Execute (); | ||
} | ||
|
||
public override void Cancel () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
BuildConnection.CancelAsync (BuildEngine4).Wait (); | ||
|
||
base.Cancel (); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,7 @@ | ||
using Microsoft.Build.Framework; | ||
using Xamarin.Messaging.Build.Client; | ||
#nullable enable | ||
|
||
namespace Xamarin.MacDev.Tasks { | ||
public class ALToolValidate : ALToolTaskBase, ICancelableTask { | ||
public class ALToolValidate : ALToolTaskBase { | ||
protected override string ALToolAction => "--validate-app"; | ||
|
||
public override bool Execute () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result; | ||
|
||
return base.Execute (); | ||
} | ||
|
||
public override void Cancel () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
BuildConnection.CancelAsync (BuildEngine4).Wait (); | ||
|
||
base.Cancel (); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters