From e58215f5252466d6faf2b497f742e31a4b611660 Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 5 Apr 2021 10:23:40 +0300 Subject: [PATCH] Cli: Check if CmsKit supported for target version --- .../Templates/App/AppTemplateBase.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index 5e0436d91a..286283f22c 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -169,12 +169,25 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.App steps.Add(new ChangePublicAuthPortStep()); } - if (!context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit")) + if (!context.BuildArgs.ExtraProperties.ContainsKey("without-cms-kit") && IsCmsKitSupportedForTargetVersion(context)) { context.Symbols.Add("CMS-KIT"); } } + private bool IsCmsKitSupportedForTargetVersion(ProjectBuildContext context) + { + if (string.IsNullOrWhiteSpace(context.BuildArgs.Version)) + { + // We'll return true after 4.3.0 stable release. see https://github.com/abpframework/abp/issues/8394 + // return true; + + return context.BuildArgs.ExtraProperties.ContainsKey(NewCommand.Options.Preview.Long); + } + + return SemanticVersion.Parse(context.BuildArgs.Version) > SemanticVersion.Parse("4.2.9"); + } + private static void ConfigureWithoutUi(ProjectBuildContext context, List steps) { steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web"));