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)) {