Merge pull request #17953 from abpframework/EngincanV/cli-appnolayers-tests

CLI: Should not run `AppTemplateRemoveMongodbCollectionFixtureStep` in nolayers templates since they don't have test projects
pull/17954/head
liangshiwei 2 years ago committed by GitHub
commit 70c099b369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Volo.Abp.Cli.ProjectBuilding.Templates.App;
namespace Volo.Abp.Cli.ProjectBuilding.Building;
@ -35,4 +36,9 @@ public abstract class TemplateInfo
{
return Name.EndsWith("-pro", StringComparison.OrdinalIgnoreCase);
}
public bool IsNoLayer()
{
return Name is AppNoLayersTemplate.TemplateName or AppNoLayersProTemplate.TemplateName;
}
}

@ -8,6 +8,11 @@ public class AppTemplateRemoveMongodbCollectionFixtureStep : ProjectBuildPipelin
{
public override void Execute(ProjectBuildContext context)
{
if (context.Template.IsNoLayer())
{
return;
}
//MyCompanyName.MyProjectName.Application.Tests
RemoveFile(context, "/aspnet-core/test/MyCompanyName.MyProjectName.Application.Tests/MyProjectNameApplicationCollection.cs");
RemoveKeyword(context,

Loading…
Cancel
Save