diff --git a/build.ps1 b/build.ps1 index e99cb9ae9288..dcb68bcfd4a8 100644 --- a/build.ps1 +++ b/build.ps1 @@ -9,7 +9,11 @@ Param( ) # Restore Cake tool -& dotnet tool restore +#& dotnet tool restore +$tools = Get-Content ".config/dotnet-tools.json" | ConvertFrom-Json +foreach ($tool in $tools.tools.PsObject.Properties) { + & dotnet tool install $tool.Name --version $tool.Value.version +} # Build Cake arguments $cakeArguments = @("$Script"); diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8e3bc57f6dae..9e5297dc2aca 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -12,21 +12,21 @@ https://github.com/xamarin/xamarin-android 735e895bce788c158c67d7322a3873af217832c9 - + https://github.com/xamarin/xamarin-macios - d6a0ca010e0031e7c6ed2519fae849494a48eebb + b7bc60291d5a4055730b8fb3ddf20167c97e6108 - + https://github.com/xamarin/xamarin-macios - d6a0ca010e0031e7c6ed2519fae849494a48eebb + b7bc60291d5a4055730b8fb3ddf20167c97e6108 - + https://github.com/xamarin/xamarin-macios - d6a0ca010e0031e7c6ed2519fae849494a48eebb + b7bc60291d5a4055730b8fb3ddf20167c97e6108 - + https://github.com/xamarin/xamarin-macios - d6a0ca010e0031e7c6ed2519fae849494a48eebb + b7bc60291d5a4055730b8fb3ddf20167c97e6108 https://github.com/dotnet/emsdk diff --git a/eng/Versions.props b/eng/Versions.props index 5a1bf589b8be..149baf450767 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 7.0.96 + 7.0.100 8.0.100-rc.2.23502.2 @@ -25,10 +25,10 @@ 34.0.0-rc.2.479 - 17.0.8465-net8-rc2.1 - 14.0.8465-net8-rc2.1 - 17.0.8465-net8-rc2.1 - 17.0.8465-net8-rc2.1 + 17.0.8477-net8-rc2.2 + 14.0.8477-net8-rc2.2 + 17.0.8477-net8-rc2.2 + 17.0.8477-net8-rc2.2 7.0.125 diff --git a/eng/pipelines/common/ui-tests-steps.yml b/eng/pipelines/common/ui-tests-steps.yml index 27ba2ab1ea1e..17f17b9f895e 100644 --- a/eng/pipelines/common/ui-tests-steps.yml +++ b/eng/pipelines/common/ui-tests-steps.yml @@ -55,9 +55,6 @@ steps: DOTNET_TOKEN: $(dotnetbuilds-internal-container-read-token) PRIVATE_BUILD: $(PrivateBuild) - - pwsh: echo "##vso[task.prependpath]$(DotNet.Dir)" - displayName: 'Add .NET to PATH' - - pwsh: ./build.ps1 --target=dotnet-buildtasks --configuration="${{ parameters.configuration }}" displayName: 'Build the MSBuild Tasks' diff --git a/eng/pipelines/common/variables.yml b/eng/pipelines/common/variables.yml index 04c639acb5aa..2776ada6f938 100644 --- a/eng/pipelines/common/variables.yml +++ b/eng/pipelines/common/variables.yml @@ -59,10 +59,10 @@ variables: value: false - group: Xamarin-Secrets # Variable groups required for private builds -# - ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}: -# - name: PrivateBuild -# value: true -# # For eng/common/SetupNugetSources.ps1 -# - group: DotNetBuilds storage account read tokens -# - group: AzureDevOps-Artifact-Feeds-Pats +- ${{ if or(eq(variables['System.TeamProject'], 'DevDiv'), eq(variables['Build.DefinitionName'], 'dotnet-maui')) }}: + - name: PrivateBuild + value: true + # For eng/common/SetupNugetSources.ps1 + - group: DotNetBuilds storage account read tokens + - group: AzureDevOps-Artifact-Feeds-Pats diff --git a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj index a6e8a8737a01..802f11b97c5a 100644 --- a/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj +++ b/src/Compatibility/ControlGallery/src/iOS/Compatibility.ControlGallery.iOS.csproj @@ -10,6 +10,8 @@ 0612 + 11.0 + 11.0 diff --git a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs index edc2f9b6f357..9b553088eaa5 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/FrameRenderer.cs @@ -58,7 +58,11 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { + +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility + // Make sure the control adheres to changes in UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) SetupLayer(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs index 4e524f6ba5cd..9d308d8551e2 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/ListViewRenderer.cs @@ -357,7 +357,10 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility + // Make sure the cells adhere to changes UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) ReloadData(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs index 4bd973d70b57..0cdda856fdb7 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/NavigationRenderer.cs @@ -370,7 +370,10 @@ protected virtual async Task OnPushAsync(Page page, bool animated) public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility + // Make sure the control adheres to changes in UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) UpdateBackgroundColor(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs index 51b4772ce0bb..ff020b55bfbb 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/PageRenderer.cs @@ -321,7 +321,9 @@ public override UIKit.UIStatusBarAnimation PreferredStatusBarUpdateAnimation public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility if (Forms.IsiOS13OrNewer && previousTraitCollection.UserInterfaceStyle != TraitCollection.UserInterfaceStyle && diff --git a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs index baf56b48adf6..b69d6d6573e6 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/SearchBarRenderer.cs @@ -197,7 +197,9 @@ public override CoreGraphics.CGSize SizeThatFits(CoreGraphics.CGSize size) public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the control adheres to changes in UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) UpdateTextColor(); diff --git a/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs b/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs index 324f0beb162e..3e6f5d324487 100644 --- a/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/Renderers/TableViewRenderer.cs @@ -139,7 +139,9 @@ protected override void UpdateNativeWidget() public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the cells adhere to changes UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) Control.ReloadData(); diff --git a/src/Compatibility/Core/src/iOS/ViewRenderer.cs b/src/Compatibility/Core/src/iOS/ViewRenderer.cs index 8a18440f9302..bdc1da1854a7 100644 --- a/src/Compatibility/Core/src/iOS/ViewRenderer.cs +++ b/src/Compatibility/Core/src/iOS/ViewRenderer.cs @@ -255,7 +255,9 @@ protected void SetNativeControl(TNativeView uiview) #if __MOBILE__ public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the control adheres to changes in UI theme if (Forms.IsiOS13OrNewer && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) Control?.SetNeedsDisplay(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ListViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ListViewRenderer.cs index e8b7e0f6bee8..68b58082f0a7 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ListViewRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/ListView/iOS/ListViewRenderer.cs @@ -302,7 +302,9 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the cells adhere to changes UI theme if (OperatingSystem.IsIOSVersionAtLeast(13) && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) ReloadData(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs index 08971849f1c4..f5198d5a2c5e 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/NavigationPage/iOS/NavigationRenderer.cs @@ -345,7 +345,9 @@ protected virtual async Task OnPushAsync(Page page, bool animated) public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the control adheres to changes in UI theme if (OperatingSystem.IsIOSVersionAtLeast(13) && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) UpdateBackgroundColor(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs index c5dd02937eef..8468cf0f16d6 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/Shell/iOS/ShellSectionRootRenderer.cs @@ -143,7 +143,9 @@ public override void ViewSafeAreaInsetsDidChange() public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility var application = _shellContext?.Shell?.FindMauiContext().Services.GetService(); application?.ThemeChanged(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/TableView/iOS/TableViewRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/TableView/iOS/TableViewRenderer.cs index 4f1fe044e0cc..b859af8cd439 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/TableView/iOS/TableViewRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/TableView/iOS/TableViewRenderer.cs @@ -122,7 +122,9 @@ protected override void UpdateNativeWidget() public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the cells adhere to changes UI theme if (OperatingSystem.IsIOSVersionAtLeast(13) && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) Control.ReloadData(); diff --git a/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs b/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs index da4a06268787..f4c3126d43e8 100644 --- a/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs +++ b/src/Controls/src/Core/Compatibility/Handlers/iOS/FrameRenderer.cs @@ -73,7 +73,9 @@ protected override void OnElementPropertyChanged(object sender, PropertyChangedE public override void TraitCollectionDidChange(UITraitCollection previousTraitCollection) { +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility // Make sure the control adheres to changes in UI theme if (OperatingSystem.IsIOSVersionAtLeast(13) && previousTraitCollection?.UserInterfaceStyle != TraitCollection.UserInterfaceStyle) SetupLayer(); diff --git a/src/Core/src/Platform/iOS/ApplicationExtensions.cs b/src/Core/src/Platform/iOS/ApplicationExtensions.cs index e69844edb423..a65a9ac2dea4 100644 --- a/src/Core/src/Platform/iOS/ApplicationExtensions.cs +++ b/src/Core/src/Platform/iOS/ApplicationExtensions.cs @@ -23,11 +23,21 @@ public static void RequestNewWindow(this IUIApplicationDelegate platformApplicat var state = args?.State; var userActivity = state.ToUserActivity(MauiUIApplicationDelegate.MauiSceneConfigurationKey); - UIApplication.SharedApplication.RequestSceneSessionActivation( - null, - userActivity, - null, - err => application.Handler?.MauiContext?.CreateLogger()?.LogError(new NSErrorException(err), err.Description)); + Action errorAction = err => application.Handler?.MauiContext?.CreateLogger()?.LogError(new NSErrorException(err), err.Description); + if (OperatingSystem.IsIOSVersionAtLeast(17)) + { + var request = UISceneSessionActivationRequest.Create(); + request.UserActivity = userActivity; + UIApplication.SharedApplication.ActivateSceneSession(request, errorAction); + } + else if(OperatingSystem.IsIOSVersionAtLeast(13) || OperatingSystem.IsMacCatalystVersionAtLeast(13, 1)) + { + UIApplication.SharedApplication.RequestSceneSessionActivation( + null, + userActivity, + null, + errorAction); + } } public static void CreatePlatformWindow(this IUIApplicationDelegate platformApplication, IApplication application, UIApplication uiApplication, NSDictionary launchOptions) diff --git a/src/Core/src/Platform/iOS/PageViewController.cs b/src/Core/src/Platform/iOS/PageViewController.cs index 3dc462be05f4..b87255cce3e3 100644 --- a/src/Core/src/Platform/iOS/PageViewController.cs +++ b/src/Core/src/Platform/iOS/PageViewController.cs @@ -31,7 +31,9 @@ public override void TraitCollectionDidChange(UITraitCollection? previousTraitCo application?.ThemeChanged(); } +#pragma warning disable CA1422 // Validate platform compatibility base.TraitCollectionDidChange(previousTraitCollection); +#pragma warning restore CA1422 // Validate platform compatibility } } } \ No newline at end of file diff --git a/src/Essentials/src/Screenshot/Screenshot.ios.cs b/src/Essentials/src/Screenshot/Screenshot.ios.cs index 9c2dfd22758c..abc967cd18ac 100644 --- a/src/Essentials/src/Screenshot/Screenshot.ios.cs +++ b/src/Essentials/src/Screenshot/Screenshot.ios.cs @@ -183,9 +183,9 @@ Task PlatformOpenReadAsync(ScreenshotFormat format, int quality) _ => throw new ArgumentOutOfRangeException(nameof(format)) }; - var result = data.AsStream(); + ArgumentNullException.ThrowIfNull(data); - return Task.FromResult(result); + return Task.FromResult(data.AsStream()); } Task PlatformCopyToAsync(Stream destination, ScreenshotFormat format, int quality) @@ -197,6 +197,8 @@ Task PlatformCopyToAsync(Stream destination, ScreenshotFormat format, int qualit _ => throw new ArgumentOutOfRangeException(nameof(format)) }; + ArgumentNullException.ThrowIfNull(data); + using var result = data.AsStream(); result.CopyTo(destination); diff --git a/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs b/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs index 568c3a29dcd0..20b209c26190 100644 --- a/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs +++ b/src/TestUtils/src/DeviceTests/AssertionExtensions.iOS.cs @@ -89,6 +89,9 @@ public static string CreateScreenshotError(this UIImage bitmap, string message) public static string ToBase64String(this UIImage bitmap) { var data = bitmap.AsPNG(); + + ArgumentNullException.ThrowIfNull(data); + return data.GetBase64EncodedString(NSDataBase64EncodingOptions.None); }