Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build] remove .NET 6 support #7900

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Configuration.props
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
<Deterministic Condition=" '$(Deterministic)' == '' ">True</Deterministic>
<LangVersion Condition=" '$(LangVersion)' == '' ">latest</LangVersion>
<AndroidNet7Version Condition=" '$(AndroidNet7Version)' == '' ">33.0.46</AndroidNet7Version>
<AndroidNet6Version Condition=" '$(AndroidNet6Version)' == '' ">32.0.485</AndroidNet6Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(HostOS)' == '' ">
<HostOS Condition="$([MSBuild]::IsOSPlatform('windows'))">Windows</HostOS>
Expand Down
4 changes: 2 additions & 2 deletions build-tools/create-packs/Microsoft.NET.Sdk.Android.proj
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ about the various Microsoft.Android workloads.
<ReplaceFileContents
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.json"
DestinationFile="$(WorkloadManifestJsonPath)"
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
Replacements="@WORKLOAD_VERSION@=$(WorkloadVersion);@NET7_VERSION@=$(AndroidNet7Version)">
</ReplaceFileContents>
<ReplaceFileContents
SourceFile="$(XamarinAndroidSourcePath)src\Xamarin.Android.Build.Tasks\Microsoft.NET.Sdk.Android\WorkloadManifest.in.targets"
DestinationFile="$(WorkloadManifestTargetsPath)"
Replacements="@NET7_VERSION@=$(AndroidNet7Version);@NET6_VERSION@=$(AndroidNet6Version)">
Replacements="@NET7_VERSION@=$(AndroidNet7Version)">
</ReplaceFileContents>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"packs": [
"Microsoft.Android.Sdk.net8",
"Microsoft.Android.Sdk.net7",
"Microsoft.Android.Sdk.net6",
"Microsoft.Android.Ref.33",
"Microsoft.Android.Runtime.33.android-arm",
"Microsoft.Android.Runtime.33.android-arm64",
Expand All @@ -16,8 +15,6 @@
],
"platforms": [ "win-x64", "win-arm64", "linux-x64", "osx-x64", "osx-arm64" ],
"extends" : [
"microsoft-net-runtime-android-net6",
"microsoft-net-runtime-android-aot-net6",
"microsoft-net-runtime-android-net7",
"microsoft-net-runtime-android-aot-net7",
"microsoft-net-runtime-android",
Expand Down Expand Up @@ -50,18 +47,6 @@
"linux-x64": "Microsoft.Android.Sdk.Linux"
}
},
"Microsoft.Android.Sdk.net6": {
"kind": "sdk",
"version": "@NET6_VERSION@",
"alias-to": {
"osx-x64": "Microsoft.Android.Sdk.Darwin",
"osx-arm64": "Microsoft.Android.Sdk.Darwin",
"win-x86": "Microsoft.Android.Sdk.Windows",
"win-x64": "Microsoft.Android.Sdk.Windows",
"win-arm64": "Microsoft.Android.Sdk.Windows",
"linux-x64": "Microsoft.Android.Sdk.Linux"
}
},
"Microsoft.Android.Ref.33": {
"kind": "framework",
"version": "@WORKLOAD_VERSION@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
TargetingPackVersion="@NET7_VERSION@"
/>
</ItemGroup>
<ItemGroup Condition=" '$(TargetPlatformIdentifier)' == 'android' and $([MSBuild]::VersionEquals($(TargetFrameworkVersion), '6.0')) ">
<KnownFrameworkReference
Update="Microsoft.Android"
LatestRuntimeFrameworkVersion="@NET6_VERSION@"
TargetingPackVersion="@NET6_VERSION@"
/>
</ItemGroup>

<ItemGroup Condition=" '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '6.0')) ">
<SdkSupportedTargetPlatformIdentifier Include="android" DisplayName="Android" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,6 @@ public void DotNetNew ([Values ("android", "androidlib", "android-bindinglib", "
}

static readonly object[] DotNetPackTargetFrameworks = new object[] {
new object[] {
"net6.0",
"android",
31,
},
new object[] {
"net6.0",
"android31",
31,
},
new object[] {
"net7.0",
"android",
Expand Down Expand Up @@ -372,11 +362,7 @@ public String Say (String quote) {
nupkg.AssertDoesNotContainEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/nopack.aar");
nupkg.AssertDoesNotContainEntry (nupkgPath, "content/nopack.aar");
nupkg.AssertDoesNotContainEntry (nupkgPath, $"contentFiles/any/{dotnetVersion}-android{apiLevel}.0/nopack.aar");

//TODO: this issue is not fixed in net6.0-android MSBuild targets
if (dotnetVersion != "net6.0") {
nupkg.AssertContainsEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/baz.aar");
}
nupkg.AssertContainsEntry (nupkgPath, $"lib/{dotnetVersion}-android{apiLevel}.0/baz.aar");
}

[Test]
Expand Down Expand Up @@ -869,11 +855,6 @@ public void DotNetBuildXamarinForms ([Values (true, false)] bool useInterpreter)
}

static readonly object[] DotNetTargetFrameworks = new object[] {
new object[] {
"net6.0",
"android",
XABuildConfig.AndroidDefaultTargetDotnetApiLevel,
},
new object[] {
"net7.0",
"android",
Expand Down Expand Up @@ -1009,10 +990,10 @@ void CreateEmptyFile (params string [] paths)
}

[Test]
public void XamarinLegacySdk ([Values ("net6.0-android32.0", "net7.0-android33.0", "net8.0-android33.0")] string dotnetTargetFramework)
public void XamarinLegacySdk ([Values ("net7.0-android33.0", "net8.0-android33.0")] string dotnetTargetFramework)
{
var proj = new XASdkProject (outputType: "Library") {
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2",
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha4",
Sources = {
new AndroidItem.AndroidLibrary ("javaclasses.jar") {
BinaryContent = () => ResourceData.JavaSourceJarTestJar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,12 @@ public string TargetFramework {
}

/// <summary>
/// Projects targeting net6.0/net7.0 require ref/runtime packs on NuGet.org or dotnet6/dotnet7
/// Projects targeting net7.0 require ref/runtime packs on NuGet.org or dotnet6/dotnet7
/// </summary>
public void AddNuGetSourcesForOlderTargetFrameworks (string targetFramework = null)
{
targetFramework ??= TargetFramework;
if (targetFramework.IndexOf ("net6.0", StringComparison.OrdinalIgnoreCase) != -1) {
ExtraNuGetConfigSources = new List<string> {
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet6/nuget/v3/index.json",
// NOTE: .NET 6 currently uses .NET 7 linker
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json",
};
} else if (targetFramework.IndexOf ("net7.0", StringComparison.OrdinalIgnoreCase) != -1) {
if (targetFramework.IndexOf ("net7.0", StringComparison.OrdinalIgnoreCase) != -1) {
ExtraNuGetConfigSources = new List<string> {
"https://api.nuget.org/v3/index.json",
"https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ public void ResourceDesignerWithNuGetReference ([Values ("net8.0-android33.0")]
}
// Build a NuGet Package
var nuget = new XASdkProject (outputType: "Library") {
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha2",
Sdk = "Xamarin.Legacy.Sdk/0.2.0-alpha4",
ProjectName = "Test.Nuget.Package",
IsRelease = true,
};
Expand Down
12 changes: 1 addition & 11 deletions tests/MSBuildDeviceIntegration/Tests/XASdkDeployTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,6 @@ public class XASdkDeployTests : DeviceTest
/* xamarinForms */ true,
/* targetFramework*/ "net7.0-android",
},
new object[] {
/* isRelease */ false,
/* xamarinForms */ true,
/* targetFramework*/ "net6.0-android",
},
new object[] {
/* isRelease */ true,
/* xamarinForms */ true,
/* targetFramework*/ "net6.0-android",
},
};

[Test]
Expand Down Expand Up @@ -207,7 +197,7 @@ public void SupportDesugaringStaticInterfaceMethods ()
[Test]
[Category ("Debugger")]
[Retry(5)]
public void DotNetDebug ([Values("net6.0-android", "net7.0-android")] string targetFramework)
public void DotNetDebug ([Values("net7.0-android", "net8.0-android")] string targetFramework)
{
AssertCommercialBuild ();

Expand Down