From 96a521a55b521d9f505b467409f89c51271778ce Mon Sep 17 00:00:00 2001 From: Yunus Emre Kalkan Date: Mon, 20 Jun 2022 11:31:47 +0300 Subject: [PATCH] Cli: Build the project if needed when generating code with Suite --- .../Volo/Abp/Cli/Commands/SuiteCommand.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs index 6ee6a74a47..060262eb93 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/SuiteCommand.cs @@ -116,6 +116,18 @@ public class SuiteCommand : IConsoleCommand, ITransientDependency return; } + var IsSolutionBuiltResponse = await client.GetAsync( + $"{AbpSuiteHost}/api/abpSuite/solutions/{solutionId.ToString()}/is-built" + ); + + var IsSolutionBuilt = Convert.ToBoolean(await IsSolutionBuiltResponse.Content.ReadAsStringAsync()); + + if (!IsSolutionBuilt) + { + Logger.LogInformation("Building the solution..."); + CmdHelper.RunCmd("dotnet build", Path.GetDirectoryName(solutionFile)); + } + var entityContent = new StringContent( File.ReadAllText(entityFile), Encoding.UTF8,