【打包】修改打包代码

main
刘涛 2026-01-27 18:44:43 +08:00
parent 054d7630eb
commit 579858dbda
2 changed files with 8 additions and 8 deletions

View File

@ -22,13 +22,10 @@ public static class HotUpadeEditorHelper
const string AOT_GENERIC_REFERENCES_PATH = "/HybridCLRGenerate/AOTGenericReferences.cs";
public static void CompileAndObfuscateAndCopyDllToTarget()
private static void _CopyObfuscateDllToTarget()
{
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
CompileDllCommand.CompileDll(target);
string obfuscatedHotUpdateDllPath = PrebuildCommandExt.GetObfuscatedHotUpdateAssemblyOutputPath(target);
ObfuscateUtil.ObfuscateHotUpdateAssemblies(target, obfuscatedHotUpdateDllPath);
Directory.CreateDirectory(Application.streamingAssetsPath);
@ -43,7 +40,7 @@ public static class HotUpadeEditorHelper
if (File.Exists(srcFile))
{
File.Copy(srcFile, dstFile, true);
Debug.Log($"[CompileAndObfuscate] Copy {srcFile} to {dstFile}");
Debug.Log($"[_CopyObfuscateDllToTarget] Copy {srcFile} to {dstFile}");
}
}
}
@ -51,6 +48,11 @@ public static class HotUpadeEditorHelper
// [MenuItem("Tools/热更新/转移热更dll")]
public static void CopyHotUpdateDll()
{
if (ObfuzSettings.Instance.buildPipelineSettings.enable)
{
_CopyObfuscateDllToTarget();
return;
}
// VersionControlSystem.Checkout(HOT_UPDATE_DLLS_DIR);
var assemblies = SettingsUtil.HotUpdateAssemblyNamesExcludePreserved;
var dir = new DirectoryInfo(Application.dataPath + HOT_UPDATE_DLL_PATH + EditorUserBuildSettings.activeBuildTarget);

View File

@ -81,17 +81,15 @@ class BuildLauncher
// PrebuildCommandExt.GenerateAll();
KedrExtensionMenu.GenerateAll();
// Obfuz 需要重新混淆热更后的dll而不是直接拷贝
// HotUpadeEditorHelper.CompileAndObfuscateAndCopyDllToTarget();
}
else
{
// #region 未接入Obfuz
PrebuildCommand.GenerateAll();
// #endregion
HotUpadeEditorHelper.CopyHotUpdateDll();
}
HotUpadeEditorHelper.CopyHotUpdateDll();
HotUpadeEditorHelper.CopyMetaDataDll();
if (ObfuzSettings.Instance.polymorphicDllSettings.enable)