diff --git a/docs/en/CLI-New-Command-Samples.md b/docs/en/CLI-New-Command-Samples.md index 614fb24a5f..26d098c98e 100644 --- a/docs/en/CLI-New-Command-Samples.md +++ b/docs/en/CLI-New-Command-Samples.md @@ -1,6 +1,6 @@ # ABP CLI - New Solution Sample Commands -The `abp new` command creates an ABP solution or other artifacts based on an ABP template. [ABP CLI](CLI.md) has several parameters to create a new ABP solution. In this document we will show you some sample commands to create a new solution. All the project names are `Acme.BookStore`. Currently, the only available mobile project is a `React Native` mobile app. Available database providers are `Entity Framework Core` and `MongoDB`. All the commands starts with `abp new`. +The `abp new` command creates an ABP solution or other artifacts based on an ABP template. [ABP CLI](CLI.md) has several parameters to create a new ABP solution. In this document we will show you some sample commands to create a new solution. All the project names are `Acme.BookStore`. Currently, the available mobile projects are `React Native` and `MAUI` mobile app. Available database providers are `Entity Framework Core` and `MongoDB`. All the commands starts with `abp new`. ## Angular diff --git a/docs/en/CLI.md b/docs/en/CLI.md index ffde52eff0..8dc6d425dc 100644 --- a/docs/en/CLI.md +++ b/docs/en/CLI.md @@ -124,6 +124,7 @@ For more samples, go to [ABP CLI Create Solution Samples](CLI-New-Command-Sample * `--separate-auth-server`: The Identity Server project comes as a separate project and runs at a different endpoint. It separates the Identity Server from the API Host application. If not specified, you will have a single endpoint in the server side. * `--mobile` or `-m`: Specifies the mobile application framework. If not specified, no mobile application will be created. Available options: * `react-native`: React Native. + * `maui`: MAUI. * `--database-provider` or `-d`: Specifies the database provider. Default provider is `ef`. Available providers: * `ef`: Entity Framework Core. * `mongodb`: MongoDB. diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs index 33716d8383..229831141e 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/AbpAspNetCoreComponentsWebAssemblyModule.cs @@ -7,6 +7,7 @@ using Volo.Abp.AspNetCore.Components.Web; using Volo.Abp.AspNetCore.Components.Web.ExceptionHandling; using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.AspNetCore.Mvc.Client; +using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; using Volo.Abp.Threading; @@ -46,8 +47,8 @@ public class AbpAspNetCoreComponentsWebAssemblyModule : AbpModule public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { - await context.ServiceProvider.GetRequiredService().InitializeAsync(); - await context.ServiceProvider.GetRequiredService().InitializeAsync(); + await context.ServiceProvider.GetRequiredService().ServiceProvider.GetRequiredService().InitializeAsync(); + await context.ServiceProvider.GetRequiredService().ServiceProvider.GetRequiredService().InitializeAsync(); await SetCurrentLanguageAsync(context.ServiceProvider); } diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs index 7a9168eefb..1d95297a88 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc.Client/Volo/Abp/AspNetCore/Mvc/Client/AbpAspNetCoreMvcClientModule.cs @@ -1,5 +1,6 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.DependencyInjection; using Volo.Abp.EventBus; using Volo.Abp.Modularity; using Volo.Abp.Threading; @@ -19,6 +20,6 @@ public class AbpAspNetCoreMvcClientModule : AbpModule public async override Task OnApplicationInitializationAsync(ApplicationInitializationContext context) { - await context.ServiceProvider.GetRequiredService().InitializeAsync(); + await context.ServiceProvider.GetRequiredService().ServiceProvider.GetRequiredService().InitializeAsync(); } } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs index 026b4ca48c..a30b16ee41 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/ProjectCreationCommandBase.cs @@ -493,6 +493,8 @@ public abstract class ProjectCreationCommandBase return MobileApp.None; case "react-native": return MobileApp.ReactNative; + case "maui": + return MobileApp.Maui; default: throw new CliUsageException(ExceptionMessageHelper.GetInvalidOptionExceptionMessage("Mobile App")); } diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs index 882cb9166c..641740bce0 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/MobileApp.cs @@ -7,7 +7,8 @@ namespace Volo.Abp.Cli.ProjectBuilding.Building; public enum MobileApp { None, - ReactNative + ReactNative, + Maui } public static class MobileAppExtensions @@ -18,6 +19,8 @@ public static class MobileAppExtensions { case MobileApp.ReactNative: return "react-native"; + case MobileApp.Maui: + return "MAUI"; } throw new Exception("Mobile app folder name is not set!"); diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs index fb1fc79399..397a35222a 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/App/AppTemplateBase.cs @@ -5,6 +5,7 @@ using NuGet.Versioning; using Volo.Abp.Cli.Commands; using Volo.Abp.Cli.ProjectBuilding.Building; using Volo.Abp.Cli.ProjectBuilding.Building.Steps; +using Volo.Abp.Cli.ProjectBuilding.Templates.Maui; using Volo.Abp.Cli.ProjectBuilding.Templates.Microservice; namespace Volo.Abp.Cli.ProjectBuilding.Templates.App; @@ -161,6 +162,15 @@ public abstract class AppTemplateBase : TemplateInfo steps.Add(new RemoveFolderStep(MobileApp.ReactNative.GetFolderName().EnsureStartsWith('/'))); } + if (context.BuildArgs.MobileApp == MobileApp.Maui) + { + steps.Add(new MauiChangeApplicationIdGuidStep()); + } + else + { + steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Maui")); + } + if (!context.BuildArgs.PublicWebSite) { steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public")); diff --git a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml index 696f61d6db..5f6df3938e 100644 --- a/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml +++ b/modules/docs/src/Volo.Docs.Admin.Web/Pages/Docs/Admin/Projects/Index.cshtml @@ -29,10 +29,7 @@ - -

@L["Projects"]

-
- + @if (await Authorization.IsGrantedAsync(DocsAdminPermissions.Projects.Create)) {