pull/1600/head
Yunus Emre Kalkan 6 years ago
commit 302cd0f2f9

@ -49,14 +49,14 @@ abp new Acme.BookStore
* `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers:
* `ef`: Entity Framework Core.
* `mongodb`: MongoDB.
* `mvc-module`: ASP.NET Core [module template](Startup-Templates/Mvc-Module.md). Additional options:
* `module`: [Module template](Startup-Templates/Module.md). Additional options:
* `--no-ui`: Specifies to not include the UI. This makes possible to create service-only modules (a.k.a. microservices - without UI).
* `--output-folder` or `-o`: Specifies the output folder. Default value is the current directory.
* `--version` or `-v`: Specifies the ABP & template version. It can be a [release tag](https://github.com/abpframework/abp/releases) or a [branch name](https://github.com/abpframework/abp/branches). Uses the latest release if not specified. Most of the times, you will want to use the latest version.
### add-package
Adds a new ABP package to a project by,
Adds an ABP package to a project by,
* Adding related nuget package as a dependency to the project.
* Adding `[DependsOn(...)]` attribute to the module class in the project (see the [module development document](Module-Development-Basics.md)).
@ -83,9 +83,9 @@ abp add-package Volo.Abp.MongoDB
### add-module
Adds a multi-package module to a solution by finding all packages of the module, finding related projects in the solution and adding each package to the corresponding project in the solution.
Adds a [multi-package application module](Modules/Index) to a solution by finding all packages of the module, finding related projects in the solution and adding each package to the corresponding project in the solution.
> A business module generally consists of several packages (because of layering, different database providr options or other reasons). Using `add-module` command dramatically simplifies adding a module to a solution. However, each module may require some additional configurations which is generally indicated in the documentation of the related module.
> A business module generally consists of several packages (because of layering, different database provider options or other reasons). Using `add-module` command dramatically simplifies adding a module to a solution. However, each module may require some additional configurations which is generally indicated in the documentation of the related module.
Basic usage:

@ -3,7 +3,7 @@
While you can start with an empty project and add needed packages manually, startup templates make easy and comfortable to start a new solution with the ABP framework. Click the name from the list below to see the documentation of the related startup template:
* [**app**](Application.md): Application template.
* [**mvc-module**](Mvc-Module.md): Module/service template.
* [**module**](Module.md): Module/service template.

@ -15,14 +15,14 @@ dotnet tool install -g Volo.Abp.Cli
Then use the `abp new` command in an empty folder to create a new solution:
```bash
abp new Acme.IssueManagement -t mvc-module
abp new Acme.IssueManagement -t module
```
- `Acme.IssueManagement` is the solution name, like *YourCompany.YourProduct*. You can use single level, two-levels or three-levels naming.
### Without User Interface
The template comes with a UI by default. You can use `--no-ui` option to not include the UI layer.
The template comes with an MVC UI by default. You can use `--no-ui` option to not include the UI layer.
````bash
abp new Acme.IssueManagement -t mvc-module --no-ui
@ -119,7 +119,7 @@ You can still create unit tests for your classes which will be harder to write (
### Host Projects
The solution has a few host applications to run your module on development. Host applications are used to run your module in a fully configured application. It is useful on development. Host applications includes some other modules in addition to the module being developed:
The solution has a few host applications to run your module. Host applications are used to run your module in a fully configured application. It is useful on development. Host applications includes some other modules in addition to the module being developed:
Host applications support two types of scenarios.

@ -133,8 +133,8 @@ namespace Volo.Abp.Cli.Commands
sb.AppendLine(" abp new Acme.BookStore -u angular -d mongodb");
sb.AppendLine(" abp new Acme.BookStore -d mongodb");
sb.AppendLine(" abp new Acme.BookStore -d mongodb -o d:\\my-project");
sb.AppendLine(" abp new Acme.BookStore -t mvc-module");
sb.AppendLine(" abp new Acme.BookStore -t mvc-module no-ui");
sb.AppendLine(" abp new Acme.BookStore -t module");
sb.AppendLine(" abp new Acme.BookStore -t module no-ui");
sb.AppendLine("");
sb.AppendLine("See the documentation for more info: https://docs.abp.io/en/abp/latest/CLI");

@ -19,8 +19,8 @@ namespace Volo.Abp.Cli.ProjectBuilding
{
case AppTemplate.TemplateName:
return new AppTemplate();
case MvcModuleTemplate.TemplateName:
return new MvcModuleTemplate();
case ModuleTemplate.TemplateName:
return new ModuleTemplate();
default:
throw new Exception("There is no template found with given name: " + name);
}

@ -4,17 +4,17 @@ using Volo.Abp.Cli.ProjectBuilding.Building.Steps;
namespace Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule
{
public class MvcModuleTemplate : TemplateInfo
public class ModuleTemplate : TemplateInfo
{
/// <summary>
/// "mvc-module".
/// "module".
/// </summary>
public const string TemplateName = "mvc-module";
public const string TemplateName = "module";
public MvcModuleTemplate()
public ModuleTemplate()
: base(TemplateName)
{
DocumentUrl = "https://docs.abp.io/en/abp/latest/Startup-Templates/Mvc-Module";
DocumentUrl = "https://docs.abp.io/en/abp/latest/Startup-Templates/Module";
}
public override IEnumerable<ProjectBuildPipelineStep> GetCustomSteps(ProjectBuildContext context)
@ -22,14 +22,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule
var steps = new List<ProjectBuildPipelineStep>();
DeleteUnrelatedProjects(context, steps);
steps.Add(new TemplateRandomSslPortStep(new List<string>
{
"https://localhost:44300",
"https://localhost:44301",
"https://localhost:44302",
"https://localhost:44303"
}));
RandomizeSslPorts(context, steps);
CleanupFolderHierarchy(context, steps);
return steps;
}
@ -44,14 +38,30 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.MvcModule
steps.Add(new RemoveProjectFromSolutionStep(
"MyCompanyName.MyProjectName.Web.Host",
projectFolderPath: "/host/MyCompanyName.MyProjectName.Web.Host"
projectFolderPath: "/aspnet-core/host/MyCompanyName.MyProjectName.Web.Host"
));
steps.Add(new RemoveProjectFromSolutionStep(
"MyCompanyName.MyProjectName.Web.Unified",
projectFolderPath: "/host/MyCompanyName.MyProjectName.Web.Unified"
projectFolderPath: "/aspnet-core/host/MyCompanyName.MyProjectName.Web.Unified"
));
}
}
private void RandomizeSslPorts(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
steps.Add(new TemplateRandomSslPortStep(new List<string>
{
"https://localhost:44300",
"https://localhost:44301",
"https://localhost:44302",
"https://localhost:44303"
}));
}
private void CleanupFolderHierarchy(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)
{
steps.Add(new MoveFolderStep("/aspnet-core/", "/"));
}
}
}

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
</Project>

@ -12,7 +12,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
</Project>

@ -13,9 +13,9 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
</ItemGroup>
</Project>

@ -1,4 +1,5 @@
using Mongo2Go;
using System;
using Mongo2Go;
using Volo.Abp;
using Volo.Abp.Data;
using Volo.Abp.Modularity;
@ -19,7 +20,7 @@ namespace MyCompanyName.MyProjectName.MongoDB
Configure<DbConnectionOptions>(options =>
{
options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString + "|MyProjectName";
options.ConnectionStrings.Default = _mongoDbRunner.ConnectionString.EnsureEndsWith('/') + "MyProjectName";
});
}

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Mongo2Go" Version="2.2.11" />
</ItemGroup>

@ -15,8 +15,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="NSubstitute" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application.Tests\MyCompanyName.MyProjectName.Application.Tests.csproj" />
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.Web\MyCompanyName.MyProjectName.Web.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.TestBase\Volo.Abp.AspNetCore.TestBase.csproj" />

@ -15,9 +15,4 @@
<ProjectReference Include="..\MyCompanyName.MyProjectName.Domain.Shared\MyCompanyName.MyProjectName.Domain.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\MyProjectName\ApplicationContracts\*.json" />
<Content Remove="Localization\MyProjectName\ApplicationContracts\*.json" />
</ItemGroup>
</Project>

@ -1,6 +1,4 @@
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.Application;
using Volo.Abp.Localization;
using Volo.Abp.Application;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
@ -18,13 +16,6 @@ namespace MyCompanyName.MyProjectName
{
options.FileSets.AddEmbedded<MyProjectNameApplicationContractsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<MyProjectNameResource>()
.AddVirtualJson("/Localization/MyProjectName/ApplicationContracts");
});
}
}
}

@ -12,8 +12,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\MyProjectName\DomainShared\*.json" />
<Content Remove="Localization\MyProjectName\DomainShared\*.json" />
<EmbeddedResource Include="Localization\MyProjectName\*.json" />
<Content Remove="Localization\MyProjectName\*.json" />
</ItemGroup>
</Project>

@ -24,7 +24,7 @@ namespace MyCompanyName.MyProjectName
options.Resources
.Add<MyProjectNameResource>("en")
.AddBaseTypes(typeof(AbpValidationResource))
.AddVirtualJson("/Localization/MyProjectName/DomainShared");
.AddVirtualJson("/Localization/MyProjectName");
});
Configure<ExceptionLocalizationOptions>(options =>

@ -1,4 +1,7 @@
using Volo.Abp.AspNetCore.Mvc;
using Localization.Resources.AbpUi;
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
namespace MyCompanyName.MyProjectName
@ -8,6 +11,14 @@ namespace MyCompanyName.MyProjectName
typeof(AbpAspNetCoreMvcModule))]
public class MyProjectNameHttpApiModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<MyProjectNameResource>()
.AddBaseTypes(typeof(AbpUiResource));
});
}
}
}

@ -20,10 +20,8 @@
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\MyProjectName\Web\*.json" />
<EmbeddedResource Include="Pages\**\*.*" Exclude="*.cs" />
<EmbeddedResource Include="wwwroot\**\*.*" />
<Content Remove="Localization\MyProjectName\Web\*.json" />
<Content Remove="Pages\**\*.cshtml" />
<Content Remove="Pages\**\*.css" />
<Content Remove="Pages\**\*.js" />

@ -1,11 +1,9 @@
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
using Volo.Abp.AutoMapper;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
@ -39,14 +37,6 @@ namespace MyCompanyName.MyProjectName.Web
options.FileSets.AddEmbedded<MyProjectNameWebModule>("MyCompanyName.MyProjectName");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<MyProjectNameResource>()
.AddBaseTypes(typeof(AbpUiResource))
.AddVirtualJson("/Localization/MyProjectName/Web");
});
Configure<AbpAutoMapperOptions>(options =>
{
/* Using `true` for the `validate` parameter to

@ -13,7 +13,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
</Project>

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
<ItemGroup>

@ -8,10 +8,10 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="2.2.6" />
</ItemGroup>
<ItemGroup>

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="Mongo2Go" Version="2.2.11" />
</ItemGroup>

@ -8,8 +8,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" />
<PackageReference Include="NSubstitute" Version="4.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="NSubstitute" Version="4.2.1" />
<PackageReference Include="Shouldly" Version="3.0.2" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />

Loading…
Cancel
Save