From 5181db8a0e2f057be0051b3d107516c002e58fb7 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 18 Oct 2023 21:51:36 +0200 Subject: [PATCH 1/3] Fix vscode default build task to favor current architecture (eg. arm64 for Editor on macOS) --- .../VisualStudioCode/VisualStudioCodeProjectGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Tools/Flax.Build/Projects/VisualStudioCode/VisualStudioCodeProjectGenerator.cs b/Source/Tools/Flax.Build/Projects/VisualStudioCode/VisualStudioCodeProjectGenerator.cs index a044adc0a..5c4b2dbe0 100644 --- a/Source/Tools/Flax.Build/Projects/VisualStudioCode/VisualStudioCodeProjectGenerator.cs +++ b/Source/Tools/Flax.Build/Projects/VisualStudioCode/VisualStudioCodeProjectGenerator.cs @@ -172,7 +172,7 @@ namespace Flax.Build.Projects.VisualStudioCode json.AddField("label", name); - bool isDefaultTask = defaultTask && configuration.Configuration == TargetConfiguration.Development && configuration.Platform == Platform.BuildPlatform.Target; + bool isDefaultTask = defaultTask && configuration.Configuration == TargetConfiguration.Development && configuration.Platform == Platform.BuildPlatform.Target && configuration.Architecture == Platform.BuildTargetArchitecture; json.BeginObject("group"); { From f373c867a734dfaa36d9dbd627be73966b3938f7 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 18 Oct 2023 21:57:35 +0200 Subject: [PATCH 2/3] Improve Game Cooker label text when platform data is missing --- Source/Editor/Windows/GameCookerWindow.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/Source/Editor/Windows/GameCookerWindow.cs b/Source/Editor/Windows/GameCookerWindow.cs index 5ece067a0..2ef9c05cf 100644 --- a/Source/Editor/Windows/GameCookerWindow.cs +++ b/Source/Editor/Windows/GameCookerWindow.cs @@ -155,29 +155,42 @@ namespace FlaxEditor.Windows public virtual void OnNotAvailableLayout(LayoutElementsContainer layout) { - layout.Label("Missing platform data tools for the target platform.", TextAlignment.Center); + string text = "Missing platform data tools for the target platform."; if (FlaxEditor.Editor.IsOfficialBuild()) { switch (BuildPlatform) { +#if PLATFORM_WINDOWS case BuildPlatform.Windows32: case BuildPlatform.Windows64: case BuildPlatform.UWPx86: case BuildPlatform.UWPx64: case BuildPlatform.LinuxX64: case BuildPlatform.AndroidARM64: - layout.Label("Use Flax Launcher and download the required package.", TextAlignment.Center); + text += "\nUse Flax Launcher and download the required package."; break; +#endif default: - layout.Label("Engine source is required to target this platform.", TextAlignment.Center); + text += "\nEngine source is required to target this platform."; break; } } else { - var label = layout.Label("To target this platform separate engine source package is required.\nTo get access please contact via https://flaxengine.com/contact", TextAlignment.Center); - label.Label.AutoHeight = true; + text += "\nTo target this platform separate engine source package is required."; + switch (BuildPlatform) + { + case BuildPlatform.XboxOne: + case BuildPlatform.XboxScarlett: + case BuildPlatform.PS4: + case BuildPlatform.PS5: + case BuildPlatform.Switch: + text += "\nTo get access please contact via https://flaxengine.com/contact"; + break; + } } + var label = layout.Label(text, TextAlignment.Center); + label.Label.AutoHeight = true; } public virtual void Build() From 6c45141ef9d89b2ef654500d37906d05582cc8cb Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 18 Oct 2023 22:10:46 +0200 Subject: [PATCH 3/3] Add dmg file building for macOS Editor deployment --- Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs index 91da6d83d..cfb2446c3 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs @@ -164,6 +164,15 @@ namespace Flax.Deploy var defaultEditorConfig = "Development"; var ediotrBinariesPath = Path.Combine(appContentsPath, "Binaries/Editor/Mac", defaultEditorConfig); Utilities.DirectoryCopy(ediotrBinariesPath, appBinariesPath, true, true); + + // Build a disk image + var dmgPath = Path.Combine(Deployer.PackageOutputPath, "FlaxEditor.dmg"); + Log.Info("Building disk image..."); + if (File.Exists(dmgPath)) + File.Delete(dmgPath); + Utilities.Run("hdiutil", $"create -srcFolder \"{appPath}\" -o \"{dmgPath}\"", null, null, Utilities.RunOptions.Default | Utilities.RunOptions.ThrowExceptionOnError); + CodeSign(dmgPath); + Log.Info("Output disk image size: " + Utilities.GetFileSize(dmgPath)); } // Compress