[release/6.0.3xx] [msbuild] Copy partial app manifests to build server if they exists on Windows. Fixes #15267. (#15460)

The exclusion of partial app manifests happened here, but the commit doesn't explain why:

f4a4b232f8 (diff-178de6110858688b9f7c2e8e57a873f5ac9498b355a456bfc18547ab2df876bc)

It's certainly wrong if the partial app manifest is a part of the project, but
this exclusion might be because partial app manifests might be added as a part
of the build as well.

So change the logic to copy partial app manifests from Windows if they exist
there and they're not empty.

Fixes https://github.com/xamarin/xamarin-macios/issues/15267.

Backport of #15328

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
This commit is contained in:
VS MobileTools Engineering Service 2 2022-07-14 09:14:14 -07:00 коммит произвёл GitHub
Родитель 5889016a5b
Коммит 2ae5dc63b5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Build.Framework;
using Xamarin.Messaging.Build.Client;
@ -19,9 +20,12 @@ namespace Xamarin.iOS.Tasks
public bool ShouldCopyToBuildServer (ITaskItem item)
{
// We don't want to copy partial generated manifest files
if (PartialAppManifests is not null && PartialAppManifests.Contains (item))
return false;
// We don't want to copy partial generated manifest files unless they exist and have a non-zero length
if (PartialAppManifests is not null && PartialAppManifests.Contains (item)) {
var finfo = new FileInfo (item.ItemSpec);
if (!finfo.Exists || finfo.Length == 0)
return false;
}
return true;
}