feat: port aelrynth 2026.9.27.2 snapshot onto GitHub history
Overlay upstream/main (9b5e276) onto BlankenshipG main without rewriting
history. Keep origin-only Decal/plugin/docs trees. Re-apply aelrynth.com
and sibling-fork URL fixes that aelrynth git still has as tombohar links.
Co-authored-by: BlankenshipG <BlankenshipG@users.noreply.github.com>
This commit is contained in:
parent
ac0d743e16
commit
4ddbb52eb2
244 changed files with 59710 additions and 3067 deletions
46
tools/HookResolver.Core/Resolution/ManifestBuilder.cs
Normal file
46
tools/HookResolver.Core/Resolution/ManifestBuilder.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using RynthCore.HookManifest.Schema;
|
||||
using Manifest = RynthCore.HookManifest.Schema.HookManifest;
|
||||
|
||||
namespace RynthCore.HookResolver.Core.Resolution;
|
||||
|
||||
public static class ManifestBuilder
|
||||
{
|
||||
public const string GeneratorName = "RynthCore.HookResolver 0.1.0";
|
||||
|
||||
public static Manifest Compose(
|
||||
ManifestInput input,
|
||||
IEnumerable<HookManifestEntry> entries,
|
||||
IReadOnlyDictionary<string, string>? labels = null)
|
||||
{
|
||||
var dict = new Dictionary<string, HookManifestEntry>();
|
||||
foreach (var e in entries)
|
||||
dict[e.SymbolId] = e;
|
||||
|
||||
return new Manifest
|
||||
{
|
||||
Generator = GeneratorName,
|
||||
GeneratedAtUtc = DateTime.UtcNow,
|
||||
Input = input,
|
||||
Labels = labels ?? new Dictionary<string, string>(),
|
||||
Symbols = dict
|
||||
};
|
||||
}
|
||||
|
||||
public static async Task WriteAsync(Manifest manifest, string path, CancellationToken ct = default)
|
||||
{
|
||||
string? dir = Path.GetDirectoryName(path);
|
||||
if (!string.IsNullOrEmpty(dir))
|
||||
Directory.CreateDirectory(dir);
|
||||
|
||||
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(
|
||||
manifest, HookManifestJsonContext.Default.HookManifest);
|
||||
|
||||
await File.WriteAllBytesAsync(path, bytes, ct).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue