Move plugin registers to source generator.

This commit is contained in:
2022-12-14 20:56:08 +00:00
parent b69dad87b2
commit 5fb23f1024
43 changed files with 488 additions and 286 deletions

View File

@@ -29,6 +29,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>
@@ -76,4 +77,7 @@
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
</Project>

View File

@@ -64,6 +64,8 @@
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=jfs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=lif/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=lisafs/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
@@ -109,6 +111,7 @@
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=squash/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=sysv/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ucsdpascal/@EntryIndexedValue">True</s:Boolean>
<s:Boolean
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=udf/@EntryIndexedValue">True</s:Boolean>
<s:Boolean

View File

@@ -28,7 +28,7 @@
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
[SuppressMessage("ReSharper", "UnusedMember.Local")]
public sealed partial class LisaFS

View File

@@ -38,7 +38,7 @@ using Aaru.CommonTypes.Structs;
using Aaru.Decoders;
using Aaru.Helpers;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -32,7 +32,7 @@ using Aaru.Console;
using Aaru.Decoders;
using Aaru.Helpers;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -33,7 +33,7 @@ using Aaru.Console;
using Aaru.Decoders;
using Aaru.Helpers;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -38,7 +38,7 @@ using Claunia.Encoding;
using Schemas;
using Encoding = System.Text.Encoding;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -32,7 +32,7 @@ using System.Text;
using Aaru.CommonTypes.Interfaces;
using Schemas;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
// All information by Natalia Portillo
// Variable names from Lisa API

View File

@@ -32,7 +32,7 @@ using System;
using System.Diagnostics.CodeAnalysis;
#pragma warning disable CS0649
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -39,7 +39,7 @@ using Claunia.Encoding;
using Schemas;
using Encoding = System.Text.Encoding;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -38,7 +38,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.Decoders;
using Aaru.Helpers;
namespace Aaru.Filesystems.LisaFS;
namespace Aaru.Filesystems;
public sealed partial class LisaFS
{

View File

@@ -32,52 +32,11 @@
// Copyright © 2011-2023 Natalia Portillo
// ****************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.Filesystems;
// 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() => null;
/// <inheritdoc />
public List<Type> GetAllFilesystemPlugins() => Assembly.GetExecutingAssembly().GetTypes().
Where(t => t.GetInterfaces().Contains(typeof(IFilesystem))).
Where(t => t.IsClass).ToList();
/// <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() => Assembly.GetExecutingAssembly().GetTypes().
Where(t => t.GetInterfaces().
Contains(typeof(IReadOnlyFilesystem))).
Where(t => t.IsClass).ToList();
/// <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 {}

View File

@@ -32,7 +32,7 @@
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
[SuppressMessage("ReSharper", "UnusedMember.Local")]

View File

@@ -36,7 +36,7 @@ using System.Linq;
using Aaru.CommonTypes.Enums;
using Aaru.Helpers;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public sealed partial class PascalPlugin

View File

@@ -32,7 +32,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs;
using Aaru.Helpers;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public sealed partial class PascalPlugin

View File

@@ -41,7 +41,7 @@ using Claunia.Encoding;
using Schemas;
using Encoding = System.Text.Encoding;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public sealed partial class PascalPlugin

View File

@@ -32,7 +32,7 @@
using System.Diagnostics.CodeAnalysis;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
[SuppressMessage("ReSharper", "NotAccessedField.Local")]

View File

@@ -41,7 +41,7 @@ using Claunia.Encoding;
using Schemas;
using Encoding = System.Text.Encoding;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
public sealed partial class PascalPlugin

View File

@@ -37,7 +37,7 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
using Schemas;
namespace Aaru.Filesystems.UCSDPascal;
namespace Aaru.Filesystems;
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
/// <inheritdoc />