From 3fb8f0eb0ed919fc4204db3025cc2a77882b18ef Mon Sep 17 00:00:00 2001 From: Curtis Wensley Date: Tue, 28 Sep 2021 15:03:13 -0700 Subject: [PATCH] Support building with net6.0-macos - Default minimum macOS is 10.14 - Add net6.0 to template creation (net5.0 is still default) --- .vscode/launch.json | 10 +++++ .vscode/tasks.json | 2 +- build/Build.proj | 4 +- lib/monomac | 2 +- .../EmbedEtoInXamarinMac/Info.plist | 2 +- .../EmbedXamarinMacInEto/Info.plist | 2 +- .../App-CSharp/.template.config/template.json | 4 ++ .../content/App-CSharp/EtoApp.1/Info.plist | 2 +- .../Separate/EtoApp.1.Mac/Info.plist | 2 +- .../Separate/EtoApp.1.XamMac/Info.plist | 2 +- .../App-FSharp/.template.config/template.json | 4 ++ .../content/App-FSharp/EtoApp.1/Info.plist | 2 +- .../Separate/EtoApp.1.Mac/Info.plist | 2 +- .../Separate/EtoApp.1.XamMac/Info.plist | 2 +- .../.template.config/template.json | 4 ++ .../App-VisualBasic/EtoApp.1/Info.plist | 2 +- .../Separate/EtoApp.1.Mac/Info.plist | 2 +- .../Separate/EtoApp.1.XamMac/Info.plist | 2 +- src/Eto.Mac/Eto.Mac64.csproj | 2 +- src/Eto.Mac/Eto.XamMac2.csproj | 10 ++--- src/Eto.Mac/build/BundleDotNetCore.targets | 8 ++-- src/Eto.Mac/build/Mac.targets | 6 +-- src/Eto/sdk/Sdk.props | 2 +- src/Eto/sdk/Sdk.targets | 40 ++++++++++++++----- test/Eto.Test.Mac/Eto.Test.XamMac2.csproj | 4 +- test/Eto.Test.Mac/Info.plist | 2 +- 26 files changed, 86 insertions(+), 40 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index e31ba35a98..e6a79030a0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -25,6 +25,16 @@ }, { "name": "Eto.Test.XamMac2", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build-xammac2", + "program": "${workspaceFolder}/artifacts/test/${config:var.configuration}/net6.0-macos/osx-x64/Eto.Test.XamMac2.app/Contents/MacOS/Eto.Test.XamMac2", + "args": [], + "console": "internalConsole", + "internalConsoleOptions": "openOnSessionStart" + }, + { + "name": "Eto.Test.XamMac2 - mono", "type": "mono", "request": "launch", "preLaunchTask": "build-xammac2", diff --git a/.vscode/tasks.json b/.vscode/tasks.json index f51e946746..1db9fc91b3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -29,7 +29,7 @@ }, { "label": "build-templates", - "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${config:var.configuration} ${workspaceFolder}/src/Addins/Eto.Forms.Templates/Eto.Forms.Templates.csproj ; dotnet new -i ${workspaceFolder}/", + "command": "dotnet build ${config:var.buildProperties} /p:Configuration=${config:var.configuration} ${workspaceFolder}/src/Addins/Eto.Forms.Templates/Eto.Forms.Templates.csproj", "type": "shell", "problemMatcher": "$msCompile", "group": "build", diff --git a/build/Build.proj b/build/Build.proj index 3712afca49..49cc3a870f 100644 --- a/build/Build.proj +++ b/build/Build.proj @@ -190,7 +190,7 @@ - @@ -200,6 +200,7 @@ + @@ -216,6 +217,7 @@ + diff --git a/lib/monomac b/lib/monomac index ba29aabee3..b7e875b3b0 160000 --- a/lib/monomac +++ b/lib/monomac @@ -1 +1 @@ -Subproject commit ba29aabee3251956a7eea7a41ee8e94cda1546bf +Subproject commit b7e875b3b0786fb923e7d31b8b76e95097fdadb2 diff --git a/samples/XamarinMac/EmbedEtoInXamarinMac/Info.plist b/samples/XamarinMac/EmbedEtoInXamarinMac/Info.plist index f6f487b337..c95384b850 100644 --- a/samples/XamarinMac/EmbedEtoInXamarinMac/Info.plist +++ b/samples/XamarinMac/EmbedEtoInXamarinMac/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.10 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion diff --git a/samples/XamarinMac/EmbedXamarinMacInEto/Info.plist b/samples/XamarinMac/EmbedXamarinMacInEto/Info.plist index 7dfa9b772b..6287d31075 100644 --- a/samples/XamarinMac/EmbedXamarinMacInEto/Info.plist +++ b/samples/XamarinMac/EmbedXamarinMacInEto/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.10 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion diff --git a/src/Addins/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json b/src/Addins/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json index 4087f8717e..f4114c5793 100755 --- a/src/Addins/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json +++ b/src/Addins/Eto.Forms.Templates/content/App-CSharp/.template.config/template.json @@ -75,6 +75,10 @@ "defaultValue": "net5.0", "replaces": "net5.0", "choices": [ + { + "choice": "net6.0", + "description": ".NET 6.0" + }, { "choice": "net5.0", "description": ".NET 5.0" diff --git a/src/Addins/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/Info.plist index 758e3bd96f..b630d13bc6 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-CSharp/EtoApp.1/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/Info.plist index 19afa18f34..cf881cbdbc 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.Mac/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.XamMac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.XamMac/Info.plist index 085d2cddaf..9048d56c9f 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.XamMac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-CSharp/Separate/EtoApp.1.XamMac/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.10 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion diff --git a/src/Addins/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json b/src/Addins/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json index dc607ec88b..b30e4c481e 100755 --- a/src/Addins/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json +++ b/src/Addins/Eto.Forms.Templates/content/App-FSharp/.template.config/template.json @@ -75,6 +75,10 @@ "defaultValue": "net5.0", "replaces": "net5.0", "choices": [ + { + "choice": "net6.0", + "description": ".NET 6.0" + }, { "choice": "net5.0", "description": ".NET 5.0" diff --git a/src/Addins/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/Info.plist index 19afa18f34..cf881cbdbc 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-FSharp/EtoApp.1/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/Info.plist index 19afa18f34..cf881cbdbc 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.Mac/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.XamMac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.XamMac/Info.plist index a47f1676b7..541286e3f0 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.XamMac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-FSharp/Separate/EtoApp.1.XamMac/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.10 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion diff --git a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json index 49448a824c..5ab15ac0a8 100755 --- a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json +++ b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/.template.config/template.json @@ -75,6 +75,10 @@ "defaultValue": "net5.0", "replaces": "net5.0", "choices": [ + { + "choice": "net6.0", + "description": ".NET 6.0" + }, { "choice": "net5.0", "description": ".NET 5.0" diff --git a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/Info.plist index 758e3bd96f..b630d13bc6 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/EtoApp.1/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/Info.plist index 19afa18f34..cf881cbdbc 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.Mac/Info.plist @@ -9,7 +9,7 @@ CFBundleShortVersionString 1.0 LSMinimumSystemVersion - 10.12 + 10.14 CFBundleDevelopmentRegion en NSHumanReadableCopyright diff --git a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.XamMac/Info.plist b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.XamMac/Info.plist index 085d2cddaf..9048d56c9f 100644 --- a/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.XamMac/Info.plist +++ b/src/Addins/Eto.Forms.Templates/content/App-VisualBasic/Separate/EtoApp.1.XamMac/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.10 + 10.14 CFBundleDevelopmentRegion en CFBundleInfoDictionaryVersion diff --git a/src/Eto.Mac/Eto.Mac64.csproj b/src/Eto.Mac/Eto.Mac64.csproj index 2c464c3963..246fd9d497 100644 --- a/src/Eto.Mac/Eto.Mac64.csproj +++ b/src/Eto.Mac/Eto.Mac64.csproj @@ -12,7 +12,7 @@ Eto.Platform.Mac64 Eto.Forms - MonoMac 64-bit Platform - OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac with 64-bit mono + OS X Platform for the Eto.Forms UI Framework using the open-source MonoMac cross platform gui ui framework desktop monomac osx mac eto.forms This is the 64-bit MonoMac platform for Eto.Forms UI Framework. diff --git a/src/Eto.Mac/Eto.XamMac2.csproj b/src/Eto.Mac/Eto.XamMac2.csproj index 1599b4219e..030b2eacc5 100644 --- a/src/Eto.Mac/Eto.XamMac2.csproj +++ b/src/Eto.Mac/Eto.XamMac2.csproj @@ -2,10 +2,10 @@ True - net45 - $(TargetFrameworks);xamarinmac20 + net45;xamarinmac20 + $(TargetFrameworks);net6.0-macos Eto.Mac - $(DefineConstants);OSX;DESKTOP + $(DefineConstants);OSX;DESKTOP;XAMMAC;XAMMAC2;UNIFIED true build\* @@ -13,7 +13,7 @@ Eto.Platform.XamMac2 Eto.Forms - Xamarin.Mac (unified) Platform - OS X Platform for the Eto.Forms UI Framework using 64-bit Xamarin.Mac v2.0 (unified) + OS X Platform for the Eto.Forms UI Framework using Xamarin.Mac (unified) cross platform gui ui framework desktop osx xamarin.mac mac eto.forms This is the Xamarin.Mac2 (unified) platform for Eto.Forms UI Framework. @@ -57,6 +57,6 @@ You do not need to use any of the classes of this assembly (unless customizing t - + \ No newline at end of file diff --git a/src/Eto.Mac/build/BundleDotNetCore.targets b/src/Eto.Mac/build/BundleDotNetCore.targets index b38a136bc4..31e954afd9 100644 --- a/src/Eto.Mac/build/BundleDotNetCore.targets +++ b/src/Eto.Mac/build/BundleDotNetCore.targets @@ -67,7 +67,7 @@ - + @@ -82,8 +82,6 @@ - - @@ -98,7 +96,7 @@ - + @@ -110,7 +108,7 @@ - + diff --git a/src/Eto.Mac/build/Mac.targets b/src/Eto.Mac/build/Mac.targets index 0d98b25ec9..c6714a2b15 100644 --- a/src/Eto.Mac/build/Mac.targets +++ b/src/Eto.Mac/build/Mac.targets @@ -20,8 +20,8 @@ - - True + + True $([System.IO.Path]::GetFileName($(OutputAppPath.TrimEnd('/').TrimEnd('\')))) @@ -182,7 +182,7 @@ AddStringProperty("NSPrincipalClass", "NSApplication"); AddStringProperty("CFBundleName", MacBundleName); AddStringProperty("CFBundleExecutable", LauncherFile, true); - AddStringProperty("LSMinimumSystemVersion", "10.9"); + AddStringProperty("LSMinimumSystemVersion", "10.14"); if (!string.IsNullOrEmpty(MonoMinimumVersion)) { AddStringProperty("MonoMinimumVersion", MonoMinimumVersion); } diff --git a/src/Eto/sdk/Sdk.props b/src/Eto/sdk/Sdk.props index ddbcbe057a..fd3f817085 100755 --- a/src/Eto/sdk/Sdk.props +++ b/src/Eto/sdk/Sdk.props @@ -2,7 +2,7 @@ - WinExe + Exe diff --git a/src/Eto/sdk/Sdk.targets b/src/Eto/sdk/Sdk.targets index a553a26de4..6c68a01b0a 100755 --- a/src/Eto/sdk/Sdk.targets +++ b/src/Eto/sdk/Sdk.targets @@ -4,7 +4,6 @@ Windows True - win-x64;linux-x64;osx-x64 @@ -17,13 +16,34 @@ - - $(TargetFramework)-windows - xamarinmac20 + + + <_TfmSuffix Condition="$(BuildPlatform) == 'Wpf' or $(BuildPlatform) == 'Windows'">-windows + + <_TfmSuffix Condition="$(BuildPlatform) == 'XamMac2'">-macos + + WinExe + + + + + $(TargetFramework)$(_TfmSuffix) + + xamarinmac20 - - $(TargetFrameworks.Replace('net5.0;', '').Replace(';net5.0', ''));net5.0-windows + + + <_CurrentFrameworks>$(TargetFrameworks) + + + + $(TargetFrameworks);$([System.Text.RegularExpressions.Regex]::Match($(_CurrentFrameworks), '(?<=;|^)?(net4\d+)(?=;|$)')) + $(TargetFrameworks);net5.0$(_TfmSuffix) + + $(TargetFrameworks);xamarinmac20 + $(TargetFrameworks);net6.0$(_TfmSuffix) @@ -38,14 +58,16 @@ obj\ $(BaseIntermediateOutputPath) - $(IntermediateOutputPath)$(BuildPlatform)\ + $(IntermediateOutputPath)$(BuildPlatform)\$(Configuration)\ bin\ $(BaseOutputPath) - $(OutputPath)$(BuildPlatform)\ + $(OutputPath)$(BuildPlatform)\$(Configuration)\ + + win-x64;linux-x64;osx-x64 - + diff --git a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj index 92582daf08..52eb3fde22 100644 --- a/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj +++ b/test/Eto.Test.Mac/Eto.Test.XamMac2.csproj @@ -4,12 +4,14 @@ True Exe net472;xamarinmac20 + $(TargetFrameworks);net6.0-macos Eto.Test.Mac False False Mac Developer 3rd Party Mac Developer Installer --nowarn:2006 --nowarn:0176 + XAMMAC;XAMMAC2 @@ -46,6 +48,6 @@ - + \ No newline at end of file diff --git a/test/Eto.Test.Mac/Info.plist b/test/Eto.Test.Mac/Info.plist index 6ff546fa5a..13266823c2 100644 --- a/test/Eto.Test.Mac/Info.plist +++ b/test/Eto.Test.Mac/Info.plist @@ -11,7 +11,7 @@ CFBundleVersion 1 LSMinimumSystemVersion - 10.9 + 10.14 NSPrincipalClass NSApplication NSRequiresAquaSystemAppearance