diff --git a/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs b/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs index c64d9c22..6cead03f 100644 --- a/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs @@ -85,13 +85,11 @@ protected T GetOption(UpdateOption? option) public TBootstrap DownloadOrchestrator() where T : Download.Abstractions.IDownloadOrchestrator, new() { _extensions[typeof(Download.Abstractions.IDownloadOrchestrator)] = typeof(T); return (TBootstrap)this; } - /// Register a custom clean strategy by type name (interface lives in GeneralUpdate.Differential). - public TBootstrap CleanStrategy() where T : class, new() - { _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; } + public TBootstrap CleanStrategy() where T : Differential.ICleanStrategy, new() + { _extensions[typeof(Differential.ICleanStrategy)] = typeof(T); return (TBootstrap)this; } - /// Register a custom dirty strategy by type name (interface lives in GeneralUpdate.Differential). - public TBootstrap DirtyStrategy() where T : class, new() - { _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; } + public TBootstrap DirtyStrategy() where T : Differential.IDirtyStrategy, new() + { _extensions[typeof(Differential.IDirtyStrategy)] = typeof(T); return (TBootstrap)this; } public TBootstrap ConfigureBlackList(BlackListConfig config) { diff --git a/src/c#/GeneralUpdate.Core/Differential/ICleanStrategy.cs b/src/c#/GeneralUpdate.Core/Differential/ICleanStrategy.cs new file mode 100644 index 00000000..00fae022 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Differential/ICleanStrategy.cs @@ -0,0 +1,18 @@ +using System.Threading.Tasks; + +namespace GeneralUpdate.Core.Differential; + +/// +/// Defines the complete execution strategy for the Clean (patch-generation) phase. +/// Implement this interface to fully control how source and target directories are +/// compared and how the patch output is produced. +/// +public interface ICleanStrategy +{ + /// + /// Executes the Clean phase: compares with + /// and writes the resulting patch artifacts to + /// . + /// + Task ExecuteAsync(string sourcePath, string targetPath, string patchPath); +} diff --git a/src/c#/GeneralUpdate.Core/Differential/IDirtyStrategy.cs b/src/c#/GeneralUpdate.Core/Differential/IDirtyStrategy.cs new file mode 100644 index 00000000..072b3124 --- /dev/null +++ b/src/c#/GeneralUpdate.Core/Differential/IDirtyStrategy.cs @@ -0,0 +1,17 @@ +using System.Threading.Tasks; + +namespace GeneralUpdate.Core.Differential; + +/// +/// Defines the complete execution strategy for the Dirty (patch-application) phase. +/// Implement this interface to fully control how patch files are applied to the +/// target application directory. +/// +public interface IDirtyStrategy +{ + /// + /// Executes the Dirty phase: applies patches from + /// to the application files in . + /// + Task ExecuteAsync(string appPath, string patchPath); +} diff --git a/src/c#/GeneralUpdate.Differential/Matchers/ICleanStrategy.cs b/src/c#/GeneralUpdate.Differential/Matchers/ICleanStrategy.cs index 679e9ec9..e9eefe2d 100644 --- a/src/c#/GeneralUpdate.Differential/Matchers/ICleanStrategy.cs +++ b/src/c#/GeneralUpdate.Differential/Matchers/ICleanStrategy.cs @@ -1,19 +1,6 @@ -using System.Threading.Tasks; - +// ReSharper disable once CheckNamespace namespace GeneralUpdate.Differential.Matchers { - /// - /// Defines the complete execution strategy for the Clean (patch-generation) phase. - /// Implement this interface to fully control how source and target directories are - /// compared and how the patch output is produced. - /// - public interface ICleanStrategy - { - /// - /// Executes the Clean phase: compares with - /// and writes the resulting patch artifacts to - /// . - /// - Task ExecuteAsync(string sourcePath, string targetPath, string patchPath); - } + /// Backward-compatible alias for . + public interface ICleanStrategy : GeneralUpdate.Core.Differential.ICleanStrategy { } } diff --git a/src/c#/GeneralUpdate.Differential/Matchers/IDirtyStrategy.cs b/src/c#/GeneralUpdate.Differential/Matchers/IDirtyStrategy.cs index 2f3f1e1e..e8d5ed9a 100644 --- a/src/c#/GeneralUpdate.Differential/Matchers/IDirtyStrategy.cs +++ b/src/c#/GeneralUpdate.Differential/Matchers/IDirtyStrategy.cs @@ -1,18 +1,6 @@ -using System.Threading.Tasks; - +// ReSharper disable once CheckNamespace namespace GeneralUpdate.Differential.Matchers { - /// - /// Defines the complete execution strategy for the Dirty (patch-application) phase. - /// Implement this interface to fully control how patch files are applied to the - /// target application directory. - /// - public interface IDirtyStrategy - { - /// - /// Executes the Dirty phase: applies patches from - /// to the application files in . - /// - Task ExecuteAsync(string appPath, string patchPath); - } + /// Backward-compatible alias for . + public interface IDirtyStrategy : GeneralUpdate.Core.Differential.IDirtyStrategy { } }