Skip to content

Commit 15c9b8e

Browse files
[build] remove .NET 6 support (#7900)
Context: https://dotnet.microsoft.com/platform/support/policy/maui > A major version of .NET MAUI receives support for a minimum of 6 > months after a successor (the next major release) ships. For > example, .NET MAUI 6.0 will be supported for 6 months after .NET > MAUI 7.0 ships. Similarly, .NET MAUI 7.0 will receive support for 6 > months after .NET MAUI 8.0 ships. By the time .NET 8 GA ships, .NET 6 MAUI projects will not be supported. Remove .NET 6 support from the .NET 8 `android` workload. I removed `net6.0-android` parameters from various tests, making sure we still have .NET 7 and .NET 8 tests.
1 parent 4ac3740 commit 15c9b8e

File tree

8 files changed

+9
-68
lines changed

8 files changed

+9
-68
lines changed

Configuration.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
<Deterministic Condition=" '$(Deterministic)' == '' ">True</Deterministic>
4444
<LangVersion Condition=" '$(LangVersion)' == '' ">latest</LangVersion>
4545
<AndroidNet7Version Condition=" '$(AndroidNet7Version)' == '' ">33.0.46</AndroidNet7Version>
46-
<AndroidNet6Version Condition=" '$(AndroidNet6Version)' == '' ">32.0.485</AndroidNet6Version>
4746
</PropertyGroup>
4847
<PropertyGroup Condition=" '$(HostOS)' == '' ">
4948
<HostOS Condition="$([MSBuild]::IsOSPlatform('windows'))">Windows</HostOS>

build-tools/create-packs/Microsoft.NET.Sdk.Android.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ about the various Microsoft.Android workloads.
3535
<ReplaceFileContents
3636
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.json"
3737
DestinationFile="$(WorkloadManifestJsonPath)"
38-
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
38+
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET7_VERSION@=$(AndroidNet7Version)">
3939
</ReplaceFileContents>
4040
<ReplaceFileContents
4141
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.targets"
4242
DestinationFile="$(WorkloadManifestTargetsPath)"
43-
Replacements="@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
43+
Replacements="@NET7_VERSION@=$(AndroidNet7Version)">
4444
</ReplaceFileContents>
4545

4646
<ItemGroup>

src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"packs": [
77
"Microsoft.Android.Sdk.net8",
88
"Microsoft.Android.Sdk.net7",
9-
"Microsoft.Android.Sdk.net6",
109
"Microsoft.Android.Ref.33",
1110
"Microsoft.Android.Runtime.33.android-arm",
1211
"Microsoft.Android.Runtime.33.android-arm64",
@@ -16,8 +15,6 @@
1615
],
1716
"platforms": [ "win-x64", "win-arm64", "linux-x64", "osx-x64", "osx-arm64" ],
1817
"extends" : [
19-
"microsoft-net-runtime-android-net6",
20-
"microsoft-net-runtime-android-aot-net6",
2118
"microsoft-net-runtime-android-net7",
2219
"microsoft-net-runtime-android-aot-net7",
2320
"microsoft-net-runtime-android",
@@ -50,18 +47,6 @@
5047
"linux-x64": "Microsoft.Android.Sdk.Linux"
5148
}
5249
},
53-
"Microsoft.Android.Sdk.net6": {
54-
"kind": "sdk",
55-
"version": "@NET6_VERSION@",
56-
"alias-to": {
57-
"osx-x64": "Microsoft.Android.Sdk.Darwin",
58-
"osx-arm64": "Microsoft.Android.Sdk.Darwin",
59-
"win-x86": "Microsoft.Android.Sdk.Windows",
60-
"win-x64": "Microsoft.Android.Sdk.Windows",
61-
"win-arm64": "Microsoft.Android.Sdk.Windows",
62-
"linux-x64": "Microsoft.Android.Sdk.Linux"
63-
}
64-
},
6550
"Microsoft.Android.Ref.33": {
6651
"kind": "framework",
6752
"version": "@WORKLOAD_VERSION@"

src/Xamarin.Android.Build.Tasks/Microsoft.NET.Sdk.Android/WorkloadManifest.in.targets

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,6 @@
1515
TargetingPackVersion="@NET7_VERSION@"
1616
/>
1717
</ItemGroup>
18-
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
19-
<KnownFrameworkReference
20-
Update="Microsoft.Android"
21-
LatestRuntimeFrameworkVersion="@NET6_VERSION@"
22-
TargetingPackVersion="@NET6_VERSION@"
23-
/>
24-
</ItemGroup>
2518

2619
<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
2720
<SdkSupportedTargetPlatformIdentifier Include="android" DisplayName="Android" />

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/XASdkTests.cs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -270,16 +270,6 @@ public void DotNetNew ([Values ("android", "androidlib", "android-bindinglib", "
270270
}
271271

272272
static readonly object[] DotNetPackTargetFrameworks = new object[] {
273-
new object[] {
274-
"net6.0",
275-
"android",
276-
31,
277-
},
278-
new object[] {
279-
"net6.0",
280-
"android31",
281-
31,
282-
},
283273
new object[] {
284274
"net7.0",
285275
"android",
@@ -372,11 +362,7 @@ public String Say (String quote) {
372362
nupkg.AssertDoesNotContainEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/nopack.aar");
373363
nupkg.AssertDoesNotContainEntry (nupkgPath, "content/nopack.aar");
374364
nupkg.AssertDoesNotContainEntry (nupkgPath, $"contentFiles/any/{dotnetVersion}-android{apiLevel}.0/nopack.aar");
375-
376-
//TODO: this issue is not fixed in net6.0-android MSBuild targets
377-
if (dotnetVersion != "net6.0") {
378-
nupkg.AssertContainsEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/baz.aar");
379-
}
365+
nupkg.AssertContainsEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/baz.aar");
380366
}
381367

382368
[Test]
@@ -869,11 +855,6 @@ public void DotNetBuildXamarinForms ([Values (true, false)] bool useInterpreter)
869855
}
870856

871857
static readonly object[] DotNetTargetFrameworks = new object[] {
872-
new object[] {
873-
"net6.0",
874-
"android",
875-
XABuildConfig.AndroidDefaultTargetDotnetApiLevel,
876-
},
877858
new object[] {
878859
"net7.0",
879860
"android",
@@ -1009,10 +990,10 @@ void CreateEmptyFile (params string [] paths)
1009990
}
1010991

1011992
[Test]
1012-
public void XamarinLegacySdk ([Values ("net6.0-android32.0", "net7.0-android33.0", "net8.0-android33.0")] string dotnetTargetFramework)
993+
public void XamarinLegacySdk ([Values ("net7.0-android33.0", "net8.0-android33.0")] string dotnetTargetFramework)
1013994
{
1014995
var proj = new XASdkProject (outputType: "Library") {
1015-
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2",
996+
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha4",
1016997
Sources = {
1017998
new AndroidItem.AndroidLibrary ("javaclasses.jar") {
1018999
BinaryContent = () => ResourceData.JavaSourceJarTestJar,

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/DotNetStandard.cs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,12 @@ public string TargetFramework {
3636
}
3737

3838
/// <summary>
39-
/// Projects targeting net6.0/net7.0 require ref/runtime packs on NuGet.org or dotnet6/dotnet7
39+
/// Projects targeting net7.0 require ref/runtime packs on NuGet.org or dotnet6/dotnet7
4040
/// </summary>
4141
public void AddNuGetSourcesForOlderTargetFrameworks (string targetFramework = null)
4242
{
4343
targetFramework ??= TargetFramework;
44-
if (targetFramework.IndexOf ("net6.0", StringComparison.OrdinalIgnoreCase) != -1) {
45-
ExtraNuGetConfigSources = new List<string> {
46-
"https://api.nuget.org/v3/index.json",
47-
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
48-
// NOTE: .NET 6 currently uses .NET 7 linker
49-
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json",
50-
};
51-
} else if (targetFramework.IndexOf ("net7.0", StringComparison.OrdinalIgnoreCase) != -1) {
44+
if (targetFramework.IndexOf ("net7.0", StringComparison.OrdinalIgnoreCase) != -1) {
5245
ExtraNuGetConfigSources = new List<string> {
5346
"https://api.nuget.org/v3/index.json",
5447
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json",

tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ public void ResourceDesignerWithNuGetReference ([Values ("net8.0-android33.0")]
730730
}
731731
// Build a NuGet Package
732732
var nuget = new XASdkProject (outputType: "Library") {
733-
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2",
733+
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha4",
734734
ProjectName = "Test.Nuget.Package",
735735
IsRelease = true,
736736
};

tests/MSBuildDeviceIntegration/Tests/XASdkDeployTests.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,6 @@ public class XASdkDeployTests : DeviceTest
5555
/* xamarinForms */ true,
5656
/* targetFramework*/ "net7.0-android",
5757
},
58-
new object[] {
59-
/* isRelease */ false,
60-
/* xamarinForms */ true,
61-
/* targetFramework*/ "net6.0-android",
62-
},
63-
new object[] {
64-
/* isRelease */ true,
65-
/* xamarinForms */ true,
66-
/* targetFramework*/ "net6.0-android",
67-
},
6858
};
6959

7060
[Test]
@@ -207,7 +197,7 @@ public void SupportDesugaringStaticInterfaceMethods ()
207197
[Test]
208198
[Category ("Debugger")]
209199
[Retry(5)]
210-
public void DotNetDebug ([Values("net6.0-android", "net7.0-android")] string targetFramework)
200+
public void DotNetDebug ([Values("net7.0-android", "net8.0-android")] string targetFramework)
211201
{
212202
AssertCommercialBuild ();
213203

0 commit comments

Comments
 (0)