ant-design-blazor/site/AntDesign.Docs.Build.CLI/Program.cs
Henry.zhang 7b31935f74 docs: add icon list (#478)
* feat: add icon list for demo page of icon

* feat: add copy function for icon list

* feat: get existed icon

* feat: remove some blanks in list.razor

* feat: remove some blanks

* fix: default value is outline for icon list

* fix: click to copy for icon list

* feat: add async to load icon list

* feat: update iconlistService

* chore: update icons

* fix: icon load async

* feat: add application icons in IconlistServices

* fix: remove the exist icon from existed catogory if duplicated

* fix: add @key for list items

* fix: revert the change

Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-08-14 07:13:28 +08:00

54 lines
1.8 KiB
C#

using System;
using AntDesign.Docs.Build.CLI.Command;
using AntDesign.Docs.Build.CLI.Utils;
using Microsoft.Extensions.CommandLineUtils;
using Microsoft.Extensions.DependencyInjection;
namespace AntDesign.Docs.Build.CLI
{
internal class Program
{
private static int Main(string[] args)
{
return new Program().Run(args);
}
private readonly IServiceProvider _serviceProvider;
public Program()
{
_serviceProvider = ConfigureServices();
}
private int Run(string[] args)
{
try
{
var app = _serviceProvider.GetRequiredService<CommandLineApplication>();
return app.Execute(args);
}
catch (Exception e)
{
Console.WriteLine($"An error occurred. {e.Message}");
return 1;
}
}
private IServiceProvider ConfigureServices()
{
var services = new ServiceCollection();
services.AddSingleton<CommandLineApplicationFactory>();
services.AddSingleton(p => p.GetRequiredService<CommandLineApplicationFactory>().Create());
services.AddSingleton<IAppCommandResolver, AppCommandResolver>();
services.AddSingleton<PlatformInformationArbiter>();
services.AddSingleton<DirectoryProvider>();
services.AddSingleton<ShellProcessFactory>();
services.AddSingleton<IAppCommand, GenerateDemoJsonCommand>();
services.AddSingleton<IAppCommand, GenerateMenuJsonCommand>();
services.AddSingleton<IAppCommand, GenerateDocsToHtmlCommand>();
services.AddSingleton<IAppCommand, GenerateIconsToJsonCommand>();
return services.BuildServiceProvider();
}
}
}