Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/c#/GeneralUpdate.Core/Configuration/AbstractBootstrap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ protected T GetOption<T>(UpdateOption<T>? option)
public TBootstrap DownloadOrchestrator<T>() where T : Download.Abstractions.IDownloadOrchestrator, new()
{ _extensions[typeof(Download.Abstractions.IDownloadOrchestrator)] = typeof(T); return (TBootstrap)this; }

/// <summary>Register a custom clean strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
public TBootstrap CleanStrategy<T>() where T : class, new()
{ _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; }
public TBootstrap CleanStrategy<T>() where T : Differential.ICleanStrategy, new()
{ _extensions[typeof(Differential.ICleanStrategy)] = typeof(T); return (TBootstrap)this; }

/// <summary>Register a custom dirty strategy by type name (interface lives in GeneralUpdate.Differential).</summary>
public TBootstrap DirtyStrategy<T>() where T : class, new()
{ _extensions[typeof(T)] = typeof(T); return (TBootstrap)this; }
public TBootstrap DirtyStrategy<T>() where T : Differential.IDirtyStrategy, new()
{ _extensions[typeof(Differential.IDirtyStrategy)] = typeof(T); return (TBootstrap)this; }

public TBootstrap ConfigureBlackList(BlackListConfig config)
{
Expand Down
18 changes: 18 additions & 0 deletions src/c#/GeneralUpdate.Core/Differential/ICleanStrategy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System.Threading.Tasks;

namespace GeneralUpdate.Core.Differential;

/// <summary>
/// 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.
/// </summary>
public interface ICleanStrategy
{
/// <summary>
/// Executes the Clean phase: compares <paramref name="sourcePath"/> with
/// <paramref name="targetPath"/> and writes the resulting patch artifacts to
/// <paramref name="patchPath"/>.
/// </summary>
Task ExecuteAsync(string sourcePath, string targetPath, string patchPath);
}
17 changes: 17 additions & 0 deletions src/c#/GeneralUpdate.Core/Differential/IDirtyStrategy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System.Threading.Tasks;

namespace GeneralUpdate.Core.Differential;

/// <summary>
/// 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.
/// </summary>
public interface IDirtyStrategy
{
/// <summary>
/// Executes the Dirty phase: applies patches from <paramref name="patchPath"/>
/// to the application files in <paramref name="appPath"/>.
/// </summary>
Task ExecuteAsync(string appPath, string patchPath);
}
19 changes: 3 additions & 16 deletions src/c#/GeneralUpdate.Differential/Matchers/ICleanStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
using System.Threading.Tasks;

// ReSharper disable once CheckNamespace
namespace GeneralUpdate.Differential.Matchers
{
/// <summary>
/// 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.
/// </summary>
public interface ICleanStrategy
{
/// <summary>
/// Executes the Clean phase: compares <paramref name="sourcePath"/> with
/// <paramref name="targetPath"/> and writes the resulting patch artifacts to
/// <paramref name="patchPath"/>.
/// </summary>
Task ExecuteAsync(string sourcePath, string targetPath, string patchPath);
}
/// <summary>Backward-compatible alias for <see cref="Core.Differential.ICleanStrategy"/>.</summary>
public interface ICleanStrategy : GeneralUpdate.Core.Differential.ICleanStrategy { }
}
18 changes: 3 additions & 15 deletions src/c#/GeneralUpdate.Differential/Matchers/IDirtyStrategy.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
using System.Threading.Tasks;

// ReSharper disable once CheckNamespace
namespace GeneralUpdate.Differential.Matchers
{
/// <summary>
/// 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.
/// </summary>
public interface IDirtyStrategy
{
/// <summary>
/// Executes the Dirty phase: applies patches from <paramref name="patchPath"/>
/// to the application files in <paramref name="appPath"/>.
/// </summary>
Task ExecuteAsync(string appPath, string patchPath);
}
/// <summary>Backward-compatible alias for <see cref="Core.Differential.IDirtyStrategy"/>.</summary>
public interface IDirtyStrategy : GeneralUpdate.Core.Differential.IDirtyStrategy { }
}
Loading