From 8a46a167922583f761fbb6ff9f0bb12ff536f94f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 14 Jun 2023 17:12:27 +0200 Subject: [PATCH] [msbuild] Copy the zip file back to Windows from the Zip task for remote builds. Fixes #18402. The zip file might be used later directly on Windows (for instance it might be embedded inside a binding assembly as an embedded resource), so make sure to copy it back to Windows. Fixes https://github.com/xamarin/xamarin-macios/issues/18402 part 2. --- msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs b/msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs index ce9668066b1a..74ea3761243e 100644 --- a/msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs +++ b/msbuild/Xamarin.MacDev.Tasks/Tasks/Zip.cs @@ -7,8 +7,16 @@ namespace Xamarin.MacDev.Tasks { public class Zip : ZipTaskBase, ITaskCallback { public override bool Execute () { - if (ShouldExecuteRemotely ()) - return new TaskRunner (SessionId, BuildEngine4).RunAsync (this).Result; + if (ShouldExecuteRemotely ()) { + var taskRunner = new TaskRunner (SessionId, BuildEngine4); + var rv = taskRunner.RunAsync (this).Result; + + // Copy the zipped file back to Windows. + if (rv) + taskRunner.GetFileAsync (this, OutputFile.ItemSpec).Wait (); + + return rv; + } return base.Execute (); }