From 2894701063faf827c08fbef418966a861d68c919 Mon Sep 17 00:00:00 2001 From: walon Date: Sun, 30 Apr 2023 01:35:25 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=20=E4=BF=AE=E5=A4=8D2019=E7=89=88?= =?UTF-8?q?=E6=9C=ACMonoBleedingEdge=E7=9A=84=E5=AD=90=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E4=B8=AD=E5=8C=85=E5=90=AB=E4=BA=86=E8=BF=87=E9=95=BF=E8=B7=AF?= =?UTF-8?q?=E5=BE=84=E7=9A=84=E6=96=87=E4=BB=B6=E5=AF=BC=E8=87=B4Installer?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E6=96=87=E4=BB=B6=E5=87=BA=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20[change]=20StripAOTDllCommand=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8=E8=80=8C?= =?UTF-8?q?=E4=B8=8D=E6=98=AF=E6=89=93=E5=8D=B0=E9=94=99=E8=AF=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Editor/Commands/StripAOTDllCommand.cs | 3 +-- Editor/Installer/BashUtil.cs | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Editor/Commands/StripAOTDllCommand.cs b/Editor/Commands/StripAOTDllCommand.cs index 0a66cfc..c893a56 100644 --- a/Editor/Commands/StripAOTDllCommand.cs +++ b/Editor/Commands/StripAOTDllCommand.cs @@ -113,8 +113,7 @@ namespace HybridCLR.Editor.Commands if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded) { - Debug.LogError("GenerateStripedAOTDlls 失败"); - return; + throw new Exception("GenerateStripedAOTDlls 失败"); } Debug.Log($"GenerateStripedAOTDlls target:{target} group:{group} path:{outputPath}"); } diff --git a/Editor/Installer/BashUtil.cs b/Editor/Installer/BashUtil.cs index 565f228..2dee189 100644 --- a/Editor/Installer/BashUtil.cs +++ b/Editor/Installer/BashUtil.cs @@ -88,6 +88,21 @@ namespace HybridCLR.Editor.Installer Directory.CreateDirectory(dir); } + private static void CopyWithCheckLongFile(string srcFile, string dstFile) + { + if (srcFile.Length > 255) + { + UnityEngine.Debug.LogError($"srcFile:{srcFile} path is too long. copy ignore!"); + return; + } + if (dstFile.Length > 255) + { + UnityEngine.Debug.LogError($"dstFile:{dstFile} path is too long. copy ignore!"); + return; + } + File.Copy(srcFile, dstFile); + } + public static void CopyDir(string src, string dst, bool log = false) { if (log) @@ -98,7 +113,7 @@ namespace HybridCLR.Editor.Installer Directory.CreateDirectory(dst); foreach(var file in Directory.GetFiles(src)) { - File.Copy(file, $"{dst}/{Path.GetFileName(file)}"); + CopyWithCheckLongFile(file, $"{dst}/{Path.GetFileName(file)}"); } foreach(var subDir in Directory.GetDirectories(src)) {