mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Move plugin registers to source generator.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
<component name="ProjectRunConfigurationManager">
|
||||||
<configuration default="false" name="Aaru" type="DotNetProject" factoryName=".NET Project">
|
<configuration default="false" name="Aaru" type="DotNetProject" factoryName=".NET Project">
|
||||||
<option name="EXE_PATH" value="$PROJECT_DIR$/Aaru/bin/Debug/net6/aaru" />
|
<option name="EXE_PATH" value="$PROJECT_DIR$/Aaru/bin/Debug/net7.0/aaru.exe" />
|
||||||
<option name="PROGRAM_PARAMETERS" value="m dump /dev/sda foo4.z64" />
|
<option name="PROGRAM_PARAMETERS" value="formats" />
|
||||||
<option name="WORKING_DIRECTORY" value="$USER_HOME$/Desktop" />
|
<option name="WORKING_DIRECTORY" value="$USER_HOME$/Desktop" />
|
||||||
<option name="PASS_PARENT_ENVS" value="1" />
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" />
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="0" />
|
||||||
<option name="PROJECT_KIND" value="DotNetCore" />
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
<option name="PROJECT_TFM" value="net6.0" />
|
<option name="PROJECT_TFM" value="net7.0" />
|
||||||
<method v="2">
|
<method v="2">
|
||||||
<option name="Build" />
|
<option name="Build" />
|
||||||
</method>
|
</method>
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<NoWarn>CS1591;CS1574</NoWarn>
|
<NoWarn>CS1591;CS1574</NoWarn>
|
||||||
@@ -58,4 +59,7 @@
|
|||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// /***************************************************************************
|
// /***************************************************************************
|
||||||
// Aaru Data Preservation Suite
|
// Aaru Data Preservation Suite
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
@@ -38,49 +38,11 @@
|
|||||||
// Copyright © 2011-2023 Natalia Portillo
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
|
||||||
namespace Aaru.Archives;
|
namespace Aaru.Archives;
|
||||||
|
|
||||||
|
// Needs to have the interface here so the source generator knows THIS IS the class
|
||||||
|
// ReSharper disable once RedundantExtendsListEntry
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public sealed class Register : IPluginRegister
|
public sealed partial class Register : IPluginRegister {}
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllChecksumPlugins() => null;
|
|
||||||
|
|
||||||
/// <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() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().Contains(typeof(IArchive))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllByteAddressablePlugins() => null;
|
|
||||||
}
|
|
||||||
Submodule Aaru.Checksums updated: b0ae29077e...7d188fa7fe
Submodule Aaru.Console updated: 72ff6760c1...b5dcb2b058
@@ -29,6 +29,7 @@
|
|||||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<NoWarn>CS1591;CS1574</NoWarn>
|
<NoWarn>CS1591;CS1574</NoWarn>
|
||||||
@@ -76,4 +77,7 @@
|
|||||||
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
|
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -64,6 +64,8 @@
|
|||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=jfs/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=jfs/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=lif/@EntryIndexedValue">True</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
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
@@ -109,6 +111,7 @@
|
|||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=squash/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=squash/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=sysv/@EntryIndexedValue">True</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
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=udf/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=udf/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using Aaru.CommonTypes.Structs;
|
|||||||
using Aaru.Decoders;
|
using Aaru.Decoders;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ using Aaru.Console;
|
|||||||
using Aaru.Decoders;
|
using Aaru.Decoders;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ using Aaru.Console;
|
|||||||
using Aaru.Decoders;
|
using Aaru.Decoders;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using Claunia.Encoding;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Encoding = System.Text.Encoding;
|
using Encoding = System.Text.Encoding;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ using System.Text;
|
|||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Schemas;
|
using Schemas;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// All information by Natalia Portillo
|
// All information by Natalia Portillo
|
||||||
// Variable names from Lisa API
|
// Variable names from Lisa API
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ using System;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
#pragma warning disable CS0649
|
#pragma warning disable CS0649
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ using Claunia.Encoding;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Encoding = System.Text.Encoding;
|
using Encoding = System.Text.Encoding;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ using Aaru.CommonTypes.Enums;
|
|||||||
using Aaru.Decoders;
|
using Aaru.Decoders;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.LisaFS;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
public sealed partial class LisaFS
|
public sealed partial class LisaFS
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,52 +32,11 @@
|
|||||||
// Copyright © 2011-2023 Natalia Portillo
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
|
||||||
namespace Aaru.Filesystems;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
|
// Needs to have the interface here so the source generator knows THIS IS the class
|
||||||
|
// ReSharper disable once RedundantExtendsListEntry
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public sealed class Register : IPluginRegister
|
public sealed partial 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;
|
|
||||||
}
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ using System.Linq;
|
|||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
public sealed partial class PascalPlugin
|
public sealed partial class PascalPlugin
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ using Aaru.CommonTypes.Enums;
|
|||||||
using Aaru.CommonTypes.Structs;
|
using Aaru.CommonTypes.Structs;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
public sealed partial class PascalPlugin
|
public sealed partial class PascalPlugin
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ using Claunia.Encoding;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Encoding = System.Text.Encoding;
|
using Encoding = System.Text.Encoding;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
public sealed partial class PascalPlugin
|
public sealed partial class PascalPlugin
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
|
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ using Claunia.Encoding;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Encoding = System.Text.Encoding;
|
using Encoding = System.Text.Encoding;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
public sealed partial class PascalPlugin
|
public sealed partial class PascalPlugin
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ using Aaru.CommonTypes.Enums;
|
|||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Schemas;
|
using Schemas;
|
||||||
|
|
||||||
namespace Aaru.Filesystems.UCSDPascal;
|
namespace Aaru.Filesystems;
|
||||||
|
|
||||||
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
// Information from Call-A.P.P.L.E. Pascal Disk Directory Structure
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<NoWarn>CS1591;CS1574</NoWarn>
|
<NoWarn>CS1591;CS1574</NoWarn>
|
||||||
@@ -60,4 +61,7 @@
|
|||||||
<PackageReference Include="SharpCompress" Version="0.32.2"/>
|
<PackageReference Include="SharpCompress" Version="0.32.2"/>
|
||||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -36,49 +36,11 @@
|
|||||||
// Copyright © 2011-2023 Natalia Portillo
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
|
||||||
namespace Aaru.Filters;
|
namespace Aaru.Filters;
|
||||||
|
|
||||||
|
// Needs to have the interface here so the source generator knows THIS IS the class
|
||||||
|
// ReSharper disable once RedundantExtendsListEntry
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public class Register : IPluginRegister
|
public sealed partial class Register : IPluginRegister {}
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllChecksumPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllFilesystemPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllFilterPlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().Contains(typeof(IFilter))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <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;
|
|
||||||
}
|
|
||||||
16
Aaru.Generators/Aaru.Generators.csproj
Normal file
16
Aaru.Generators/Aaru.Generators.csproj
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
<LangVersion>latest</LangVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.4.0"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
354
Aaru.Generators/PluginRegisterGenerator.cs
Normal file
354
Aaru.Generators/PluginRegisterGenerator.cs
Normal file
@@ -0,0 +1,354 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Microsoft.CodeAnalysis;
|
||||||
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
|
||||||
|
namespace Aaru.Generators;
|
||||||
|
|
||||||
|
[Generator]
|
||||||
|
public class PluginRegisterGenerator : ISourceGenerator
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void Initialize(GeneratorInitializationContext context) =>
|
||||||
|
|
||||||
|
// Nothing to do
|
||||||
|
context.RegisterForSyntaxNotifications(() => new PluginFinder());
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public void Execute(GeneratorExecutionContext context)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
#if DEBUG
|
||||||
|
if(!Debugger.IsAttached)
|
||||||
|
{
|
||||||
|
Debugger.Launch();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
ClassDeclarationSyntax pluginRegister = ((PluginFinder)context.SyntaxReceiver)?.Register;
|
||||||
|
|
||||||
|
if(pluginRegister == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
string @namespace =
|
||||||
|
(pluginRegister.Ancestors().FirstOrDefault(x => x is FileScopedNamespaceDeclarationSyntax) as
|
||||||
|
FileScopedNamespaceDeclarationSyntax)?.Name.ToString();
|
||||||
|
|
||||||
|
@namespace ??=
|
||||||
|
(pluginRegister.Ancestors().FirstOrDefault(x => x is NamespaceDeclarationSyntax) as
|
||||||
|
NamespaceDeclarationSyntax)?.ToString();
|
||||||
|
|
||||||
|
string className = pluginRegister.Identifier.Text;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> archives = ((PluginFinder)context.SyntaxReceiver)?.Archives;
|
||||||
|
List<ClassDeclarationSyntax> checksums = ((PluginFinder)context.SyntaxReceiver)?.Checksums;
|
||||||
|
List<ClassDeclarationSyntax> fileSystems = ((PluginFinder)context.SyntaxReceiver)?.FileSystems;
|
||||||
|
List<ClassDeclarationSyntax> filters = ((PluginFinder)context.SyntaxReceiver)?.Filters;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> floppyImagePlugins = ((PluginFinder)context.SyntaxReceiver)?.FloppyImagePlugins;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> partitionPlugins = ((PluginFinder)context.SyntaxReceiver)?.PartitionPlugins;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> mediaImagePlugins = ((PluginFinder)context.SyntaxReceiver)?.MediaImagePlugins;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> readOnlyFileSystems = ((PluginFinder)context.SyntaxReceiver)?.ReadOnlyFileSystems;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> writableFloppyImagePlugins =
|
||||||
|
((PluginFinder)context.SyntaxReceiver)?.WritableFloppyImagePlugins;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> writableImagePlugins =
|
||||||
|
((PluginFinder)context.SyntaxReceiver)?.WritableImagePlugins;
|
||||||
|
|
||||||
|
List<ClassDeclarationSyntax> byteAddressableImagePlugins =
|
||||||
|
((PluginFinder)context.SyntaxReceiver)?.ByteAddressableImagePlugins;
|
||||||
|
|
||||||
|
StringBuilder sb = new();
|
||||||
|
|
||||||
|
sb.AppendLine(@"// /***************************************************************************
|
||||||
|
// Aaru Data Preservation Suite
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Filename : Register.g.cs
|
||||||
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||||
|
//
|
||||||
|
// --[ Description ] ----------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Registers all plugins in this assembly.
|
||||||
|
//
|
||||||
|
// --[ License ] --------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
// copy of this software and associated documentation files (the
|
||||||
|
// ""Software""), to deal in the Software without restriction, including
|
||||||
|
// without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
// permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
// the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included
|
||||||
|
// in all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||||
|
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||||
|
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
//
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
|
// ****************************************************************************/");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine("using System;");
|
||||||
|
sb.AppendLine("using System.Collections.Generic;");
|
||||||
|
sb.AppendLine("using Aaru.CommonTypes.Interfaces;");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine($"namespace {@namespace};");
|
||||||
|
sb.AppendLine();
|
||||||
|
sb.AppendLine($"public sealed partial class {className} : IPluginRegister");
|
||||||
|
sb.AppendLine("{");
|
||||||
|
|
||||||
|
if(archives?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllArchivePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in archives)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllArchivePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(checksums?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllChecksumPlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in checksums)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllChecksumPlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(fileSystems?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFilesystemPlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in fileSystems)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFilesystemPlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(filters?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFilterPlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in filters)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFilterPlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(floppyImagePlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFloppyImagePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in floppyImagePlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllFloppyImagePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(mediaImagePlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllMediaImagePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in mediaImagePlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllMediaImagePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(partitionPlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllPartitionPlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in partitionPlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllPartitionPlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(readOnlyFileSystems?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllReadOnlyFilesystemPlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in readOnlyFileSystems)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllReadOnlyFilesystemPlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(writableFloppyImagePlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllWritableFloppyImagePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in writableFloppyImagePlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllWritableFloppyImagePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(writableImagePlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllWritableImagePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in writableImagePlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllWritableImagePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine();
|
||||||
|
|
||||||
|
if(byteAddressableImagePlugins?.Count > 0)
|
||||||
|
{
|
||||||
|
sb.AppendLine(" public List<Type> GetAllByteAddressablePlugins() => new()");
|
||||||
|
sb.AppendLine(" {");
|
||||||
|
|
||||||
|
foreach(ClassDeclarationSyntax plugin in byteAddressableImagePlugins)
|
||||||
|
sb.AppendLine($" typeof({plugin.Identifier.Text}),");
|
||||||
|
|
||||||
|
sb.AppendLine(" };");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
sb.AppendLine(" public List<Type> GetAllByteAddressablePlugins() => null;");
|
||||||
|
|
||||||
|
sb.AppendLine("}");
|
||||||
|
|
||||||
|
context.AddSource("Register.g.cs", sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
sealed class PluginFinder : ISyntaxReceiver
|
||||||
|
{
|
||||||
|
public List<ClassDeclarationSyntax> Archives { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> Checksums { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> FileSystems { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> Filters { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> FloppyImagePlugins { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> MediaImagePlugins { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> PartitionPlugins { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> ReadOnlyFileSystems { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> WritableFloppyImagePlugins { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> WritableImagePlugins { get; } = new();
|
||||||
|
public List<ClassDeclarationSyntax> ByteAddressableImagePlugins { get; } = new();
|
||||||
|
public ClassDeclarationSyntax Register { get; private set; }
|
||||||
|
|
||||||
|
public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
|
||||||
|
{
|
||||||
|
if(syntaxNode is not ClassDeclarationSyntax plugin)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IPluginRegister") == true)
|
||||||
|
Register = plugin;
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IArchive") == true)
|
||||||
|
Archives.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IChecksum") == true)
|
||||||
|
Checksums.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IFilesystem") == true)
|
||||||
|
FileSystems.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IFilter") == true)
|
||||||
|
Filters.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IFloppyImage") == true)
|
||||||
|
FloppyImagePlugins.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText is "IMediaImage" or "IOpticalMediaImage" or "IFloppyImage"
|
||||||
|
or "ITapeImage") == true)
|
||||||
|
MediaImagePlugins.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IPartition") == true)
|
||||||
|
PartitionPlugins.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IReadOnlyFilesystem") == true)
|
||||||
|
ReadOnlyFileSystems.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IWritableFloppyImage") == true)
|
||||||
|
WritableFloppyImagePlugins.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText is "IWritableImage" or "IWritableOpticalImage"
|
||||||
|
or "IWritableTapeImage" or "IByteAddressableImage") == true)
|
||||||
|
WritableImagePlugins.Add(plugin);
|
||||||
|
|
||||||
|
if(plugin.BaseList?.Types.Any(t => ((t as SimpleBaseTypeSyntax)?.Type as IdentifierNameSyntax)?.Identifier.
|
||||||
|
ValueText == "IByteAddressableImage") == true)
|
||||||
|
ByteAddressableImagePlugins.Add(plugin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<NoWarn>CS1591;CS1574</NoWarn>
|
<NoWarn>CS1591;CS1574</NoWarn>
|
||||||
@@ -71,4 +72,7 @@
|
|||||||
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
|
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blindwrite5/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blindwrite5/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blu/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=blu/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean
|
||||||
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=byteaddressable/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=cdrdao/@EntryIndexedValue">True</s:Boolean>
|
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=cdrdao/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean
|
<s:Boolean
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class AtariLynx : IByteAddressableImage
|
public class AtariLynx : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class GameBoy : IByteAddressableImage
|
public class GameBoy : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class GameBoyAdvance : IByteAddressableImage
|
public class GameBoyAdvance : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class MasterSystem : IByteAddressableImage
|
public class MasterSystem : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ using Aaru.Database.Models;
|
|||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
using Schemas;
|
using Schemas;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class Nes : IByteAddressableImage
|
public class Nes : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>Implements support for Nintendo 64 cartridge dumps</summary>
|
/// <summary>Implements support for Nintendo 64 cartridge dumps</summary>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>Implements support for Sega Mega Drive, 32X, Genesis and Pico cartridge dumps</summary>
|
/// <summary>Implements support for Sega Mega Drive, 32X, Genesis and Pico cartridge dumps</summary>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using Aaru.Helpers;
|
|||||||
using Schemas;
|
using Schemas;
|
||||||
using Marshal = Aaru.Helpers.Marshal;
|
using Marshal = Aaru.Helpers.Marshal;
|
||||||
|
|
||||||
namespace Aaru.DiscImages.ByteAddressable;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
public class SuperNintendo : IByteAddressableImage
|
public class SuperNintendo : IByteAddressableImage
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -36,61 +36,11 @@
|
|||||||
// Copyright © 2011-2023 Natalia Portillo
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
|
||||||
namespace Aaru.DiscImages;
|
namespace Aaru.DiscImages;
|
||||||
|
|
||||||
|
// Needs to have the interface here so the source generator knows THIS IS the class
|
||||||
|
// ReSharper disable once RedundantExtendsListEntry
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public sealed class Register : IPluginRegister
|
public sealed partial class Register : IPluginRegister {}
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllChecksumPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllFilesystemPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllFilterPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllFloppyImagePlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().
|
|
||||||
Contains(typeof(IFloppyImage))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllMediaImagePlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().Contains(typeof(IMediaImage))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllPartitionPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllReadOnlyFilesystemPlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllWritableFloppyImagePlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().
|
|
||||||
Contains(typeof(IWritableFloppyImage))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllWritableImagePlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().
|
|
||||||
Contains(typeof(IBaseWritableImage))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllArchivePlugins() => null;
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllByteAddressablePlugins() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().
|
|
||||||
Contains(typeof(IByteAddressableImage))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||||
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||||
<NoWarn>CS1591;CS1574</NoWarn>
|
<NoWarn>CS1591;CS1574</NoWarn>
|
||||||
@@ -62,4 +63,7 @@
|
|||||||
<PackageReference Include="Spectre.Console" Version="0.45.0"/>
|
<PackageReference Include="Spectre.Console" Version="0.45.0"/>
|
||||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Aaru.Generators\Aaru.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
@@ -36,49 +36,11 @@
|
|||||||
// Copyright © 2011-2023 Natalia Portillo
|
// Copyright © 2011-2023 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
|
||||||
namespace Aaru.Partitions;
|
namespace Aaru.Partitions;
|
||||||
|
|
||||||
|
// Needs to have the interface here so the source generator knows THIS IS the class
|
||||||
|
// ReSharper disable once RedundantExtendsListEntry
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public sealed class Register : IPluginRegister
|
public sealed partial class Register : IPluginRegister {}
|
||||||
{
|
|
||||||
/// <inheritdoc />
|
|
||||||
public List<Type> GetAllChecksumPlugins() => null;
|
|
||||||
|
|
||||||
/// <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() => Assembly.GetExecutingAssembly().GetTypes().
|
|
||||||
Where(t => t.GetInterfaces().Contains(typeof(IPartition))).
|
|
||||||
Where(t => t.IsClass).ToList();
|
|
||||||
|
|
||||||
/// <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;
|
|
||||||
}
|
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Filesystems.LisaFS;
|
using Aaru.Filesystems;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
|
||||||
namespace Aaru.Tests.Filesystems;
|
namespace Aaru.Tests.Filesystems;
|
||||||
|
|||||||
18
Aaru.sln
18
Aaru.sln
@@ -1,6 +1,6 @@
|
|||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.29102.190
|
VisualStudioVersion = 17.4.33205.214
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru", "Aaru\Aaru.csproj", "{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru", "Aaru\Aaru.csproj", "{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}"
|
||||||
EndProject
|
EndProject
|
||||||
@@ -44,7 +44,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru.Decryption", "Aaru.Dec
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru.Archives", "Aaru.Archives\Aaru.Archives.csproj", "{282271D0-CCC2-4ED7-BA38-EC06A84BB974}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru.Archives", "Aaru.Archives\Aaru.Archives.csproj", "{282271D0-CCC2-4ED7-BA38-EC06A84BB974}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aaru.Localization", "Aaru.Localization\Aaru.Localization.csproj", "{90B96C70-F449-4B83-9DC7-F69150806F9B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru.Localization", "Aaru.Localization\Aaru.Localization.csproj", "{90B96C70-F449-4B83-9DC7-F69150806F9B}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Aaru.Generators", "Aaru.Generators\Aaru.Generators.csproj", "{BCF89E9A-ADE9-40FD-B892-54D11882558E}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AF25D4CD-0DA5-4595-99BD-FA4ADB844FD2}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -230,6 +234,14 @@ Global
|
|||||||
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|x86.ActiveCfg = Release|Any CPU
|
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|x86.Build.0 = Release|Any CPU
|
{90B96C70-F449-4B83-9DC7-F69150806F9B}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{BCF89E9A-ADE9-40FD-B892-54D11882558E}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
|||||||
Reference in New Issue
Block a user