diff --git a/Source/Tools/Flax.Build/Deploy/Deployer.cs b/Source/Tools/Flax.Build/Deploy/Deployer.cs index 5882bd366..6e5ccc390 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployer.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployer.cs @@ -66,12 +66,6 @@ namespace Flax.Deploy { Initialize(); - if (Configuration.DeployEditor) - { - BuildEditor(); - Deployment.Editor.Package(); - } - if (Configuration.DeployPlatforms) { if (Configuration.BuildPlatforms == null || Configuration.BuildPlatforms.Length == 0) @@ -94,6 +88,12 @@ namespace Flax.Deploy } } } + + if (Configuration.DeployEditor) + { + BuildEditor(); + Deployment.Editor.Package(); + } } catch (Exception ex) { @@ -183,6 +183,10 @@ namespace Flax.Deploy { if (Platform.IsPlatformSupported(platform, architecture)) { + Log.Info(string.Empty); + Log.Info($"Build {platform} {architecture} platform"); + Log.Info(string.Empty); + foreach (var configuration in Configurations) { FlaxBuild.Build(Globals.EngineRoot, "FlaxGame", platform, architecture, configuration); diff --git a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs index cfb2446c3..87a2ae340 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs @@ -127,6 +127,33 @@ namespace Flax.Deploy // Deploy project DeployFile(RootPath, OutputPath, "Flax.flaxproj"); + // When deploying Editor with Platforms at once then bundle them inside it + if (Configuration.DeployPlatforms && Platforms.PackagedPlatforms != null) + { + foreach (var platform in Platforms.PackagedPlatforms) + { + Log.Info(string.Empty); + Log.Info($"Bunding {platform} platform with Editor"); + Log.Info(string.Empty); + + string platformName = platform.ToString(); + string platformFiles = Path.Combine(Deployer.PackageOutputPath, platformName); + string platformData = Path.Combine(OutputPath, "Source", "Platforms", platformName); + if (Directory.Exists(platformFiles)) + { + // Copy deployed files + Utilities.DirectoryCopy(platformFiles, platformData); + } + else + { + // Extract deployed files + var packageZipPath = Path.Combine(Deployer.PackageOutputPath, platformName + ".zip"); + Log.Verbose(packageZipPath + " -> " + platformData); + System.IO.Compression.ZipFile.ExtractToDirectory(packageZipPath, platformData, true); + } + } + } + // Package Editor into macOS app if (Platform.BuildTargetPlatform == TargetPlatform.Mac) { @@ -167,6 +194,7 @@ namespace Flax.Deploy // Build a disk image var dmgPath = Path.Combine(Deployer.PackageOutputPath, "FlaxEditor.dmg"); + Log.Info(string.Empty); Log.Info("Building disk image..."); if (File.Exists(dmgPath)) File.Delete(dmgPath); @@ -178,7 +206,6 @@ namespace Flax.Deploy // Compress if (Configuration.DontCompress) return; - Log.Info(string.Empty); Log.Info("Compressing editor files..."); string editorPackageZipPath; diff --git a/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs b/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs index 832d6deb3..a2846aa14 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs @@ -10,8 +10,13 @@ namespace Flax.Deploy { public class Platforms { + internal static List PackagedPlatforms; + public static void Package(TargetPlatform platform) { + if (PackagedPlatforms == null) + PackagedPlatforms = new List(); + PackagedPlatforms.Add(platform); var platformsRoot = Path.Combine(Globals.EngineRoot, "Source", "Platforms"); Log.Info(string.Empty);