Files
SPT-Server-Build/Libraries/FodyWeavers/JsonExtensionData.Fody/AssemblyProcessor.cs
T
clodanSPT cab8fa82a2 Json extension data fody (#340)
* Added a new Fody plugin to add to every model class the JsonExtensionData attribute

* retargeted fody plugin to netstandard for msbuild runtime

* Fixed runtime issue

* Fixed property check for new extension data properties

---------

Co-authored-by: Alex <clodanSPT@hotmail.com>
2025-06-02 12:15:44 +01:00

31 lines
632 B
C#

using System.Linq;
using Mono.Cecil;
namespace JsonExtensionData.Fody;
public partial class ModuleWeaver
{
public void ProcessAssembly()
{
foreach (var type in allClasses)
{
if (!ShouldInclude(type))
{
continue;
}
if (ShouldIncludeType(type))
{
ProcessType(type);
}
}
}
public bool ShouldIncludeType(TypeDefinition type)
{
return IncludeNamespacesRegex.Any(r => r.IsMatch(type.Namespace));
}
static bool ShouldInclude(TypeDefinition type) => !type.IsSealed;
}