[msbuild] Copy the entire frameworks to the Mac when building remotely in the ResolveNativeReferences task. Fixes #19173. (#19227)
Fixes https://github.com/xamarin/xamarin-macios/issues/19173.
This commit is contained in:
Родитель
b73cb11dc1
Коммит
fbe5fdd1ea
|
@ -524,6 +524,9 @@ namespace Xamarin.MacDev.Tasks {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied () => Enumerable.Empty<ITaskItem> ();
|
public IEnumerable<ITaskItem> GetAdditionalItemsToBeCopied ()
|
||||||
|
{
|
||||||
|
return CreateItemsForAllFilesRecursively (NativeReferences);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
using Microsoft.Build.Framework;
|
using Microsoft.Build.Framework;
|
||||||
using Microsoft.Build.Tasks;
|
using Microsoft.Build.Tasks;
|
||||||
|
@ -217,5 +219,25 @@ namespace Xamarin.MacDev.Tasks {
|
||||||
foundInMetadata = false;
|
foundInMetadata = false;
|
||||||
return fallbackValue;
|
return fallbackValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IEnumerable<ITaskItem> CreateItemsForAllFilesRecursively (IEnumerable<string>? directories)
|
||||||
|
{
|
||||||
|
if (directories is null)
|
||||||
|
yield break;
|
||||||
|
|
||||||
|
foreach (var dir in directories) {
|
||||||
|
// Don't try to find files if we don't have a directory in the first place (or it doesn't exist).
|
||||||
|
if (!Directory.Exists (dir))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach (var file in Directory.EnumerateFiles (dir, "*", SearchOption.AllDirectories))
|
||||||
|
yield return new TaskItem (file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected IEnumerable<ITaskItem> CreateItemsForAllFilesRecursively (IEnumerable<ITaskItem>? directories)
|
||||||
|
{
|
||||||
|
return CreateItemsForAllFilesRecursively (directories?.Select (v => v.ItemSpec));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче