Browse Source

Merge branch 'dev' of https://github.com/abpframework/abp into dev

pull/2210/head
Musa Demir 7 years ago
parent
commit
682c8a17e1
  1. 15
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  2. 21
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/NamespaceHelper.cs
  3. 2
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html
  4. 4
      test-all.ps1

15
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -9,6 +9,7 @@ using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Args; using Volo.Abp.Cli.Args;
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.Utils;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
namespace Volo.Abp.Cli.Commands namespace Volo.Abp.Cli.Commands
@ -28,7 +29,9 @@ namespace Volo.Abp.Cli.Commands
public async Task ExecuteAsync(CommandLineArgs commandLineArgs) public async Task ExecuteAsync(CommandLineArgs commandLineArgs)
{ {
if (commandLineArgs.Target == null) var projectName = NamespaceHelper.NormalizeNamespace(commandLineArgs.Target);
if (projectName == null)
{ {
throw new CliUsageException( throw new CliUsageException(
"Project name is missing!" + "Project name is missing!" +
@ -36,9 +39,9 @@ namespace Volo.Abp.Cli.Commands
GetUsageInfo() GetUsageInfo()
); );
} }
Logger.LogInformation("Creating your project..."); Logger.LogInformation("Creating your project...");
Logger.LogInformation("Project name: " + commandLineArgs.Target); Logger.LogInformation("Project name: " + projectName);
var template = commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long); var template = commandLineArgs.Options.GetOrNull(Options.Template.Short, Options.Template.Long);
if (template != null) if (template != null)
@ -73,7 +76,7 @@ namespace Volo.Abp.Cli.Commands
var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long); var outputFolder = commandLineArgs.Options.GetOrNull(Options.OutputFolder.Short, Options.OutputFolder.Long);
outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(), outputFolder = Path.Combine(outputFolder != null ? Path.GetFullPath(outputFolder) : Directory.GetCurrentDirectory(),
SolutionName.Parse(commandLineArgs.Target).FullName); SolutionName.Parse(projectName).FullName);
if (!Directory.Exists(outputFolder)) if (!Directory.Exists(outputFolder))
{ {
@ -86,7 +89,7 @@ namespace Volo.Abp.Cli.Commands
var result = await TemplateProjectBuilder.BuildAsync( var result = await TemplateProjectBuilder.BuildAsync(
new ProjectBuildArgs( new ProjectBuildArgs(
SolutionName.Parse(commandLineArgs.Target), SolutionName.Parse(projectName),
template, template,
version, version,
databaseProvider, databaseProvider,
@ -129,7 +132,7 @@ namespace Volo.Abp.Cli.Commands
} }
} }
Logger.LogInformation($"'{commandLineArgs.Target}' has been successfully created to '{outputFolder}'"); Logger.LogInformation($"'{projectName}' has been successfully created to '{outputFolder}'");
} }
public string GetUsageInfo() public string GetUsageInfo()

21
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Utils/NamespaceHelper.cs

@ -0,0 +1,21 @@
using System.Text.RegularExpressions;
using JetBrains.Annotations;
namespace Volo.Abp.Cli.Utils
{
public static class NamespaceHelper
{
public static string NormalizeNamespace([CanBeNull] string value)
{
if (string.IsNullOrEmpty(value))
{
return value;
}
value = value.Trim();
value = Regex.Replace(value, @"(((?<=\.)|^)((?=\d)|\.)|[^\w\.])|(\.$)", "_");
return value;
}
}
}

2
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.html

@ -158,7 +158,7 @@
</ng-template> </ng-template>
<ng-template #language> <ng-template #language>
<li class="nav-item"> <li *ngIf="(dropdownLanguages$ | async)?.length > 1" class="nav-item">
<div class="dropdown" ngbDropdown #languageDropdown="ngbDropdown" display="static"> <div class="dropdown" ngbDropdown #languageDropdown="ngbDropdown" display="static">
<a <a
ngbDropdownToggle ngbDropdownToggle

4
test-all.ps1

@ -23,12 +23,12 @@ $solutionPaths = (
"templates/app/aspnet-core" "templates/app/aspnet-core"
) )
# Build all solutions # Test all solutions
foreach ($solutionPath in $solutionPaths) { foreach ($solutionPath in $solutionPaths) {
$solutionAbsPath = (Join-Path $rootFolder $solutionPath) $solutionAbsPath = (Join-Path $rootFolder $solutionPath)
Set-Location $solutionAbsPath Set-Location $solutionAbsPath
dotnet test dotnet test --no-build --no-restore
if (-Not $?) { if (-Not $?) {
Write-Host ("Test failed for the solution: " + $solutionPath) Write-Host ("Test failed for the solution: " + $solutionPath)
Set-Location $rootFolder Set-Location $rootFolder

Loading…
Cancel
Save