-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into xcode13.0-quicklookui-b1
- Loading branch information
Showing
58 changed files
with
1,272 additions
and
508 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
msbuild/Xamarin.MacDev.Tasks.Core/Tasks/GetFileSystemEntriesTaskBase.cs
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
|
||
using Microsoft.Build.Framework; | ||
using Microsoft.Build.Utilities; | ||
|
||
namespace Xamarin.MacDev.Tasks | ||
{ | ||
public abstract class GetFileSystemEntriesTaskBase : XamarinTask | ||
{ | ||
#region Inputs | ||
|
||
[Required] | ||
public string DirectoryPath { get; set; } | ||
|
||
[Required] | ||
public string Pattern { get; set; } | ||
|
||
[Required] | ||
public bool Recursive { get; set; } | ||
#endregion | ||
|
||
#region Outputs | ||
|
||
[Output] | ||
public ITaskItem[] Entries { get; set; } | ||
|
||
#endregion | ||
|
||
public override bool Execute () | ||
{ | ||
var searchOption = Recursive ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly; | ||
var entriesFullPath = Directory.GetFileSystemEntries (DirectoryPath, Pattern, searchOption); | ||
|
||
Entries = entriesFullPath.Select (v => new TaskItem (v)).ToArray (); | ||
|
||
return !Log.HasLoggedErrors; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
msbuild/Xamarin.MacDev.Tasks/Tasks/GetFileSystemEntries.cs
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using Microsoft.Build.Framework; | ||
using Xamarin.Messaging.Build.Client; | ||
|
||
namespace Xamarin.MacDev.Tasks | ||
{ | ||
public class GetFileSystemEntries : GetFileSystemEntriesTaskBase, ICancelableTask | ||
{ | ||
public override bool Execute () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result; | ||
|
||
return base.Execute (); | ||
} | ||
|
||
public void Cancel () | ||
{ | ||
if (ShouldExecuteRemotely ()) | ||
BuildConnection.CancelAsync (SessionId, BuildEngine4).Wait (); | ||
} | ||
} | ||
} | ||
|
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
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
Oops, something went wrong.