From f154bfcfc1a16e6e0e67d8d738b7a1aa1a30e6de Mon Sep 17 00:00:00 2001 From: Crawcik Date: Wed, 7 Sep 2022 18:15:14 +0200 Subject: [PATCH] Flax.Build compress toogle option --- Source/Tools/Flax.Build/Configuration.cs | 6 ++++++ Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs | 3 +++ Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs | 7 ++++--- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Source/Tools/Flax.Build/Configuration.cs b/Source/Tools/Flax.Build/Configuration.cs index 55f3d138d..4c3f63b0c 100644 --- a/Source/Tools/Flax.Build/Configuration.cs +++ b/Source/Tools/Flax.Build/Configuration.cs @@ -39,6 +39,12 @@ namespace Flax.Build [CommandLine("deploy", "Runs the deploy tool.")] public static bool Deploy = false; + /// + /// Compresses deployed files. + /// + [CommandLine("deployDontCompress", "Skips compressing deployed files, and keeps files.")] + public static bool DontCompress = false; + /// /// Builds the targets. Builds all the targets, use to select a custom set of targets for the build. /// diff --git a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs index 6a5e2fb04..885282745 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployment.Editor.cs @@ -127,6 +127,9 @@ namespace Flax.Deploy DeployFile(RootPath, OutputPath, "Flax.flaxproj"); // 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 78e6183bb..9a6d372d2 100644 --- a/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs +++ b/Source/Tools/Flax.Build/Deploy/Deployment.Platforms.cs @@ -63,6 +63,7 @@ namespace Flax.Deploy } // Compress + if (!Configuration.DontCompress) { Log.Info("Compressing platform files..."); @@ -84,10 +85,10 @@ namespace Flax.Deploy #endif Log.Info(string.Format("Compressed {0} package size: {1}", platformName, Utilities.GetFileSize(packageZipPath))); - } - // Remove files (only zip package is used) - Utilities.DirectoryDelete(dst); + // Remove files (only zip package is used) + Utilities.DirectoryDelete(dst); + } Log.Info(string.Empty); }