From dc98b32740f8efcacb4680271428e0314286a99c Mon Sep 17 00:00:00 2001 From: redth Date: Tue, 21 Jun 2022 10:38:31 -0400 Subject: [PATCH 01/26] Include net6 template packs in net7 workload --- Directory.Build.props | 6 ++++++ .../Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj | 6 ++++++ .../Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json | 1 + 3 files changed, 13 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 1e67701b6183..e74222ab9428 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,6 +6,12 @@ <_MauiDotNetVersionMinor Condition="'$(_MauiDotNetVersionMinor)' == ''">0 <_MauiDotNetVersion Condition="'$(_MauiDotNetVersion)' == ''">$(_MauiDotNetVersionMajor).$(_MauiDotNetVersionMinor) <_MauiDotNetTfm Condition="'$(_MauiDotNetTfm)' == ''">net$(_MauiDotNetVersion) + + <_MauiPreviousDotNetVersionMajor Condition="'$(_MauiPreviousDotNetVersionMajor)' == ''">6 + <_MauiPreviousDotNetVersionMinor Condition="'$(_MauiPreviousDotNetVersionMinor)' == ''">0 + <_MauiPreviousDotNetVersion Condition="'$(_MauiPreviousDotNetVersion)' == ''">$(_MauiPreviousDotNetVersionMajor).$(_MauiPreviousDotNetVersionMinor) + <_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion) + <_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) <_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True <_MauiTargetPlatformIsAndroid Condition="'$(_MauiTargetPlatformIdentifier)' == 'android'">True diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj index 59df8a73d951..2507c04565b6 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj +++ b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj @@ -74,6 +74,12 @@ OldValue="@MAUI_GRAPHICS_VERSION@" NewValue="$(MicrosoftMauiGraphicsVersion)" /> + Date: Tue, 21 Jun 2022 10:47:34 -0400 Subject: [PATCH 02/26] Previous template pack version Make this the released nuget package version as defined in version.props by a new variable. --- eng/Versions.props | 2 ++ .../Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj | 8 +++++++- .../Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 34a872e9ca21..3c2029365fcc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,5 +1,7 @@ + + 6.0.400 7.0.100-preview.6.22277.6 diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj index 2507c04565b6..062a9b2bc556 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj +++ b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj @@ -77,7 +77,7 @@ + Date: Tue, 21 Jun 2022 11:04:23 -0400 Subject: [PATCH 03/26] Fix bad copy pasta --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e74222ab9428..b306c6d9ea75 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,7 +10,7 @@ <_MauiPreviousDotNetVersionMajor Condition="'$(_MauiPreviousDotNetVersionMajor)' == ''">6 <_MauiPreviousDotNetVersionMinor Condition="'$(_MauiPreviousDotNetVersionMinor)' == ''">0 <_MauiPreviousDotNetVersion Condition="'$(_MauiPreviousDotNetVersion)' == ''">$(_MauiPreviousDotNetVersionMajor).$(_MauiPreviousDotNetVersionMinor) - <_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion) + <_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion) <_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) <_MauiNoTargetPlatform Condition="'$(_MauiTargetPlatformIdentifier)' == ''">True From e976635fd35bc9464e8fcdc7b0e333af005f9b43 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 23 Jun 2022 01:27:45 +0200 Subject: [PATCH 04/26] More template tests --- eng/pipelines/handlers.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 2d25710f68b5..860514144f30 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -104,6 +104,10 @@ parameters: default: - name: default tfm: default + - name: net6 + tfm: net6.0 + - name: net7 + tfm: net7.0 resources: repositories: From 39056fdd9309d7f1c51f4b66d3d87a60d47b1e67 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 23 Jun 2022 15:09:53 +0200 Subject: [PATCH 05/26] Make --framework and -f work! --- src/Templates/src/Microsoft.Maui.Templates.csproj | 4 ++-- .../maui-blazor/.template.config/dotnetcli.host.json | 11 +++++++++++ .../maui-blazor/.template.config/template.json | 12 ------------ .../maui-lib/.template.config/dotnetcli.host.json | 11 +++++++++++ .../maui-mobile/.template.config/dotnetcli.host.json | 11 +++++++++++ .../maui-mobile/.template.config/template.json | 12 ------------ 6 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 src/Templates/src/templates/maui-blazor/.template.config/dotnetcli.host.json create mode 100644 src/Templates/src/templates/maui-lib/.template.config/dotnetcli.host.json create mode 100644 src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json diff --git a/src/Templates/src/Microsoft.Maui.Templates.csproj b/src/Templates/src/Microsoft.Maui.Templates.csproj index 030159ef6335..b2f2e40f8419 100644 --- a/src/Templates/src/Microsoft.Maui.Templates.csproj +++ b/src/Templates/src/Microsoft.Maui.Templates.csproj @@ -77,8 +77,8 @@ + MatchExpression="DOTNET_TFM_VALUE;DOTNET_TFM_VERSION_VALUE;DOTNET_TFM_VERSION_MAJOR_VALUE" + ReplacementText="$(_MauiDotNetTfm);$(_MauiDotNetVersion);$(_MauiDotNetVersionMajor)000" /> diff --git a/src/Templates/src/templates/maui-blazor/.template.config/dotnetcli.host.json b/src/Templates/src/templates/maui-blazor/.template.config/dotnetcli.host.json new file mode 100644 index 000000000000..871a23da0024 --- /dev/null +++ b/src/Templates/src/templates/maui-blazor/.template.config/dotnetcli.host.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "Framework": { + "longName": "framework" + } + }, + "usageExamples": [ + "--framework net7.0" + ] + } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-blazor/.template.config/template.json b/src/Templates/src/templates/maui-blazor/.template.config/template.json index 9a3e4f480ada..473c8bd87220 100644 --- a/src/Templates/src/templates/maui-blazor/.template.config/template.json +++ b/src/Templates/src/templates/maui-blazor/.template.config/template.json @@ -59,18 +59,6 @@ "datatype": "string", "replaces": "com.companyname.MauiApp.1" }, - "windowsAppSdkVersion": { - "type": "parameter", - "dataType": "string", - "replaces": "WINDOWSAPPSDK_VERSION", - "defaultValue": "WINDOWSAPPSDK_VERSION_VALUE" - }, - "win2dVersion": { - "type": "parameter", - "dataType": "string", - "replaces": "WIN2D_VERSION", - "defaultValue": "WIN2D_VERSION_VALUE" - }, "Framework": { "type": "parameter", "description": "The target framework for the project.", diff --git a/src/Templates/src/templates/maui-lib/.template.config/dotnetcli.host.json b/src/Templates/src/templates/maui-lib/.template.config/dotnetcli.host.json new file mode 100644 index 000000000000..871a23da0024 --- /dev/null +++ b/src/Templates/src/templates/maui-lib/.template.config/dotnetcli.host.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "Framework": { + "longName": "framework" + } + }, + "usageExamples": [ + "--framework net7.0" + ] + } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json b/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json new file mode 100644 index 000000000000..871a23da0024 --- /dev/null +++ b/src/Templates/src/templates/maui-mobile/.template.config/dotnetcli.host.json @@ -0,0 +1,11 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "Framework": { + "longName": "framework" + } + }, + "usageExamples": [ + "--framework net7.0" + ] + } \ No newline at end of file diff --git a/src/Templates/src/templates/maui-mobile/.template.config/template.json b/src/Templates/src/templates/maui-mobile/.template.config/template.json index 1def57755895..668a95b7f336 100644 --- a/src/Templates/src/templates/maui-mobile/.template.config/template.json +++ b/src/Templates/src/templates/maui-mobile/.template.config/template.json @@ -63,18 +63,6 @@ "datatype": "string", "replaces": "com.companyname.MauiApp.1" }, - "windowsAppSdkVersion": { - "type": "parameter", - "dataType": "string", - "replaces": "WINDOWSAPPSDK_VERSION", - "defaultValue": "WINDOWSAPPSDK_VERSION_VALUE" - }, - "win2dVersion": { - "type": "parameter", - "dataType": "string", - "replaces": "WIN2D_VERSION", - "defaultValue": "WIN2D_VERSION_VALUE" - }, "Framework": { "type": "parameter", "description": "The target framework for the project.", From 92d9a6c9551b41dc60fdac2e7ff1133011ddd2ef Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 23 Jun 2022 17:48:45 +0200 Subject: [PATCH 06/26] Swap the values in the cli file as well --- src/Templates/src/Microsoft.Maui.Templates.csproj | 4 ++-- .../maui-blazor/.template.config/dotnetcli.host.json | 2 +- .../templates/maui-lib/.template.config/dotnetcli.host.json | 2 +- .../maui-mobile/.template.config/dotnetcli.host.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Templates/src/Microsoft.Maui.Templates.csproj b/src/Templates/src/Microsoft.Maui.Templates.csproj index b2f2e40f8419..bebf5b5a7853 100644 --- a/src/Templates/src/Microsoft.Maui.Templates.csproj +++ b/src/Templates/src/Microsoft.Maui.Templates.csproj @@ -46,7 +46,7 @@ - + $([System.String]::Concat(%(RelativeDir), '%(Filename)%(Extension)')) $(IntermediateOutputPath)$([System.String]::Concat(%(RelativeDir), '%(Filename)%(Extension)')) @@ -73,7 +73,7 @@ DestinationFiles="%(TemplateJsonInput.RelativeDir)templatestrings.json" Condition="'%(TemplateJsonInput.Filename)%(TemplateJsonInput.Extension)' == 'templatestrings.en.json'" /> - + Date: Thu, 23 Jun 2022 18:28:57 +0200 Subject: [PATCH 07/26] --Framework for now --- eng/cake/dotnet.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 585fa530158e..cbefc03ca078 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -156,7 +156,7 @@ Task("dotnet-templates") var projectName = template.Key.Split(":")[0]; var templateName = template.Key.Split(":")[1]; - var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--framework {TestTFM}"; + var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--Framework {TestTFM}"; projectName = $"{tempDir}/{projectName}_{type}"; projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM}"; From 847c714a1583414dc298ba97b980ffb8ccffe4d9 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 23 Jun 2022 20:28:52 +0200 Subject: [PATCH 08/26] ?: --- eng/cake/dotnet.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 72a55fed5290..dbb527e3dfb8 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -160,7 +160,7 @@ Task("dotnet-templates") ? "" : TestTFM.StartsWith("net6") ? $"--Framework {TestTFM}" // this is just needed until we ship the next MAUI SR2 - ? $"--framework {TestTFM}"; + : $"--framework {TestTFM}"; projectName = $"{tempDir}/{projectName}_{type}"; projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM}"; From fa16f28944c247a773c7f614b204fe4271362244 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 03:37:31 +0200 Subject: [PATCH 09/26] This should be working now except for ios/maccat/tizen --- Directory.Build.props | 6 ++- .../Microsoft.NET.Sdk.Maui.csproj | 42 ++++++------------- .../WorkloadManifest.in.json | 17 ++++++-- .../WorkloadManifest.in.targets | 35 ++++++++++++++++ .../WorkloadManifest.targets | 14 ------- 5 files changed, 65 insertions(+), 49 deletions(-) create mode 100644 src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets delete mode 100644 src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets diff --git a/Directory.Build.props b/Directory.Build.props index b306c6d9ea75..3d96906c5b98 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,6 +10,7 @@ <_MauiPreviousDotNetVersionMajor Condition="'$(_MauiPreviousDotNetVersionMajor)' == ''">6 <_MauiPreviousDotNetVersionMinor Condition="'$(_MauiPreviousDotNetVersionMinor)' == ''">0 <_MauiPreviousDotNetVersion Condition="'$(_MauiPreviousDotNetVersion)' == ''">$(_MauiPreviousDotNetVersionMajor).$(_MauiPreviousDotNetVersionMinor) + <_MauiPreviousDotNetVersionNoDot Condition="'$(_MauiPreviousDotNetVersionNoDot)' == ''">$(_MauiPreviousDotNetVersionMajor)$(_MauiPreviousDotNetVersionMinor) <_MauiPreviousDotNetTfm Condition="'$(_MauiPreviousDotNetTfm)' == ''">net$(_MauiPreviousDotNetVersion) <_MauiTargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) @@ -23,9 +24,10 @@ <_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True true - true + Exists('$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetVersionBand)\samsung.net.sdk.tizen\WorkloadManifest.json')">true --> + true diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj index 062a9b2bc556..f0209e46736e 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj +++ b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj @@ -20,6 +20,7 @@ <_JsonInputFile Include="WorkloadManifest.in.json" OutputPath="$(IntermediateOutputPath)WorkloadManifest.json" Pack="true" /> + <_JsonInputFile Include="WorkloadManifest.in.targets" OutputPath="$(IntermediateOutputPath)WorkloadManifest.targets" Pack="true" /> <_JsonInputFile Include="Rollback.in.json" OutputPath="$(IntermediateOutputPath)Rollback.json" Pack="false" /> <_JsonInputFile Include="SdkInstaller.in.json" OutputPath="$(IntermediateOutputPath)SdkInstaller.json" Pack="false" /> @@ -54,6 +55,12 @@ <_VersionsToReplace Include="MicrosoftMauiGraphicsVersion" /> <_VersionsToReplace Update="@(_VersionsToReplace)" PropertyName="%(Identity)" /> <_VersionsToReplace Include="MicrosoftMauiGraphicsWin2DWinUIDesktopPackageVersion" PropertyName="MicrosoftMauiGraphicsVersion" /> + <_VersionsToReplace Include="MAUI_GRAPHICS_VERSION" PropertyName="MicrosoftMauiGraphicsVersion" /> + <_VersionsToReplace Include="VERSION" PropertyName="PackageReferenceVersion" /> + <_VersionsToReplace Include="MAUI_DOTNET_VERSION" PropertyName="_MauiDotNetVersion" /> + <_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION" PropertyName="_MauiPreviousDotNetVersion" /> + <_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION_NO_DOT" PropertyName="_MauiPreviousDotNetVersionNoDot" /> + <_VersionsToReplace Include="MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION" PropertyName="MicrosoftMauiPreviousDotNetReleasedVersion" /> - - - - - - + diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json index 62f2810e22b6..1d8b49df0edc 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json @@ -28,7 +28,8 @@ "description": ".NET MAUI SDK Core Packages", "packs": [ "Microsoft.Maui.Dependencies", - "Microsoft.Maui.Sdk", + "Microsoft.Maui.Sdk-@MAUI_DOTNET_VERSION@", + "Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@", "Microsoft.Maui.Graphics", "Microsoft.Maui.Resizetizer.Sdk", "Microsoft.Maui.Templates-@MAUI_PREVIOUS_DOTNET_VERSION@", @@ -283,9 +284,19 @@ "kind": "library", "version": "@MAUI_GRAPHICS_VERSION@" }, - "Microsoft.Maui.Sdk": { + "Microsoft.Maui.Sdk-@MAUI_DOTNET_VERSION@": { "kind": "sdk", - "version": "@VERSION@" + "version": "@VERSION@", + "alias-to": { + "any": "Microsoft.Maui.Sdk" + } + }, + "Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@": { + "kind": "sdk", + "version": "@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@", + "alias-to": { + "any": "Microsoft.Maui.Sdk" + } }, "Microsoft.Maui.Resizetizer.Sdk": { "kind": "sdk", diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets new file mode 100644 index 000000000000..3f99c07e1e2f --- /dev/null +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets deleted file mode 100644 index 91f9663d8295..000000000000 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.targets +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - \ No newline at end of file From 952739faa35869610609600101e6afc0252c67b5 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 18:21:11 +0200 Subject: [PATCH 10/26] revert that --- Directory.Build.props | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3d96906c5b98..e5d767c79d98 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,10 +24,9 @@ <_MauiTargetPlatformIsTizen Condition="'$(_MauiTargetPlatformIdentifier)' == 'tizen'">True true - - true + Exists('$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetVersionBand)\samsung.net.sdk.tizen\WorkloadManifest.json')">true From 9099af96d5ed431d41e49b89952be24de1421877 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 18:29:26 +0200 Subject: [PATCH 11/26] Skip certian platforms --- eng/cake/dotnet.cake | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index dbb527e3dfb8..7215314e938d 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -173,12 +173,22 @@ Task("dotnet-templates") template.Value(projectName); // Enable Tizen - ReplaceTextInFiles($"{projectName}/*.csproj", - "", - ""); + if (!TestTFM.StartsWith("net6")) // Tizen does not yet support net6 on the net7 SDK: https://github.com/Samsung/Tizen.NET/issues/182 + { + ReplaceTextInFiles($"{projectName}/*.csproj", + "", + ""); + } + else + { + // Mac Catalyst/iOS does not yet support net6 from the net7 SDK: https://github.com/xamarin/xamarin-macios/issues/15344 + ReplaceTextInFiles($"{projectName}/*.csproj", + ";net6.0-ios;net6.0-maccatalyst", + ""); + } // Build RunMSBuildWithDotNet(projectName, properties, warningsAsError: true, forceDotNetBuild: forceDotNetBuild); From 05b58063238a292d5f245a4651bac9b407090df1 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 18:38:43 +0200 Subject: [PATCH 12/26] Load the SDK that matches the current build --- .../Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 3f99c07e1e2f..1954eedd2643 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -4,12 +4,8 @@ - Date: Fri, 24 Jun 2022 18:45:42 +0200 Subject: [PATCH 13/26] oops --- src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 1954eedd2643..0a865ec2c36f 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -4,7 +4,7 @@ Date: Fri, 24 Jun 2022 19:20:18 +0200 Subject: [PATCH 14/26] Use this instead --- src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets | 1 + src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets b/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets index 387ff46c3a18..24aea7850b26 100644 --- a/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets +++ b/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets @@ -1,4 +1,5 @@ + <_MauiRuntimePackVersion>$(MauiVersion) <_MauiRuntimePackVersion Condition=" '$(_MauiRuntimePackVersion)' == '' ">**FromWorkload** diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 0a865ec2c36f..8112e3ab57ee 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -5,7 +5,7 @@ Date: Fri, 24 Jun 2022 21:43:18 +0200 Subject: [PATCH 15/26] Include both versions --- .../Microsoft.Maui.Sdk.csproj | 43 ++++++++---------- .../Sdk/BundledVersions.in.targets | 44 ++++++++++++------- .../Microsoft.NET.Sdk.Maui.csproj | 3 +- .../WorkloadManifest.in.targets | 17 ------- 4 files changed, 47 insertions(+), 60 deletions(-) diff --git a/src/Workload/Microsoft.Maui.Sdk/Microsoft.Maui.Sdk.csproj b/src/Workload/Microsoft.Maui.Sdk/Microsoft.Maui.Sdk.csproj index 226b660c3751..fb87f595de0b 100644 --- a/src/Workload/Microsoft.Maui.Sdk/Microsoft.Maui.Sdk.csproj +++ b/src/Workload/Microsoft.Maui.Sdk/Microsoft.Maui.Sdk.csproj @@ -55,6 +55,19 @@ + + <_ValuesToReplace Include="VERSION" PropertyName="PackageReferenceVersion" /> + <_ValuesToReplace Include="TFM" PropertyName="_MauiDotNetTfm" /> + <_ValuesToReplace Include="PREVIOUS_TFM" PropertyName="_MauiPreviousDotNetTfm" /> + <_ValuesToReplace Include="MAUI_DOTNET_VERSION" PropertyName="_MauiDotNetVersion" /> + <_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION" PropertyName="_MauiPreviousDotNetVersion" /> + <_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_VERSION_NO_DOT" PropertyName="_MauiPreviousDotNetVersionNoDot" /> + <_ValuesToReplace Include="MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION" PropertyName="MicrosoftMauiPreviousDotNetReleasedVersion" /> + <_ValuesToReplace Include="MicrosoftWindowsSDKBuildToolsPackageVersion" PropertyName="MicrosoftWindowsSDKBuildToolsPackageVersion" /> + <_ValuesToReplace Include="MicrosoftExtensionsPackageVersion" PropertyName="MicrosoftExtensionsPackageVersion" /> + <_ValuesToReplace Include="MicrosoftExtensionsServicingPackageVersion" PropertyName="MicrosoftExtensionsServicingPackageVersion" /> + + - - - - + <_MauiRuntimePackVersion>$(MauiVersion) <_MauiRuntimePackVersion Condition=" '$(_MauiRuntimePackVersion)' == '' ">**FromWorkload** @VERSION@ @TFM@ $(MauiWorkloadVersion) + + <_MauiPreviousRuntimePackVersion Condition=" '$(_MauiPreviousRuntimePackVersion)' == '' ">@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@ + <_MauiPreviousWorkloadTargetFramework>@PREVIOUS_TFM@ <_MauiPlatformName Condition=" '$(TargetPlatformIdentifier)' == 'windows' ">win <_MauiPlatformName Condition=" '$(TargetPlatformIdentifier)' != 'windows' ">$(TargetPlatformIdentifier.ToLowerInvariant()) @@ -15,49 +19,57 @@ - <_MauiRuntimeIdentifiers Include="android;ios;maccatalyst;win;tizen" /> - + <_MauiKnownFrameworkReference Condition=" '$(UseMaui)' == 'true' or '$(UseMauiCore)' == 'true' " Include="Microsoft.Maui.Core" - TargetFramework="$(MauiWorkloadTargetFramework)" RuntimeFrameworkName="Microsoft.Maui.Core" - DefaultRuntimeFrameworkVersion="$(_MauiRuntimePackVersion)" - LatestRuntimeFrameworkVersion="$(_MauiRuntimePackVersion)" TargetingPackName="Microsoft.Maui.Core.Ref.$(_MauiPlatformName)" - TargetingPackVersion="$(_MauiRuntimePackVersion)" RuntimePackNamePatterns="Microsoft.Maui.Core.Runtime.**RID**" RuntimePackRuntimeIdentifiers="$(_MauiPlatformName)" Profile="$(TargetPlatformIdentifier)" RuntimePackAlwaysCopyLocal="$(_MauiRuntimePackAlwaysCopyLocal)" /> - - + + + + + + + diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj index f0209e46736e..cc245fadef43 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj +++ b/src/Workload/Microsoft.NET.Sdk.Maui/Microsoft.NET.Sdk.Maui.csproj @@ -81,8 +81,7 @@ /> - + diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 8112e3ab57ee..6a4b0050a362 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -11,21 +11,4 @@ Condition=" '$(UseMaui)' == 'true' or '$(UseMauiAssets)' == 'true' " Project="Sdk.targets" Sdk="Microsoft.Maui.Resizetizer.Sdk" /> - - - - - \ No newline at end of file From ff606001373523413c2ae15332b36328c8830410 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 22:13:20 +0200 Subject: [PATCH 16/26] Support older SDKs --- .../WorkloadManifest.in.targets | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 6a4b0050a362..0647155caafb 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -1,8 +1,10 @@ + + + + + + + + + + \ No newline at end of file From ef6ee32885f2605645f38ead4143a0579ddfba9b Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Fri, 24 Jun 2022 22:46:40 +0200 Subject: [PATCH 17/26] Each workload version has a single support --- .../Sdk/BundledVersions.in.targets | 43 +++++++------------ 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets b/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets index 7a5284a11a7f..9e94ca3f2be7 100644 --- a/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets +++ b/src/Workload/Microsoft.Maui.Sdk/Sdk/BundledVersions.in.targets @@ -1,15 +1,11 @@ - <_MauiRuntimePackVersion>$(MauiVersion) <_MauiRuntimePackVersion Condition=" '$(_MauiRuntimePackVersion)' == '' ">**FromWorkload** @VERSION@ @TFM@ $(MauiWorkloadVersion) - - <_MauiPreviousRuntimePackVersion Condition=" '$(_MauiPreviousRuntimePackVersion)' == '' ">@MAUI_PREVIOUS_DOTNET_RELEASED_NUGET_VERSION@ - <_MauiPreviousWorkloadTargetFramework>@PREVIOUS_TFM@ <_MauiPlatformName Condition=" '$(TargetPlatformIdentifier)' == 'windows' ">win <_MauiPlatformName Condition=" '$(TargetPlatformIdentifier)' != 'windows' ">$(TargetPlatformIdentifier.ToLowerInvariant()) @@ -19,57 +15,48 @@ - - - <_MauiKnownFrameworkReference + - <_MauiKnownFrameworkReference + - <_MauiKnownFrameworkReference + - - - - - - - From 10617b778249c4cb2c34632a6b640046f6e794ee Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Sat, 25 Jun 2022 00:19:11 +0200 Subject: [PATCH 18/26] Seems this is OK --- .../Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json | 9 +++------ .../Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets | 9 +++++++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json index 1d8b49df0edc..9f1887fc868b 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.json @@ -28,7 +28,7 @@ "description": ".NET MAUI SDK Core Packages", "packs": [ "Microsoft.Maui.Dependencies", - "Microsoft.Maui.Sdk-@MAUI_DOTNET_VERSION@", + "Microsoft.Maui.Sdk", "Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@", "Microsoft.Maui.Graphics", "Microsoft.Maui.Resizetizer.Sdk", @@ -284,12 +284,9 @@ "kind": "library", "version": "@MAUI_GRAPHICS_VERSION@" }, - "Microsoft.Maui.Sdk-@MAUI_DOTNET_VERSION@": { + "Microsoft.Maui.Sdk": { "kind": "sdk", - "version": "@VERSION@", - "alias-to": { - "any": "Microsoft.Maui.Sdk" - } + "version": "@VERSION@" }, "Microsoft.Maui.Sdk-@MAUI_PREVIOUS_DOTNET_VERSION@": { "kind": "sdk", diff --git a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets index 0647155caafb..75fc5c4fb874 100644 --- a/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets +++ b/src/Workload/Microsoft.NET.Sdk.Maui/WorkloadManifest.in.targets @@ -6,9 +6,14 @@ + + Date: Sat, 25 Jun 2022 03:45:55 +0200 Subject: [PATCH 19/26] Get something that will work --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 36b2b07b23dc..d45c82ab5bae 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 6.0.400 + 6.0.500-preview.1.6049 7.0.100-preview.6.22316.8 From 32e3e98dfee5fd28f022932935b21a6668505bf5 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Mon, 27 Jun 2022 18:55:29 +0200 Subject: [PATCH 20/26] this should be working now --- eng/cake/dotnet.cake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 7215314e938d..511a0e59cccc 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -156,11 +156,7 @@ Task("dotnet-templates") var projectName = template.Key.Split(":")[0]; var templateName = template.Key.Split(":")[1]; - var framework = string.IsNullOrWhiteSpace(TestTFM) - ? "" - : TestTFM.StartsWith("net6") - ? $"--Framework {TestTFM}" // this is just needed until we ship the next MAUI SR2 - : $"--framework {TestTFM}"; + var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--framework {TestTFM}"; projectName = $"{tempDir}/{projectName}_{type}"; projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM}"; From fec5c753d11a95a981859a271358916b59f9e487 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Mon, 27 Jun 2022 20:13:47 +0200 Subject: [PATCH 21/26] Use the next stable version --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index d45c82ab5bae..6771aa050f8e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -1,7 +1,7 @@ - 6.0.500-preview.1.6049 + 6.0.405 7.0.100-preview.6.22316.8 From 565393eeebe9bb83f9a9e12cee2a749e3f4821ea Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Mon, 27 Jun 2022 23:25:23 +0200 Subject: [PATCH 22/26] better formatting --- eng/cake/dotnet.cake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 511a0e59cccc..3f82f5131f62 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -159,7 +159,7 @@ Task("dotnet-templates") var framework = string.IsNullOrWhiteSpace(TestTFM) ? "" : $"--framework {TestTFM}"; projectName = $"{tempDir}/{projectName}_{type}"; - projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM}"; + projectName += string.IsNullOrWhiteSpace(TestTFM) ? "" : $"_{TestTFM.Replace('.', '_')}"; // Create StartProcess(dn, $"new {templateName} -o \"{projectName}\" {framework}"); From ab144cdb83d7434db52022ddb8dc6411daa4b901 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 28 Jun 2022 00:11:44 +0200 Subject: [PATCH 23/26] The last version that worked --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index f0f58c8c9c69..9a844259e5b8 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -37,7 +37,7 @@ 6.0.5 6.0.6 - 7.0.0-preview1.22302.1 + 7.0.0-preview1.22274.2 3.3.3 3.3.3 6.0.403 From 4cf84007b8a37fb8e4356efb2b9d43ac42c3490b Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 28 Jun 2022 16:24:21 +0200 Subject: [PATCH 24/26] Due to a bug --- eng/pipelines/handlers.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 860514144f30..21f2b375a22d 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -104,8 +104,8 @@ parameters: default: - name: default tfm: default - - name: net6 - tfm: net6.0 + # - name: net6 + # tfm: net6.0 - name: net7 tfm: net7.0 From 37b67eff32ae8be4879866afc078062b444f5eec Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Tue, 28 Jun 2022 19:48:56 +0200 Subject: [PATCH 25/26] not much works --- eng/cake/dotnet.cake | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index 3f82f5131f62..37345e561744 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -169,22 +169,12 @@ Task("dotnet-templates") template.Value(projectName); // Enable Tizen - if (!TestTFM.StartsWith("net6")) // Tizen does not yet support net6 on the net7 SDK: https://github.com/Samsung/Tizen.NET/issues/182 - { - ReplaceTextInFiles($"{projectName}/*.csproj", - "", - ""); - } - else - { - // Mac Catalyst/iOS does not yet support net6 from the net7 SDK: https://github.com/xamarin/xamarin-macios/issues/15344 - ReplaceTextInFiles($"{projectName}/*.csproj", - ";net6.0-ios;net6.0-maccatalyst", - ""); - } + ReplaceTextInFiles($"{projectName}/*.csproj", + "", + ""); // Build RunMSBuildWithDotNet(projectName, properties, warningsAsError: true, forceDotNetBuild: forceDotNetBuild); From 8245fcb68306fa2b11e8d33877fb5c0a0a703387 Mon Sep 17 00:00:00 2001 From: Matthew Leibowitz Date: Thu, 7 Jul 2022 02:21:30 +0200 Subject: [PATCH 26/26] Try .net6.0 again --- Directory.Build.props | 4 ++-- eng/cake/dotnet.cake | 15 +++++++++++++++ eng/pipelines/handlers.yml | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index e5d767c79d98..53577df2bbc4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -25,8 +25,8 @@ true true + Exists('$(DOTNET_ROOT)\sdk-manifests\$(DotNetSdkManifestsFolder)\samsung.net.sdk.tizen\WorkloadManifest.json') or + Exists('$(ProgramFiles)\dotnet\sdk-manifests\$(DotNetSdkManifestsFolder)\samsung.net.sdk.tizen\WorkloadManifest.json')">true diff --git a/eng/cake/dotnet.cake b/eng/cake/dotnet.cake index afb1a420c480..b670072ed5c8 100644 --- a/eng/cake/dotnet.cake +++ b/eng/cake/dotnet.cake @@ -182,6 +182,21 @@ Task("dotnet-templates") " -->", ""); + // TODO: remove this once issues are fixed + if (TestTFM.StartsWith("net6")) + { + // Mac Catalyst/iOS does not yet support net6 from the net7 SDK. + ReplaceTextInFiles($"{projectName}/*.csproj", + ";net6.0-ios;net6.0-maccatalyst", + ""); + + // Android does not yet support net6 from the net7 SDK in Release builds + if (configuration == "Release") + ReplaceTextInFiles($"{projectName}/*.csproj", + "net6.0-android", + ""); + } + // Build RunMSBuildWithDotNet(projectName, properties, warningsAsError: true, forceDotNetBuild: forceDotNetBuild); diff --git a/eng/pipelines/handlers.yml b/eng/pipelines/handlers.yml index 21f2b375a22d..860514144f30 100644 --- a/eng/pipelines/handlers.yml +++ b/eng/pipelines/handlers.yml @@ -104,8 +104,8 @@ parameters: default: - name: default tfm: default - # - name: net6 - # tfm: net6.0 + - name: net6 + tfm: net6.0 - name: net7 tfm: net7.0