diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b7986a8a35b..b61ea766dfe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -75,6 +75,11 @@ jobs: run: wget -qO- https://monogame.net/downloads/net9_mgfxc_wine_setup.sh | bash if: runner.os != 'Windows' + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + if: runner.os == 'macOS' + - name: Install required workloads run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -82,7 +87,7 @@ jobs: elif [ "$RUNNER_OS" == "Windows" ]; then dotnet.exe workload install android ios macos else - dotnet workload install android + dotnet workload install android macos ios fi shell: bash diff --git a/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj b/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj index 124189b2f9e..9da881f5e69 100644 --- a/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj +++ b/MonoGame.Framework.Content.Pipeline/MonoGame.Framework.Content.Pipeline.csproj @@ -73,9 +73,11 @@ - + + + diff --git a/Tools/MonoGame.Content.Builder.Editor.Launcher/MonoGame.Content.Builder.Editor.Launcher.Mac.csproj b/Tools/MonoGame.Content.Builder.Editor.Launcher/MonoGame.Content.Builder.Editor.Launcher.Mac.csproj index 006d6945544..cbff415303b 100644 --- a/Tools/MonoGame.Content.Builder.Editor.Launcher/MonoGame.Content.Builder.Editor.Launcher.Mac.csproj +++ b/Tools/MonoGame.Content.Builder.Editor.Launcher/MonoGame.Content.Builder.Editor.Launcher.Mac.csproj @@ -12,10 +12,11 @@ False mgcb-editor-mac true + osx-x64;osx-arm64 - + PreserveNewest MGCB Editor.app\%(RecursiveDir)%(Filename)%(Extension) diff --git a/Tools/MonoGame.Content.Builder.Editor/Common/PipelineController.cs b/Tools/MonoGame.Content.Builder.Editor/Common/PipelineController.cs index ee4dc19bf25..8f5dbb2764e 100644 --- a/Tools/MonoGame.Content.Builder.Editor/Common/PipelineController.cs +++ b/Tools/MonoGame.Content.Builder.Editor/Common/PipelineController.cs @@ -37,9 +37,14 @@ public partial class PipelineController : IController #if DEBUG Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "../../../MonoGame.Content.Builder/Debug/mgcb.dll"), Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "../../../../../../MonoGame.Content.Builder/Debug/mgcb.dll"), +#else +#if MAC + Path.Combine(Path.GetDirectoryName(System.AppContext.BaseDirectory) ?? "", "../../../MonoGame.Content.Builder/Release/mgcb.dll"), + Path.Combine(Path.GetDirectoryName(System.AppContext.BaseDirectory) ?? "", "../../../../../../MonoGame.Content.Builder/Release/mgcb.dll"), #else Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "../../../MonoGame.Content.Builder/Release/mgcb.dll"), Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? "", "../../../../../../MonoGame.Content.Builder/Release/mgcb.dll"), +#endif #endif }; @@ -108,7 +113,11 @@ private PipelineController(IView view) ProjectOpen = false; _templateItems = new List(); +#if MAC + var root = Path.GetDirectoryName(System.AppContext.BaseDirectory) ?? ""; +#else var root = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? ""; +#endif var templatesPath = Path.Combine(root, "Templates"); #if IDE diff --git a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Linux.csproj b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Linux.csproj index 63c620d9d39..d93c5881538 100644 --- a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Linux.csproj +++ b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Linux.csproj @@ -35,9 +35,9 @@ - - - + + + diff --git a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Mac.csproj b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Mac.csproj index 8ed9809e1a9..ccd40a1022c 100644 --- a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Mac.csproj +++ b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Mac.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net8.0-macos Major ..\..\Artifacts\MonoGame.Content.Builder.Editor\Mac MONOMAC;MAC @@ -11,9 +11,7 @@ false mgcb-editor-mac MGCB Editor - $(AssemblyTitle) - false - osx-x64 + osx-x64;osx-arm64 @@ -31,8 +29,10 @@ - - + + + + diff --git a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Windows.csproj b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Windows.csproj index c3d3da417a1..0524b84e90b 100644 --- a/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Windows.csproj +++ b/Tools/MonoGame.Content.Builder.Editor/MonoGame.Content.Builder.Editor.Windows.csproj @@ -30,8 +30,8 @@ - - + + diff --git a/Tools/MonoGame.Content.Builder.Editor/Platform/Mac/Styles.Mac.cs b/Tools/MonoGame.Content.Builder.Editor/Platform/Mac/Styles.Mac.cs index 7d0e57116f2..611fe815ae2 100644 --- a/Tools/MonoGame.Content.Builder.Editor/Platform/Mac/Styles.Mac.cs +++ b/Tools/MonoGame.Content.Builder.Editor/Platform/Mac/Styles.Mac.cs @@ -4,8 +4,8 @@ using Eto; using Eto.Mac.Forms; -using MonoMac.AppKit; -using MonoMac.Foundation; +using AppKit; +using Foundation; namespace MonoGame.Tools.Pipeline { diff --git a/Tools/MonoGame.Content.Builder.Editor/Program.cs b/Tools/MonoGame.Content.Builder.Editor/Program.cs index 8d02d3984f4..77ecc000a7c 100644 --- a/Tools/MonoGame.Content.Builder.Editor/Program.cs +++ b/Tools/MonoGame.Content.Builder.Editor/Program.cs @@ -28,7 +28,7 @@ public static void Main(string[] args) #elif WPF var app = new Application(Platforms.Wpf); #else - var app = new Application(Platforms.Mac64); + var app = new Application(Platforms.macOS); #endif app.Style = "PipelineTool"; diff --git a/build/BuildContext.cs b/build/BuildContext.cs index d67cc834b52..b2887c31f5c 100644 --- a/build/BuildContext.cs +++ b/build/BuildContext.cs @@ -114,6 +114,13 @@ public BuildContext(ICakeContext context) : base(context) Configuration = buildConfiguration, SelfContained = false }; + // SelfContained needs to be default for MacOS + DotNetPublishSettingsForMac = new DotNetPublishSettings + { + MSBuildSettings = DotNetMSBuildSettings, + Verbosity = DotNetVerbosity.Minimal, + Configuration = buildConfiguration + }; Console.WriteLine($"Version: {Version}"); Console.WriteLine($"RepositoryUrl: {repositoryUrl}"); @@ -142,6 +149,8 @@ public BuildContext(ICakeContext context) : base(context) public DotNetPublishSettings DotNetPublishSettings { get; } + public DotNetPublishSettings DotNetPublishSettingsForMac { get; } + public MSBuildSettings MSBuildSettings { get; } public MSBuildSettings MSPackSettings { get; } diff --git a/build/BuildToolsTasks/BuildMGCBEditorTask.cs b/build/BuildToolsTasks/BuildMGCBEditorTask.cs index 9a1abdf803e..c499dcb168f 100644 --- a/build/BuildToolsTasks/BuildMGCBEditorTask.cs +++ b/build/BuildToolsTasks/BuildMGCBEditorTask.cs @@ -22,7 +22,10 @@ public override void Run(BuildContext context) _ => "Linux" }; - context.DotNetPublish(context.GetProjectPath(ProjectType.MGCBEditor, platform), context.DotNetPublishSettings); + if (context.Environment.Platform.Family != PlatformFamily.OSX) + context.DotNetPublish(context.GetProjectPath(ProjectType.MGCBEditor, platform), context.DotNetPublishSettings); + else + context.DotNetPublish(context.GetProjectPath(ProjectType.MGCBEditor, platform), context.DotNetPublishSettingsForMac); context.DotNetPack(context.GetProjectPath(ProjectType.Tools, "MonoGame.Content.Builder.Editor.Launcher.Bootstrap"), context.DotNetPackSettings); context.DotNetPack(context.GetProjectPath(ProjectType.MGCBEditorLauncher, platform), context.DotNetPackSettings); }