Move plugin registers to source generator.

This commit is contained in:
2022-12-14 20:56:01 +00:00
parent b0ae29077e
commit 7d188fa7fe
2 changed files with 7 additions and 41 deletions

View File

@@ -28,6 +28,7 @@
<Authors>Natalia Portillo &lt;claunia@claunia.com&gt;</Authors>
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<NoWarn>CS1591;CS1574</NoWarn>
@@ -62,4 +63,7 @@
<PackageReference Include="Aaru.Checksums.Native" Version="6.0.0-alpha6"/>
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
</Project>

View File

@@ -36,49 +36,11 @@
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Checksums;
// Needs to have the interface here so the source generator knows THIS IS the class
// ReSharper disable once RedundantExtendsListEntry
/// <inheritdoc />
public sealed class Register : IPluginRegister
{
/// <inheritdoc />
public List<Type> GetAllChecksumPlugins() => Assembly.GetExecutingAssembly().GetTypes().
Where(t => t.GetInterfaces().Contains(typeof(IChecksum))).
Where(t => t.IsClass).ToList();
/// <inheritdoc />
public List<Type> GetAllFilesystemPlugins() => null;
/// <inheritdoc />
public List<Type> GetAllFilterPlugins() => null;
/// <inheritdoc />
public List<Type> GetAllFloppyImagePlugins() => null;
/// <inheritdoc />
public List<Type> GetAllMediaImagePlugins() => null;
/// <inheritdoc />
public List<Type> GetAllPartitionPlugins() => null;
/// <inheritdoc />
public List<Type> GetAllReadOnlyFilesystemPlugins() => null;
/// <inheritdoc />
public List<Type> GetAllWritableFloppyImagePlugins() => null;
/// <inheritdoc />
public List<Type> GetAllWritableImagePlugins() => null;
/// <inheritdoc />
public List<Type> GetAllArchivePlugins() => null;
/// <inheritdoc />
public List<Type> GetAllByteAddressablePlugins() => null;
}
public sealed partial class Register : IPluginRegister {}