From 44049ac0e69262ee7238781e1dfc4ac30db3b713 Mon Sep 17 00:00:00 2001 From: Emanuel Fernandez Dell'Oca Date: Fri, 20 Aug 2021 18:25:11 -0300 Subject: [PATCH 1/3] [net6] Bumps Xamarin Hot Restart to 1.0.70 This version contains fixes for building Maui projects with Hot Restart --- msbuild/Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/msbuild/Directory.Build.props b/msbuild/Directory.Build.props index 7c25c4db49a7..93a0e7c97cca 100644 --- a/msbuild/Directory.Build.props +++ b/msbuild/Directory.Build.props @@ -1,6 +1,6 @@ 1.3.27 - 1.0.69 + 1.0.70 From e88f5f75b07886c797a30f4b30024a17e64674ce Mon Sep 17 00:00:00 2001 From: Emanuel Fernandez Dell'Oca Date: Fri, 20 Aug 2021 18:34:40 -0300 Subject: [PATCH 2/3] [msbuild] Fixes Hot Restart Entitlements.plist compilation The build was failing if `CodesignEntitlements` was not set, even though the CompileEntitlements task has a default value. That default value is not compatible with Hot Restart because it is a template file that exists on the Mac (and Hot Restart is an offline build from Windows). So if that property is not set we get the xcent file from the Hot Restart PreBuilt app bundle, which is essentially an empty plist. --- .../Xamarin.iOS.HotRestart.targets | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets index 866a0cf8e5a8..564642e2b2b8 100644 --- a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets +++ b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets @@ -184,11 +184,16 @@ Inputs="$(CodesignEntitlements);$(_ProvisioningProfilePath);$(HotRestartAppBundlePath)\Extracted" Outputs="$(HotRestartSignedAppDir)archived-expanded-entitlements.xcent;$(HotRestartSignedAppDir)Extracted"> + + <_HotRestartEntitlementsFile>$(CodesignEntitlements) + <_HotRestartEntitlementsFile Condition="'$(_HotRestartEntitlementsFile)'== ''">$(HotRestartAppBundlePath)\archived-expanded-entitlements.xcent + + Date: Fri, 20 Aug 2021 18:49:58 -0300 Subject: [PATCH 3/3] [net6] Makes Hot Restart consider Single Project app title On a Maui Single Project the app title can be set on the project file using the `ApplicationTitle` property. If that's set Hot Restart should include that value in the compiled app manifest, so the app name is shown on the device when the app is deployed. --- .../Xamarin.iOS.Tasks.Windows/Tasks/CompileAppManifest.cs | 6 ++++++ .../Xamarin.iOS.HotRestart.targets | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/msbuild/Xamarin.iOS.Tasks.Windows/Tasks/CompileAppManifest.cs b/msbuild/Xamarin.iOS.Tasks.Windows/Tasks/CompileAppManifest.cs index 967b5a6ae0d8..ac2901d578cd 100644 --- a/msbuild/Xamarin.iOS.Tasks.Windows/Tasks/CompileAppManifest.cs +++ b/msbuild/Xamarin.iOS.Tasks.Windows/Tasks/CompileAppManifest.cs @@ -31,6 +31,8 @@ public class CompileAppManifest : Task [Required] public string AppManifestPath { get; set; } + public string ApplicationTitle { get; set; } + #endregion public override bool Execute() @@ -60,6 +62,10 @@ public override bool Execute() } } + if (!string.IsNullOrEmpty (ApplicationTitle)) { + preBuiltInfoPlist[ManifestKeys.CFBundleDisplayName] = ApplicationTitle; + } + preBuiltInfoPlist.Save(preBuiltInfoPlistPath, binary: true); return true; diff --git a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets index 564642e2b2b8..5c82505fdbd4 100644 --- a/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets +++ b/msbuild/Xamarin.iOS.Tasks.Windows/Xamarin.iOS.HotRestart.targets @@ -176,7 +176,8 @@ + AppManifestPath="$(_AppManifest)" + ApplicationTitle="$(ApplicationTitle)"/>