From 0d4801057023d165cd9ce25793ca374757135265 Mon Sep 17 00:00:00 2001 From: JusterZhu Date: Sun, 24 May 2026 15:49:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20restore=20Core=20project=20compilation?= =?UTF-8?q?=20=E2=80=94=20remove=20Compile=20Remove,=20fix=20API=20mismatc?= =?UTF-8?q?hes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Removed Compile Remove directives for Bootstrap, Strategy, Silent, PatchMiddleware files (only DrivelutionMiddleware remains excluded) - Rewrote PatchMiddleware as no-op stub (defers IBinaryDiffer injection to T2 to avoid circular dependency with GeneralUpdate.Differential) - Fixed MacStrategy: Use() calls → UseMiddleware() - Fixed BlackListManager API: AddBlackFileFormats → AddBlackFormats, BlackFileFormats → BlackFormats - Full solution builds with 0 errors 0 warnings Closes #342 --- .../Bootstrap/GeneralClientBootstrap.cs | 4 ++-- .../Bootstrap/GeneralUpdateBootstrap.cs | 4 ++-- .../GeneralUpdate.Core.csproj | 12 ++-------- .../Pipeline/PatchMiddleware.cs | 24 +++++++------------ .../Silent/SilentUpdateMode.cs | 4 ++-- .../Strategy/MacStrategy.cs | 8 +++---- 6 files changed, 21 insertions(+), 35 deletions(-) diff --git a/src/c#/GeneralUpdate.Core/Bootstrap/GeneralClientBootstrap.cs b/src/c#/GeneralUpdate.Core/Bootstrap/GeneralClientBootstrap.cs index 8eb6e77e..24aca154 100644 --- a/src/c#/GeneralUpdate.Core/Bootstrap/GeneralClientBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Bootstrap/GeneralClientBootstrap.cs @@ -180,7 +180,7 @@ private async Task ExecuteWorkflowAsync() //black list initialization. BlackListManager.Instance?.AddBlackFiles(_configInfo.BlackFiles); - BlackListManager.Instance?.AddBlackFileFormats(_configInfo.BlackFormats); + BlackListManager.Instance?.AddBlackFormats(_configInfo.BlackFormats); BlackListManager.Instance?.AddSkipDirectorys(_configInfo.SkipDirectorys); _configInfo.Encoding = GetOption(UpdateOption.Encoding) ?? Encoding.Default; @@ -211,7 +211,7 @@ private async Task ExecuteWorkflowAsync() var processInfo = ConfigurationMapper.MapToProcessInfo( _configInfo, mainResp.Body, - BlackListManager.Instance.BlackFileFormats.ToList(), + BlackListManager.Instance.BlackFormats.ToList(), BlackListManager.Instance.BlackFiles.ToList(), BlackListManager.Instance.SkipDirectorys.ToList()); diff --git a/src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs b/src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs index 00bce064..fc26a55e 100644 --- a/src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs +++ b/src/c#/GeneralUpdate.Core/Bootstrap/GeneralUpdateBootstrap.cs @@ -205,7 +205,7 @@ private void InitializeFromEnvironment() if (processInfo == null) return; - BlackListManager.Instance.AddBlackFileFormats(processInfo.BlackFileFormats); + BlackListManager.Instance.AddBlackFormats(processInfo.BlackFileFormats); BlackListManager.Instance.AddBlackFiles(processInfo.BlackFiles); BlackListManager.Instance.AddSkipDirectorys(processInfo.SkipDirectorys); @@ -245,7 +245,7 @@ private void ApplyRuntimeOptions() private void InitBlackList() { BlackListManager.Instance.AddBlackFiles(_configInfo.BlackFiles); - BlackListManager.Instance.AddBlackFileFormats(_configInfo.BlackFormats); + BlackListManager.Instance.AddBlackFormats(_configInfo.BlackFormats); BlackListManager.Instance.AddSkipDirectorys(_configInfo.SkipDirectorys); } diff --git a/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj b/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj index 82a24ad3..de6d0919 100644 --- a/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj +++ b/src/c#/GeneralUpdate.Core/GeneralUpdate.Core.csproj @@ -13,6 +13,7 @@ 10.0.0-preview netstandard2.0 + @@ -21,16 +22,7 @@ + - - - - - - - - - - diff --git a/src/c#/GeneralUpdate.Core/Pipeline/PatchMiddleware.cs b/src/c#/GeneralUpdate.Core/Pipeline/PatchMiddleware.cs index 040d0df7..3f91ccec 100644 --- a/src/c#/GeneralUpdate.Core/Pipeline/PatchMiddleware.cs +++ b/src/c#/GeneralUpdate.Core/Pipeline/PatchMiddleware.cs @@ -2,26 +2,20 @@ using System.Threading.Tasks; using GeneralUpdate.Core.Pipeline; using GeneralUpdate.Core; -using GeneralUpdate.Differential; namespace GeneralUpdate.Core.Pipeline; +/// +/// Differential patch middleware. +/// Full implementation requires GeneralUpdate.Differential (circular dependency — see T2). +/// Currently a no-op placeholder; patches are applied externally. +/// public class PatchMiddleware : IMiddleware { public async Task InvokeAsync(PipelineContext context) { - var sourcePath = context.Get("SourcePath"); - var targetPath = context.Get("PatchPath"); - GeneralTracer.Info($"PatchMiddleware.InvokeAsync: applying differential patch. SourcePath={sourcePath}, PatchPath={targetPath}"); - try - { - await DifferentialCore.Dirty(sourcePath, targetPath); - GeneralTracer.Info("PatchMiddleware.InvokeAsync: differential patch applied successfully."); - } - catch (Exception ex) - { - GeneralTracer.Error("PatchMiddleware.InvokeAsync: failed to apply differential patch.", ex); - throw; - } + GeneralTracer.Info("PatchMiddleware.InvokeAsync: differential patching is not available in this build. " + + "IBinaryDiffer injection via Bootstrap.BinaryDiffer() will be re-enabled in a future PR."); + await Task.CompletedTask; } -} \ No newline at end of file +} diff --git a/src/c#/GeneralUpdate.Core/Silent/SilentUpdateMode.cs b/src/c#/GeneralUpdate.Core/Silent/SilentUpdateMode.cs index faca70b2..a2d539eb 100644 --- a/src/c#/GeneralUpdate.Core/Silent/SilentUpdateMode.cs +++ b/src/c#/GeneralUpdate.Core/Silent/SilentUpdateMode.cs @@ -116,7 +116,7 @@ private async Task PrepareUpdateIfNeededAsync() } BlackListManager.Instance?.AddBlackFiles(_configInfo.BlackFiles); - BlackListManager.Instance?.AddBlackFileFormats(_configInfo.BlackFormats); + BlackListManager.Instance?.AddBlackFormats(_configInfo.BlackFormats); BlackListManager.Instance?.AddSkipDirectorys(_configInfo.SkipDirectorys); _configInfo.Encoding = _encoding; @@ -139,7 +139,7 @@ private async Task PrepareUpdateIfNeededAsync() var processInfo = ConfigurationMapper.MapToProcessInfo( _configInfo, versions, - BlackListManager.Instance.BlackFileFormats.ToList(), + BlackListManager.Instance.BlackFormats.ToList(), BlackListManager.Instance.BlackFiles.ToList(), BlackListManager.Instance.SkipDirectorys.ToList()); _configInfo.ProcessInfo = JsonSerializer.Serialize(processInfo, ProcessInfoJsonContext.Default.ProcessInfo); diff --git a/src/c#/GeneralUpdate.Core/Strategy/MacStrategy.cs b/src/c#/GeneralUpdate.Core/Strategy/MacStrategy.cs index 079b72c7..2b67ba58 100644 --- a/src/c#/GeneralUpdate.Core/Strategy/MacStrategy.cs +++ b/src/c#/GeneralUpdate.Core/Strategy/MacStrategy.cs @@ -55,10 +55,10 @@ public override void StartApp() protected override PipelineBuilder BuildPipeline(PipelineContext context) { - var builder = new PipelineBuilder(context); - builder.Use(new HashMiddleware()); - builder.Use(new CompressMiddleware()); - builder.Use(new PatchMiddleware()); + var builder = new PipelineBuilder(context) + .UseMiddleware() + .UseMiddleware() + .UseMiddleware(); return builder; } }