Skip to content

Commit eea6fea

Browse files
[net8.0] use latest .NET 8 SDK and mobile workloads (#12520)
Changes: dotnet/android@8a20803...c1efcb5 Changes: dotnet/macios@df0151d...6b1b9f3 Changes: dotnet/installer@8c1708f...9962c6a Changes: dotnet/runtime@5108757...5da4a9e Changes: dotnet/emsdk@aecb1c7...66b9845 Updates: * Microsoft.Android.Sdk.Windows: from 34.0.0-preview.1.50 to 34.0.0-preview.1.127 * Microsoft.iOS.Sdk: from 16.1.585-net8-p1 to 16.2.126-net8-p1 * Microsoft.Dotnet.Sdk.Internal: from 8.0.100-alpha.1.22526.2 to 8.0.100-alpha.1.23063.11 * Microsoft.NETCore.App.Ref: from 8.0.0-alpha.1.22524.5 to 8.0.0-alpha.1.23058.2 * Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100: from 8.0.0-alpha.1.22510.1 to 8.0.0-alpha.1.22620.1 ~~ Workloads ~~ The .NET SDK has a workaround for `microsoft.net.workload.mono.toolchain`: dotnet/sdk@f5cb7e3 * HACK: copy folder to `microsoft.net.workload.mono.toolchain.net8` for now until this is resolved. ~~ Android ~~ The biggest changes now in xamarin-android/main are: * Android enums now have appropriate `[SupportedOSPlatform]` attributes. This caused various new warnings in MAUI. Example: src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(16,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. src/Essentials/test/DeviceTests/Tests/Vibration_Tests.cs(34,62): error CA1416: This call site is reachable on: 'Android' 21.0 and later. 'BuildVersionCodes.M' is only supported on: 'android' 23.0 and later. * Android now has a new implementation of `Resource.designer.cs`: dotnet/android@dc3ccf2 We had to make various API changes for a new `Resource` type. Some we we be able to get rid of in the future, after we get: dotnet/android#7721 * Remove IsMarshmallowOrNewer, IsNougatOrNewer It appears the analyzer can't tell these values are using `OperatingSystem.IsAndroidVersionAtLeast()`. It seems we can just use this API directly instead. * Allow `$(AndroidEnableMarshalMethods)` again This has the fix: dotnet/android@22f10b2 Fixes: #11605 ~~ Other changes ~~ * [essentials, compatibility] disable trimming for netstandard * Minor iOS API Changes * Fix CA2200 in test Fixes: src\Controls\tests\Core.UnitTests\ImageButtonUnitTest.cs(215,6): error CA2200: Re-throwing caught exception changes stack information Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
1 parent a4f2d9b commit eea6fea

File tree

45 files changed

+105
-593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+105
-593
lines changed

Directory.Build.props

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,5 @@
161161
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
162162
<!-- Disables the transitive restore of packages like Microsoft.AspNetCore.App.Ref, Microsoft.WindowsDesktop.App.Ref -->
163163
<DisableTransitiveFrameworkReferenceDownloads>true</DisableTransitiveFrameworkReferenceDownloads>
164-
<!-- TODO: temporarily disable this to get past Android build error in Release builds -->
165-
<AndroidEnableMarshalMethods>false</AndroidEnableMarshalMethods>
166164
</PropertyGroup>
167165
</Project>

Directory.Build.targets

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,6 @@
5454
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
5555
</PropertyGroup>
5656

57-
<!--
58-
Comment out this section if you need to update Resource.designer.cs files.
59-
See .github/DEVELOPMENT.md#Android for details.
60-
-->
61-
<PropertyGroup Condition="'$(_MauiTargetPlatformIsAndroid)' == 'True' AND '$(AndroidApplication)' != 'true'">
62-
<AndroidGenerateResourceDesigner>false</AndroidGenerateResourceDesigner>
63-
<AndroidUseIntermediateDesignerFile>false</AndroidUseIntermediateDesignerFile>
64-
</PropertyGroup>
65-
6657
<!-- semi HACK: by default, WinUI includes all @(None) with .bmp/.png as @(Content) and adds that to the .pri -->
6758
<ItemGroup Condition="'$(_MauiTargetPlatformIsWindows)' == 'True'">
6859
<Content Remove="@(None->WithMetadataValue('Pack','true'))" />

eng/Version.Details.xml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
<Dependencies>
22
<ProductDependencies>
3-
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.22526.2" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
3+
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="8.0.100-alpha.1.23063.11" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
44
<Uri>https://github.com/dotnet/installer</Uri>
5-
<Sha>8c1708f37899815bc298ab30e5f2561ec47f1929</Sha>
5+
<Sha>9962c6a686a31ba1e7c20983a810ba7989c3fc0c</Sha>
66
</Dependency>
7-
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.22524.5" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
7+
<Dependency Name="Microsoft.NETCore.App.Ref" Version="8.0.0-alpha.1.23058.2" CoherentParentDependency="Microsoft.Android.Sdk.Windows">
88
<Uri>https://github.com/dotnet/runtime</Uri>
9-
<Sha>5108757b997c59ab8ba1fc5309ab0d4e730e2b77</Sha>
9+
<Sha>5da4a9e919dcee35f831ab69b6e475baaf798875</Sha>
1010
</Dependency>
11-
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="34.0.0-preview.1.50">
11+
<Dependency Name="Microsoft.Android.Sdk.Windows" Version="34.0.0-preview.1.127">
1212
<Uri>https://github.com/xamarin/xamarin-android</Uri>
13-
<Sha>8a2080306210302d5caca50ab9906240282825f4</Sha>
13+
<Sha>c1efcb5678c8d93c4d5bdd0452a79a8ffab2f6b7</Sha>
1414
</Dependency>
15-
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.1.585-net8-p1">
15+
<Dependency Name="Microsoft.MacCatalyst.Sdk" Version="16.2.126-net8-p1">
1616
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
17-
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
17+
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
1818
</Dependency>
19-
<Dependency Name="Microsoft.macOS.Sdk" Version="13.0.1140-net8-p1">
19+
<Dependency Name="Microsoft.macOS.Sdk" Version="13.1.126-net8-p1">
2020
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
21-
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
21+
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
2222
</Dependency>
23-
<Dependency Name="Microsoft.iOS.Sdk" Version="16.1.585-net8-p1">
23+
<Dependency Name="Microsoft.iOS.Sdk" Version="16.2.126-net8-p1">
2424
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
25-
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
25+
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
2626
</Dependency>
27-
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.1.585-net8-p1">
27+
<Dependency Name="Microsoft.tvOS.Sdk" Version="16.1.914-net8-p1">
2828
<Uri>https://github.com/xamarin/xamarin-macios</Uri>
29-
<Sha>df0151d09a23a1630022ad653036d11ce4b396b8</Sha>
29+
<Sha>6b1b9f3666c644af0560770bd02de9d455fdbc4c</Sha>
3030
</Dependency>
31-
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.22510.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
31+
<Dependency Name="Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100" Version="8.0.0-alpha.1.22620.1" CoherentParentDependency="Microsoft.NETCore.App.Ref">
3232
<Uri>https://github.com/dotnet/emsdk</Uri>
33-
<Sha>aecb1c71c70f6db44035602a879c57fa495d37e8</Sha>
33+
<Sha>66b984594a008151bdb14dc60589373e3d44be83</Sha>
3434
</Dependency>
3535
<Dependency Name="Microsoft.WindowsAppSDK" Version="0.0.1">
3636
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/ProjectReunionInternal</Uri>

eng/Versions.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@
33
<!-- Current previous .NET SDK major version's stable release of MAUI packages -->
44
<MicrosoftMauiPreviousDotNetReleasedVersion>6.0.547</MicrosoftMauiPreviousDotNetReleasedVersion>
55
<!-- dotnet/installer -->
6-
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.22526.2</MicrosoftDotnetSdkInternalPackageVersion>
6+
<MicrosoftDotnetSdkInternalPackageVersion>8.0.100-alpha.1.23063.11</MicrosoftDotnetSdkInternalPackageVersion>
77
<!-- dotnet/runtime -->
8-
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.22524.5</MicrosoftNETCoreAppRefPackageVersion>
8+
<MicrosoftNETCoreAppRefPackageVersion>8.0.0-alpha.1.23058.2</MicrosoftNETCoreAppRefPackageVersion>
99
<!-- NOTE: should eventually revert back to $(MicrosoftNETCoreAppRefPackageVersion) in .NET 7 -->
1010
<MicrosoftExtensionsPackageVersion>7.0.0</MicrosoftExtensionsPackageVersion>
1111
<MicrosoftExtensionsServicingPackageVersion>7.0.0</MicrosoftExtensionsServicingPackageVersion>
1212
<SystemCodeDomPackageVersion>7.0.0</SystemCodeDomPackageVersion>
1313
<!-- xamarin/xamarin-android -->
14-
<MicrosoftAndroidSdkWindowsPackageVersion>34.0.0-preview.1.50</MicrosoftAndroidSdkWindowsPackageVersion>
14+
<MicrosoftAndroidSdkWindowsPackageVersion>34.0.0-preview.1.127</MicrosoftAndroidSdkWindowsPackageVersion>
1515
<!-- xamarin/xamarin-macios -->
16-
<MicrosoftMacCatalystSdkPackageVersion>16.1.585-net8-p1</MicrosoftMacCatalystSdkPackageVersion>
17-
<MicrosoftmacOSSdkPackageVersion>13.0.1140-net8-p1</MicrosoftmacOSSdkPackageVersion>
18-
<MicrosoftiOSSdkPackageVersion>16.1.585-net8-p1</MicrosoftiOSSdkPackageVersion>
19-
<MicrosofttvOSSdkPackageVersion>16.1.585-net8-p1</MicrosofttvOSSdkPackageVersion>
16+
<MicrosoftMacCatalystSdkPackageVersion>16.2.126-net8-p1</MicrosoftMacCatalystSdkPackageVersion>
17+
<MicrosoftmacOSSdkPackageVersion>13.1.126-net8-p1</MicrosoftmacOSSdkPackageVersion>
18+
<MicrosoftiOSSdkPackageVersion>16.2.126-net8-p1</MicrosoftiOSSdkPackageVersion>
19+
<MicrosofttvOSSdkPackageVersion>16.1.914-net8-p1</MicrosofttvOSSdkPackageVersion>
2020
<!-- Samsung/Tizen.NET -->
2121
<SamsungTizenSdkPackageVersion>7.0.104</SamsungTizenSdkPackageVersion>
2222
<!-- emsdk -->
23-
<MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>8.0.0-alpha.1.22510.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>
23+
<MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>8.0.0-alpha.1.22620.1</MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion>
2424
<MicrosoftNETWorkloadEmscriptenPackageVersion>$(MicrosoftNETWorkloadEmscriptennet7Manifest80100PackageVersion)</MicrosoftNETWorkloadEmscriptenPackageVersion>
2525
<!-- wasdk -->
2626
<MicrosoftWindowsAppSDKPackageVersion>1.2.221209.1</MicrosoftWindowsAppSDKPackageVersion>
@@ -39,7 +39,7 @@
3939
<MicrosoftAspNetCoreMetadataPackageVersion>7.0.1</MicrosoftAspNetCoreMetadataPackageVersion>
4040
<MicrosoftJSInteropPackageVersion>7.0.2</MicrosoftJSInteropPackageVersion>
4141
<!-- Other packages -->
42-
<MicrosoftCodeAnalysisNetAnalyzersVersion>7.0.0</MicrosoftCodeAnalysisNetAnalyzersVersion>
42+
<MicrosoftCodeAnalysisNetAnalyzersVersion>8.0.0-preview1.23067.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
4343
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
4444
<MicrosoftCodeAnalysisBannedApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisBannedApiAnalyzersVersion>
4545
<SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>

src/BlazorWebView/src/Maui/PublicAPI/net-android/PublicAPI.Unshipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> stri
33
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
44
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
55
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
6+
Microsoft.AspNetCore.Components.WebView.Maui.Resource
7+
Microsoft.AspNetCore.Components.WebView.Maui.Resource.Resource() -> void
68
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!

src/Compatibility/Core/src/Android/CollectionView/SelectableViewHolder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ void SetSelectionStates(bool isSelected)
6565
return;
6666
}
6767

68-
if (Forms.IsMarshmallowOrNewer)
68+
if (OperatingSystem.IsAndroidVersionAtLeast(23))
6969
{
7070
// We're looking for the foreground ripple effect, which is not available on older APIs
7171
// Limiting this to Marshmallow and newer, because View.setForeground() is not available on lower APIs

src/Compatibility/Core/src/Android/DragAndDropGestureHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ public void OnLongPress(MotionEvent e)
319319
customLocalStateData.SourceNativeView = v;
320320
customLocalStateData.SourceElement = renderer?.Element;
321321

322-
if (Forms.IsNougatOrNewer)
322+
if (OperatingSystem.IsAndroidVersionAtLeast(24))
323323
v.StartDragAndDrop(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead);
324324
else
325-
#pragma warning disable CS0618 // Type or member is obsolete
325+
#pragma warning disable CA1416 // DragFlags.Global added in API 24: https://developer.android.com/reference/android/view/View#DRAG_FLAG_GLOBAL
326326
v.StartDrag(data, dragShadowBuilder, customLocalStateData, (int)ADragFlags.Global | (int)ADragFlags.GlobalUriRead);
327-
#pragma warning restore CS0618 // Type or member is obsolete
327+
#pragma warning restore CA1416
328328
});
329329
}
330330

src/Compatibility/Core/src/Android/Extensions/EntryRendererExtensions.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ public static ImeAction ToAndroidImeOptions(this PlatformConfiguration.AndroidSp
4646
case PlatformConfiguration.AndroidSpecific.ImeFlags.ImeMaskAction:
4747
return ImeAction.ImeMaskAction;
4848
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoPersonalizedLearning:
49+
#pragma warning disable CA1416 // Introduced in API 26: https://developer.android.com/reference/android/view/inputmethod/EditorInfo#IME_FLAG_NO_PERSONALIZED_LEARNING
4950
return (ImeAction)ImeFlags.NoPersonalizedLearning;
51+
#pragma warning restore CA1416
5052
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoExtractUi:
5153
return (ImeAction)ImeFlags.NoExtractUi;
5254
case PlatformConfiguration.AndroidSpecific.ImeFlags.NoAccessoryAction:

src/Compatibility/Core/src/Android/FastRenderers/LabelRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ void UpdateText()
402402
switch (Element.TextType)
403403
{
404404
case TextType.Html:
405-
if (Forms.IsNougatOrNewer)
405+
if (OperatingSystem.IsAndroidVersionAtLeast(24))
406406
Control.SetText(Html.FromHtml(Element.Text ?? string.Empty, FromHtmlOptions.ModeCompact), BufferType.Spannable);
407407
else
408408
#pragma warning disable CS0618 // Type or member is obsolete

src/Compatibility/Core/src/Android/Forms.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ public static class Forms
6666
static Color _ColorButtonNormal = null;
6767
public static Color ColorButtonNormalOverride { get; set; }
6868

69-
[SupportedOSPlatformGuard("android23.0")]
70-
internal static readonly bool IsMarshmallowOrNewer = OperatingSystem.IsAndroidVersionAtLeast((int)BuildVersionCodes.M);
71-
72-
[SupportedOSPlatformGuard("android24.0")]
73-
internal static readonly bool IsNougatOrNewer = OperatingSystem.IsAndroidVersionAtLeast((int)BuildVersionCodes.N);
74-
7569
public static float GetFontSizeNormal(Context context)
7670
{
7771
float size = 50;

0 commit comments

Comments
 (0)