Fixes Hot Restart build issues (#12500)
* [net6] Bumps Xamarin Hot Restart to 1.0.70 This version contains fixes for building Maui projects with Hot Restart * [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. * [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. Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com> Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
This commit is contained in:
Родитель
bbb21180e2
Коммит
fbbaa7fca3
|
@ -1,6 +1,6 @@
|
||||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<MessagingVersion>1.3.27</MessagingVersion>
|
<MessagingVersion>1.3.27</MessagingVersion>
|
||||||
<HotRestartVersion>1.0.69</HotRestartVersion>
|
<HotRestartVersion>1.0.70</HotRestartVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -31,6 +31,8 @@ namespace Xamarin.iOS.HotRestart.Tasks
|
||||||
[Required]
|
[Required]
|
||||||
public string AppManifestPath { get; set; }
|
public string AppManifestPath { get; set; }
|
||||||
|
|
||||||
|
public string ApplicationTitle { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public override bool Execute()
|
public override bool Execute()
|
||||||
|
@ -60,6 +62,10 @@ namespace Xamarin.iOS.HotRestart.Tasks
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty (ApplicationTitle)) {
|
||||||
|
preBuiltInfoPlist[ManifestKeys.CFBundleDisplayName] = ApplicationTitle;
|
||||||
|
}
|
||||||
|
|
||||||
preBuiltInfoPlist.Save(preBuiltInfoPlistPath, binary: true);
|
preBuiltInfoPlist.Save(preBuiltInfoPlistPath, binary: true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -176,7 +176,8 @@
|
||||||
|
|
||||||
<HotRestart.Tasks.CompileAppManifest
|
<HotRestart.Tasks.CompileAppManifest
|
||||||
AppBundlePath="$(HotRestartAppBundlePath)"
|
AppBundlePath="$(HotRestartAppBundlePath)"
|
||||||
AppManifestPath="$(_AppManifest)" />
|
AppManifestPath="$(_AppManifest)"
|
||||||
|
ApplicationTitle="$(ApplicationTitle)"/>
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="_CompileHotRestartEntitlements"
|
<Target Name="_CompileHotRestartEntitlements"
|
||||||
|
@ -184,11 +185,16 @@
|
||||||
Inputs="$(CodesignEntitlements);$(_ProvisioningProfilePath);$(HotRestartAppBundlePath)\Extracted"
|
Inputs="$(CodesignEntitlements);$(_ProvisioningProfilePath);$(HotRestartAppBundlePath)\Extracted"
|
||||||
Outputs="$(HotRestartSignedAppDir)archived-expanded-entitlements.xcent;$(HotRestartSignedAppDir)Extracted">
|
Outputs="$(HotRestartSignedAppDir)archived-expanded-entitlements.xcent;$(HotRestartSignedAppDir)Extracted">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<_HotRestartEntitlementsFile>$(CodesignEntitlements)</_HotRestartEntitlementsFile>
|
||||||
|
<_HotRestartEntitlementsFile Condition="'$(_HotRestartEntitlementsFile)'== ''">$(HotRestartAppBundlePath)\archived-expanded-entitlements.xcent</_HotRestartEntitlementsFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<CompileEntitlements
|
<CompileEntitlements
|
||||||
AppBundleDir="$(HotRestartAppBundlePath)"
|
AppBundleDir="$(HotRestartAppBundlePath)"
|
||||||
AppIdentifier="$(_AppIdentifier)"
|
AppIdentifier="$(_AppIdentifier)"
|
||||||
BundleIdentifier="$(_BundleIdentifier)"
|
BundleIdentifier="$(_BundleIdentifier)"
|
||||||
Entitlements="$(CodesignEntitlements)"
|
Entitlements="$(_HotRestartEntitlementsFile)"
|
||||||
CompiledEntitlements="$(DeviceSpecificIntermediateOutputPath)Entitlements.xcent"
|
CompiledEntitlements="$(DeviceSpecificIntermediateOutputPath)Entitlements.xcent"
|
||||||
IsAppExtension="$(IsAppExtension)"
|
IsAppExtension="$(IsAppExtension)"
|
||||||
ProvisioningProfile="$(_ProvisioningProfileId)"
|
ProvisioningProfile="$(_ProvisioningProfileId)"
|
||||||
|
|
Загрузка…
Ссылка в новой задаче