cab8fa82a2
* 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>
31 lines
632 B
C#
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;
|
|
}
|