[fix] 修复2019版本MonoBleedingEdge的子目录中包含了过长路径的文件导致Installer复制文件出错的问题
[change] StripAOTDllCommand失败时抛出异常而不是打印错误日志main
parent
1045538b40
commit
2894701063
|
@ -113,8 +113,7 @@ namespace HybridCLR.Editor.Commands
|
||||||
|
|
||||||
if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
if (report.summary.result != UnityEditor.Build.Reporting.BuildResult.Succeeded)
|
||||||
{
|
{
|
||||||
Debug.LogError("GenerateStripedAOTDlls 失败");
|
throw new Exception("GenerateStripedAOTDlls 失败");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
Debug.Log($"GenerateStripedAOTDlls target:{target} group:{group} path:{outputPath}");
|
Debug.Log($"GenerateStripedAOTDlls target:{target} group:{group} path:{outputPath}");
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,6 +88,21 @@ namespace HybridCLR.Editor.Installer
|
||||||
Directory.CreateDirectory(dir);
|
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)
|
public static void CopyDir(string src, string dst, bool log = false)
|
||||||
{
|
{
|
||||||
if (log)
|
if (log)
|
||||||
|
@ -98,7 +113,7 @@ namespace HybridCLR.Editor.Installer
|
||||||
Directory.CreateDirectory(dst);
|
Directory.CreateDirectory(dst);
|
||||||
foreach(var file in Directory.GetFiles(src))
|
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))
|
foreach(var subDir in Directory.GetDirectories(src))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue