feat: extract shared Cecil weaving core
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
#nullable enable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace ShrinkSDK.CodeGen
|
||||
{
|
||||
|
||||
public enum ShrinkCodeGenDiagnosticSeverity { Info, Warning, Error }
|
||||
public enum ShrinkCodeGenPlatform { EngineNeutral, Unity }
|
||||
|
||||
public sealed class ShrinkCodeGenDiagnostic
|
||||
{
|
||||
public ShrinkCodeGenDiagnostic(ShrinkCodeGenDiagnosticSeverity severity, string message)
|
||||
{
|
||||
Severity = severity;
|
||||
Message = message;
|
||||
}
|
||||
|
||||
public ShrinkCodeGenDiagnosticSeverity Severity { get; }
|
||||
public string Message { get; }
|
||||
}
|
||||
|
||||
public sealed class ShrinkWeaveResult
|
||||
{
|
||||
public ShrinkWeaveResult(bool changed, int instanceSubscribers, int staticSubscribers,
|
||||
int registryEntries, IReadOnlyList<ShrinkCodeGenDiagnostic> diagnostics)
|
||||
{
|
||||
Changed = changed;
|
||||
InstanceSubscribers = instanceSubscribers;
|
||||
StaticSubscribers = staticSubscribers;
|
||||
RegistryEntries = registryEntries;
|
||||
Diagnostics = diagnostics;
|
||||
}
|
||||
|
||||
public bool Changed { get; }
|
||||
public int InstanceSubscribers { get; }
|
||||
public int StaticSubscribers { get; }
|
||||
public int RegistryEntries { get; }
|
||||
public IReadOnlyList<ShrinkCodeGenDiagnostic> Diagnostics { get; }
|
||||
public bool Succeeded => Diagnostics.All(item => item.Severity != ShrinkCodeGenDiagnosticSeverity.Error);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user