Skip to content
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
8 changes: 8 additions & 0 deletions msbuild/Xamarin.Localization.MSBuild/MSBStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1621,4 +1621,12 @@
{2} and {3}: the different LogicalName metadata
</comment>
</data>

<data name="M7159" xml:space="preserve">
<value>Skipping {0} - {1} is empty.</value>
<comment>
{0}: the name of the MSBuild task that's being skipped (Copy, GetFullPaths, FilterStaticFrameworks, etc.).
{1}: the name of the property that is empty (SourceFiles, Items, FrameworkToPublish, etc.).
</comment>
</data>
</root>
8 changes: 6 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/MsBuildTasks/Copy.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
extern alias Microsoft_Build_Tasks_Core;

using System;
using System.IO;
using System.Linq;

using Microsoft.Build.Framework;

using Xamarin.Localization.MSBuild;
using Xamarin.Messaging.Build.Client;

namespace Microsoft.Build.Tasks {
public class Copy : Microsoft_Build_Tasks_Core::Microsoft.Build.Tasks.Copy {
public string SessionId { get; set; } = string.Empty;
public override bool Execute ()
{
if (SourceFiles?.Any () != true) {
Log.LogMessage (MessageImportance.Low, MSBStrings.M7159 /* Skipping {0} - {1} is empty. */, nameof (Copy), nameof (SourceFiles));
return true;
}

if (!this.ShouldExecuteRemotely (SessionId))
return base.Execute ();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public class FilterStaticFrameworks : XamarinTask, ITaskCallback {

public override bool Execute ()
{
if (FrameworkToPublish?.Any () != true) {
Log.LogMessage (MessageImportance.Low, MSBStrings.M7159 /* Skipping {0} - {1} is empty. */, nameof (FilterStaticFrameworks), nameof (FrameworkToPublish));
return true;
}

if (ShouldExecuteRemotely ())
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;

Expand Down
5 changes: 5 additions & 0 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/GetFileSystemEntries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public class GetFileSystemEntries : XamarinTask, ICancelableTask, ITaskCallback

public override bool Execute ()
{
if (DirectoryPath?.Any () != true) {
Log.LogMessage (MessageImportance.Low, MSBStrings.M7159 /* Skipping {0} - {1} is empty. */, nameof (GetFileSystemEntries), nameof (DirectoryPath));
return true;
}

if (ShouldExecuteRemotely ())
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;

Expand Down
7 changes: 6 additions & 1 deletion msbuild/Xamarin.MacDev.Tasks/Tasks/GetFullPaths.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;

using Xamarin.MacDev.Tasks;
using Xamarin.Localization.MSBuild;
using Xamarin.Messaging.Build.Client;

#nullable enable
Expand All @@ -23,6 +23,11 @@ public class GetFullPaths : XamarinTask, ICancelableTask, ITaskCallback {

public override bool Execute ()
{
if (Items?.Any () != true) {
Log.LogMessage (MessageImportance.Low, MSBStrings.M7159 /* Skipping {0} - {1} is empty. */, nameof (GetFullPaths), nameof (Items));
return true;
}

if (ShouldExecuteRemotely ())
return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result;

Expand Down