Files
Yi.Admin/Yi.Abp.Net8/tool/Yi.Abp.Tool/Program.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2024-11-06 00:05:29 +08:00
using System.Reflection;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Yi.Abp.Tool;
class Program
{
2024-06-02 00:38:35 +08:00
static async Task Main(string[] args)
{
2024-06-02 00:38:35 +08:00
#if DEBUG
2024-11-06 00:05:29 +08:00
2024-11-05 22:12:30 +08:00
//帮助
2024-11-05 22:22:42 +08:00
//args = ["-h"];
2024-11-05 22:36:22 +08:00
2024-11-05 22:12:30 +08:00
//版本
2024-11-07 17:35:22 +08:00
// args = ["-v"];
2024-11-05 22:36:22 +08:00
2024-11-05 22:12:30 +08:00
//清理
// args = ["clear"];
2024-11-05 22:36:22 +08:00
//创建模块
2024-11-08 11:21:10 +08:00
//args = ["new","oooo", "-t","module","-p","D:\\temp","-csf"];
2024-11-07 17:35:22 +08:00
//查看模板列表
2024-11-08 11:10:45 +08:00
//args = ["new","list"];
2024-11-08 12:35:54 +08:00
//查看子命令帮组
// args = ["new","-h"];
2024-11-05 22:22:42 +08:00
//添加模块
2024-11-05 22:36:22 +08:00
//args = ["add-module", "kkk"];
2024-06-02 00:38:35 +08:00
#endif
try
{
IHost host = Host.CreateDefaultBuilder()
.ConfigureServices(async (host, service) =>
{
await service.AddApplicationAsync<YiAbpToolModule>();
})
2024-06-02 18:00:22 +08:00
//.ConfigureAppConfiguration(configurationBuilder =>
//{
// configurationBuilder.AddJsonFile("appsettings.json");
//})
.UseAutofac()
.Build();
2024-11-05 18:50:15 +08:00
var commandSelector = host.Services.GetRequiredService<CommandInvoker>();
await commandSelector.InvokerAsync(args);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}