-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathProgram.cs
More file actions
47 lines (44 loc) · 1.78 KB
/
Copy pathProgram.cs
File metadata and controls
47 lines (44 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Onec.DebugAdapter.DebugProtocol;
using Onec.DebugAdapter.DebugServer;
using Onec.DebugAdapter.V8;
using Onec.DebugAdapter.Services;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Threading.Tasks.Dataflow;
using System.Xml;
using Microsoft.Extensions.Logging;
namespace Onec.DebugAdapter
{
internal class Program
{
static async Task Main(string[] args)
{
var host = new HostBuilder()
.ConfigureDefaults(args)
.ConfigureLogging(builder => builder.ClearProviders())
.ConfigureServices((context, sc) =>
{
sc.AddTransient<IDebugServerClient, DebugServerClient>();
sc.AddSingleton<IDebugConfiguration, DebugConfiguration>();
sc.AddSingleton<IMetadataProvider, MetadataProvider>();
sc.AddSingleton<IDebugServerListener, DebugServerListener>();
sc.AddSingleton<IDebugTargetsManager, DebugTargetsManager>();
sc.AddSingleton<IStoppingManager, StoppingManager>();
sc.AddSingleton<DebuggeeProcess>();
sc.AddSingleton<DebugServerProcess>();
sc.AddSingleton<V8DebugAdapter>();
sc.AddSingleton<IDebugAdapterExtender, DebugAdapterExtender>();
if (context.Configuration.GetValue("debug", false))
sc.AddHostedService<TcpDebugAdapterService>();
else
sc.AddHostedService<ConsoleDebugAdapterService>();
})
.Build();
await host.RunAsync();
}
}
}