|
|
@ -8,12 +8,14 @@ using System.Text; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging.Abstractions; |
|
|
using Microsoft.Extensions.Logging.Abstractions; |
|
|
|
|
|
using StackExchange.Redis; |
|
|
using Volo.Abp.Cli.Args; |
|
|
using Volo.Abp.Cli.Args; |
|
|
using Volo.Abp.Cli.Bundling; |
|
|
using Volo.Abp.Cli.Bundling; |
|
|
using Volo.Abp.Cli.Commands.Services; |
|
|
using Volo.Abp.Cli.Commands.Services; |
|
|
using Volo.Abp.Cli.LIbs; |
|
|
using Volo.Abp.Cli.LIbs; |
|
|
using Volo.Abp.Cli.ProjectBuilding; |
|
|
using Volo.Abp.Cli.ProjectBuilding; |
|
|
using Volo.Abp.Cli.ProjectBuilding.Building; |
|
|
using Volo.Abp.Cli.ProjectBuilding.Building; |
|
|
|
|
|
using Volo.Abp.Cli.ProjectBuilding.Templates.App; |
|
|
using Volo.Abp.Cli.ProjectModification; |
|
|
using Volo.Abp.Cli.ProjectModification; |
|
|
using Volo.Abp.Cli.Utils; |
|
|
using Volo.Abp.Cli.Utils; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
@ -89,6 +91,8 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien |
|
|
|
|
|
|
|
|
var projectArgs = await GetProjectBuildArgsAsync(commandLineArgs, template, projectName); |
|
|
var projectArgs = await GetProjectBuildArgsAsync(commandLineArgs, template, projectName); |
|
|
|
|
|
|
|
|
|
|
|
await CheckCreatingRequirements(projectArgs); |
|
|
|
|
|
|
|
|
var result = await TemplateProjectBuilder.BuildAsync( |
|
|
var result = await TemplateProjectBuilder.BuildAsync( |
|
|
projectArgs |
|
|
projectArgs |
|
|
); |
|
|
); |
|
|
@ -97,6 +101,8 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien |
|
|
|
|
|
|
|
|
Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'"); |
|
|
Logger.LogInformation($"'{projectName}' has been successfully created to '{projectArgs.OutputFolder}'"); |
|
|
|
|
|
|
|
|
|
|
|
await CheckCreatedRequirements(projectArgs); |
|
|
|
|
|
|
|
|
ConfigureNpmPackagesForTheme(projectArgs); |
|
|
ConfigureNpmPackagesForTheme(projectArgs); |
|
|
await CreateOpenIddictPfxFilesAsync(projectArgs); |
|
|
await CreateOpenIddictPfxFilesAsync(projectArgs); |
|
|
await RunGraphBuildForMicroserviceServiceTemplate(projectArgs); |
|
|
await RunGraphBuildForMicroserviceServiceTemplate(projectArgs); |
|
|
@ -120,6 +126,46 @@ public class NewCommand : ProjectCreationCommandBase, IConsoleCommand, ITransien |
|
|
OpenRelatedWebPage(projectArgs, template, isTiered, commandLineArgs); |
|
|
OpenRelatedWebPage(projectArgs, template, isTiered, commandLineArgs); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Task CheckCreatingRequirements(ProjectBuildArgs projectArgs) |
|
|
|
|
|
{ |
|
|
|
|
|
return Task.CompletedTask; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private async Task CheckCreatedRequirements(ProjectBuildArgs projectArgs) |
|
|
|
|
|
{ |
|
|
|
|
|
var errors = new List<string>(); |
|
|
|
|
|
|
|
|
|
|
|
if (projectArgs.ExtraProperties.ContainsKey("PreRequirements:Redis")) |
|
|
|
|
|
{ |
|
|
|
|
|
var isConnected = false; |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var redis = await ConnectionMultiplexer.ConnectAsync("127.0.0.1", options => options.ConnectTimeout = 3000); |
|
|
|
|
|
isConnected = redis.IsConnected; |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception e) |
|
|
|
|
|
{ |
|
|
|
|
|
// ignored
|
|
|
|
|
|
} |
|
|
|
|
|
finally |
|
|
|
|
|
{ |
|
|
|
|
|
if (!isConnected) |
|
|
|
|
|
{ |
|
|
|
|
|
errors.Add("\t* Redis is not installed or not running on your computer."); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (errors.Any()) |
|
|
|
|
|
{ |
|
|
|
|
|
Logger.LogWarning("NOTICE: The following tools are required to run your solution."); |
|
|
|
|
|
foreach (var error in errors) |
|
|
|
|
|
{ |
|
|
|
|
|
Logger.LogWarning(error); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public string GetUsageInfo() |
|
|
public string GetUsageInfo() |
|
|
{ |
|
|
{ |
|
|
var sb = new StringBuilder(); |
|
|
var sb = new StringBuilder(); |
|
|
|