feat: add NuGet and Godot distribution
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#nullable enable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using ShrinkApp;
|
||||
|
||||
namespace ShrinkContext.AppAdapter;
|
||||
|
||||
public sealed class ShrinkContextAppHost
|
||||
{
|
||||
private readonly ShrinkContextRuntime _runtime = new();
|
||||
private readonly ShrinkComponentCatalog _catalog = new();
|
||||
private readonly ShrinkContextLoader _loader;
|
||||
|
||||
public ShrinkContextAppHost(ShrinkAppServices? services = null)
|
||||
{
|
||||
Services = services ?? new ShrinkAppServices();
|
||||
_loader = new ShrinkContextLoader(_runtime, _catalog);
|
||||
}
|
||||
|
||||
public ShrinkAppServices Services { get; }
|
||||
public ShrinkContextRuntime Runtime => _runtime;
|
||||
public ShrinkLoaderTransactionDiagnostic? LastTransaction => _loader.LastTransaction;
|
||||
|
||||
public void Register(string name, Func<IShrinkComponent> factory) => _catalog.Register(name, factory);
|
||||
public void Register<TComponent>(string name) where TComponent : IShrinkComponent, new() =>
|
||||
_catalog.Register<TComponent>(name);
|
||||
public UniTask ApplyAsync(IReadOnlyList<ShrinkLoaderEntry> entries) => _loader.ApplyAsync(entries);
|
||||
public UniTask ShutdownAsync() => _runtime.ShutdownAsync();
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
|
||||
<AssemblyName>ShrinkContext.AppAdapter</AssemblyName>
|
||||
<RootNamespace>ShrinkContext.AppAdapter</RootNamespace>
|
||||
<PackageId>ShrinkSDK.Context.AppAdapter</PackageId>
|
||||
<Version>0.2.0</Version>
|
||||
<Description>Engine-neutral ShrinkContext composition host for ShrinkApp.</Description>
|
||||
<ShrinkCodeGenEnabled>false</ShrinkCodeGenEnabled>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Runtime\*.cs" />
|
||||
<PackageReference Include="ShrinkSDK.Context.Core" Version="0.2.0" />
|
||||
<PackageReference Include="ShrinkSDK.App.Core" Version="0.2.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user