CLI - Added CLI project

Core - Don't register debug logger on release builds
This commit is contained in:
Robert committed 2021-04-13 23:15:27 +02:00
1 parent 70bf8824db
commit 651fc515d2
10 files changed
+1418

No files matched your search

@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Platforms>x64</Platforms>
<AssemblyName>Artemis.UI.Console</AssemblyName>
<RootNamespace>Artemis.UI.Console</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Artemis.Core\Artemis.Core.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.8.26" />
<PackageReference Include="Ninject" Version="3.3.4" />
<PackageReference Include="Ninject.Extensions.Conventions" Version="3.3.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
</Project>
+50
View File
@@ -0,0 +1,50 @@
using System;
using System.Linq;
using System.Threading;
using Artemis.Core;
using Artemis.Core.Ninject;
using Artemis.Core.Services;
using Ninject;
namespace Artemis.UI.Console
{
/// <summary>
/// This is just a little experiment to show that Artemis can run without the UI and even on other OSes
/// Some notes
/// - Any plugin relying on WPF and/or Artemis.UI.Shared won't load
/// - There is no input provider so key-press events and brushes won't work
/// - Device providers using Windows SDKs won't work, OpenRGB will though!
/// - You may need to fiddle around to get SkiaSharp binaries going
/// - There is no UI obviously
/// </summary>
internal class Program
{
private static readonly AutoResetEvent Closing = new(false);
protected static void OnExit(object sender, ConsoleCancelEventArgs args)
{
Closing.Set();
}
private static void Main(string[] args)
{
Utilities.PrepareFirstLaunch();
Utilities.ShutdownRequested += UtilitiesOnShutdownRequested;
StandardKernel kernel = new() {Settings = {InjectNonPublic = true}};
kernel.Load<CoreModule>();
ICoreService core = kernel.Get<ICoreService>();
core.StartupArguments = args.ToList();
core.IsElevated = false;
core.Initialize();
System.Console.CancelKeyPress += OnExit;
Closing.WaitOne();
}
private static void UtilitiesOnShutdownRequested(object sender, EventArgs e)
{
Closing.Set();
}
}
}
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin\publish\linux</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<TargetFramework>net5.0</TargetFramework>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
</PropertyGroup>
</Project>
File diff suppressed because it is too large. Load diff