private static void UpgradeMauiiOS(IProjectPropertyElements projectproperties, IProjectFile file) { MauiUtilties.RuntimePropertyMapper(projectproperties, file, "MtouchArch"); MauiUtilties.TransformProperty(projectproperties, file, "MtouchEnableSGenConc", "EnableSGenConc"); // remove unneeded Properties projectproperties.RemoveProjectProperty("IPhoneResourcePrefix"); }
private static void UpgradeMauiiOS(IProjectPropertyElements projectproperties, IProjectFile file) { MauiUtilties.RuntimePropertyMapper(projectproperties, file, "MtouchArch"); MauiUtilties.TransformProperty(projectproperties, file, "MtouchEnableSGenConc", "EnableSGenConc"); // remove unneeded Properties projectproperties.RemoveProjectProperty("IPhoneResourcePrefix"); projectproperties.RemoveProjectProperty("RuntimeIdentifiers"); projectproperties.RemoveProjectProperty("EnableSGenConc"); projectproperties.RemoveProjectProperty("ProvisioningType"); projectproperties.RemoveProjectProperty("MtouchLink"); projectproperties.RemoveProjectProperty("MtouchDebug"); projectproperties.RemoveProjectProperty("MtouchInterpreter"); }
protected override async Task <UpgradeStepApplyResult> ApplyImplAsync(IUpgradeContext context, CancellationToken token) { if (context is null) { throw new ArgumentNullException(nameof(context)); } var project = context.CurrentProject.Required(); var file = project.GetFile(); var projectproperties = project.GetProjectPropertyElements(); var projectType = await MauiUtilties.GetMauiProjectTypeForProject(project, token).ConfigureAwait(false); switch (projectType) { case MauiProjectType.Maui: { UpgradeMaui(projectproperties, file); break; } case MauiProjectType.MauiAndroid: { UpgradeMauiAndroid(projectproperties, file); break; } case MauiProjectType.MauiiOS: { UpgradeMauiiOS(projectproperties, file); break; } } if (projectproperties.GetProjectPropertyValue("UseMaui")?.FirstOrDefault() is null) { file.SetPropertyValue("UseMaui", "true"); } await file.SaveAsync(token).ConfigureAwait(false); Logger.LogInformation("Added .NET MAUI Project Properties successfully"); return(new UpgradeStepApplyResult(UpgradeStepStatus.Complete, $"Added Project Properties for {projectType.ToString()} to .NET MAUI project ")); }