mirror of
https://github.com/focus-creative-games/hybridclr_unity.git
synced 2026-11-20 07:22:39 +08:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 95922aec1e | |||
| 3259c11828 | |||
| 74bab1d935 | |||
| fd81edb495 | |||
| 12bafb897f | |||
| a6befb1312 | |||
| a36e3fe72d | |||
| d9776d1793 | |||
| 2697eb5a90 | |||
| 4879bb7f44 | |||
| 24f85780a2 |
@@ -2,28 +2,28 @@
|
||||
"versions": [
|
||||
{
|
||||
"unity_version":"2019",
|
||||
"hybridclr" : { "branch":"v5.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-5.0.0"}
|
||||
"hybridclr" : { "branch":"v5.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2019-5.3.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2020",
|
||||
"hybridclr" : { "branch":"v5.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2020-5.1.0"}
|
||||
"hybridclr" : { "branch":"v5.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2020-5.3.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2021",
|
||||
"hybridclr" : { "branch":"v5.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2021-5.1.0"}
|
||||
"hybridclr" : { "branch":"v5.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2021-5.3.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2022",
|
||||
"hybridclr" : { "branch":"v5.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-5.2.0"}
|
||||
"hybridclr" : { "branch":"v5.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-5.3.0"}
|
||||
},
|
||||
{
|
||||
"unity_version":"2022-tuanjie",
|
||||
"hybridclr" : { "branch":"v5.2.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-tuanjie-5.2.0"}
|
||||
"hybridclr" : { "branch":"v5.3.0"},
|
||||
"il2cpp_plus": { "branch":"v2022-tuanjie-5.3.0"}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -12,7 +12,7 @@ using System.IO;
|
||||
|
||||
namespace HybridCLR.MonoHook
|
||||
{
|
||||
#if (UNITY_2021_1_OR_NEWER && UNITY_WEBGL) || TUANJIE_2022
|
||||
#if (UNITY_2021_1_OR_NEWER && UNITY_WEBGL) || TUANJIE_2022_3_OR_NEWER
|
||||
[InitializeOnLoad]
|
||||
public class PatchScriptingAssembliesJsonHook
|
||||
{
|
||||
@@ -36,7 +36,7 @@ namespace HybridCLR.MonoHook
|
||||
private static string BuildMainWindowTitle()
|
||||
{
|
||||
string tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WebGL/Data/ScriptingAssemblies.json";
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.WeixinMiniGame)
|
||||
{
|
||||
tempJsonPath = $"{Application.dataPath}/../Library/PlayerDataCache/WeixinMiniGame/Data/ScriptingAssemblies.json";
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Text;
|
||||
using UnityEditor;
|
||||
using System.Reflection;
|
||||
using HybridCLR.Editor.Settings;
|
||||
#if UNITY_2019 && UNITY_IOS
|
||||
#if UNITY_2019 && (UNITY_IOS || UNITY_TVOS)
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
@@ -32,7 +32,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
[PostProcessBuild]
|
||||
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
||||
{
|
||||
if (target != BuildTarget.iOS || !HybridCLRSettings.Instance.enable)
|
||||
if (!HybridCLRSettings.Instance.enable)
|
||||
return;
|
||||
/*
|
||||
* 1. 生成lump,并且添加到工程
|
||||
@@ -147,6 +147,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
newPro += " $(SRCROOT)/Libraries/external/xxHash";
|
||||
}
|
||||
newPro += " $(SRCR00T)/Libraries/external/mono";
|
||||
//Debug.Log($"config:{bcn} new prop:{newPro}");
|
||||
proj.SetBuildPropertyForConfig(configGuid, headerSearchPaths, newPro);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Text;
|
||||
using UnityEditor;
|
||||
using System.Reflection;
|
||||
using HybridCLR.Editor.Settings;
|
||||
#if (UNITY_2020 || UNITY_2021) && UNITY_IOS
|
||||
#if (UNITY_2020 || UNITY_2021) && (UNITY_IOS || UNITY_TVOS)
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
@@ -32,7 +32,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
[PostProcessBuild]
|
||||
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
||||
{
|
||||
if (target != BuildTarget.iOS || !HybridCLRSettings.Instance.enable)
|
||||
if (!HybridCLRSettings.Instance.enable)
|
||||
return;
|
||||
/*
|
||||
* 1. 生成lump,并且添加到工程
|
||||
@@ -132,6 +132,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
newPro += " $(SRCROOT)/Libraries/external/xxHash";
|
||||
}
|
||||
newPro += " $(SRCR00T)/Libraries/external/mono";
|
||||
//Debug.Log($"config:{bcn} new prop:{newPro}");
|
||||
proj.SetBuildPropertyForConfig(configGuid, headerSearchPaths, newPro);
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEditor.Build;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_2022_2_OR_NEWER && UNITY_IOS
|
||||
#if UNITY_2022_2_OR_NEWER && (UNITY_IOS || UNITY_TVOS)
|
||||
|
||||
namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
@@ -22,10 +22,13 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
[PostProcessBuild]
|
||||
public static void OnPostProcessBuild(BuildTarget target, string pathToBuiltProject)
|
||||
{
|
||||
if (target != BuildTarget.iOS || !HybridCLRSettings.Instance.enable)
|
||||
if (!HybridCLRSettings.Instance.enable)
|
||||
return;
|
||||
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
string pbxprojFile = $"{pathToBuiltProject}/Tuanjie-iPhone.xcodeproj/project.pbxproj";
|
||||
#else
|
||||
string pbxprojFile = $"{pathToBuiltProject}/Unity-iPhone.xcodeproj/project.pbxproj";
|
||||
#endif
|
||||
RemoveExternalLibil2cppOption(pbxprojFile);
|
||||
CopyLibil2cppToXcodeProj(pathToBuiltProject);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
return $"{projectDir}/Library/Bee/artifacts/PS4PlayerBuildProgram/ManagedStripped";
|
||||
case BuildTarget.PS5:
|
||||
return $"{projectDir}/Library/Bee/artifacts/PS5PlayerBuildProgram/ManagedStripped";
|
||||
#if TUANJIE_2022
|
||||
case BuildTarget.tvOS:
|
||||
return $"{projectDir}/Library/Bee/artifacts/iOS/ManagedStripped";
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
case BuildTarget.WeixinMiniGame:
|
||||
return $"{projectDir}/Library/Bee/artifacts/WeixinMiniGame/ManagedStripped";
|
||||
case BuildTarget.OpenHarmony:
|
||||
@@ -64,9 +66,10 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
}
|
||||
|
||||
public void OnBeforeConvertRun(BuildReport report, Il2CppBuildPipelineData data)
|
||||
{
|
||||
{
|
||||
// 此回调只在 2020中调用
|
||||
CopyStripDlls(GetStripAssembliesDir2020(data.target), data.target);
|
||||
BuildTarget target = report.summary.platform;
|
||||
CopyStripDlls(GetStripAssembliesDir2020(target), target);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -94,7 +97,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
public void OnPostprocessBuild(BuildReport report)
|
||||
{
|
||||
#if UNITY_2021_1_OR_NEWER
|
||||
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
||||
BuildTarget target = report.summary.platform;
|
||||
string srcStripDllPath = GetStripAssembliesDir2021(target);
|
||||
if (!string.IsNullOrEmpty(srcStripDllPath) && Directory.Exists(srcStripDllPath))
|
||||
{
|
||||
@@ -105,7 +108,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
{
|
||||
BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
||||
BuildTarget target = report.summary.platform;
|
||||
var dstPath = SettingsUtil.GetAssembliesPostIl2CppStripDir(target);
|
||||
BashUtil.RecreateDir(dstPath);
|
||||
}
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace HybridCLR.Editor.Commands
|
||||
switch(target)
|
||||
{
|
||||
case BuildTarget.StandaloneWindows:
|
||||
case BuildTarget.StandaloneWindows64: return $"{buildDir}/{target}";
|
||||
case BuildTarget.StandaloneWindows64: return $"{buildDir}/{PlayerSettings.productName}.exe";
|
||||
case BuildTarget.StandaloneOSX: return buildDir;
|
||||
case BuildTarget.iOS: return buildDir;
|
||||
case BuildTarget.Android: return buildDir;
|
||||
case BuildTarget.StandaloneLinux64: return buildDir;
|
||||
case BuildTarget.StandaloneLinux64: return $"{buildDir}/{PlayerSettings.productName}";
|
||||
default: return buildDir;
|
||||
}
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace HybridCLR.Editor.Commands
|
||||
#elif UNITY_EDITOR_WIN
|
||||
bool oldCreateSolution = UnityEditor.WindowsStandalone.UserBuildSettings.createSolution;
|
||||
#endif
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
bool oldOpenHarmonyProj = EditorUserBuildSettings.exportAsOpenHarmonyProject;
|
||||
#endif
|
||||
bool oldBuildScriptsOnly = EditorUserBuildSettings.buildScriptsOnly;
|
||||
@@ -108,7 +108,7 @@ namespace HybridCLR.Editor.Commands
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
case BuildTarget.HMIAndroid:
|
||||
#endif
|
||||
case BuildTarget.Android:
|
||||
@@ -116,7 +116,7 @@ namespace HybridCLR.Editor.Commands
|
||||
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
|
||||
break;
|
||||
}
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
case BuildTarget.OpenHarmony:
|
||||
{
|
||||
EditorUserBuildSettings.exportAsOpenHarmonyProject = true;
|
||||
@@ -158,7 +158,7 @@ namespace HybridCLR.Editor.Commands
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
case BuildTarget.HMIAndroid:
|
||||
#endif
|
||||
case BuildTarget.Android:
|
||||
@@ -166,7 +166,7 @@ namespace HybridCLR.Editor.Commands
|
||||
EditorUserBuildSettings.exportAsGoogleAndroidProject = oldExportAndroidProj;
|
||||
break;
|
||||
}
|
||||
#if TUANJIE_2022
|
||||
#if TUANJIE_2022_3_OR_NEWER
|
||||
case BuildTarget.OpenHarmony:
|
||||
{
|
||||
EditorUserBuildSettings.exportAsOpenHarmonyProject = oldOpenHarmonyProj;
|
||||
|
||||
@@ -60,6 +60,16 @@ namespace HybridCLR.Editor.Il2CppDef
|
||||
}
|
||||
}
|
||||
|
||||
#if TUANJIE_1_1_OR_NEWER
|
||||
var tuanjieMatch = Regex.Matches(Application.tuanjieVersion, @"(\d+)\.(\d+)\.(\d+)");
|
||||
int tuanjieMajorVer = int.Parse(tuanjieMatch[0].Groups[1].Value);
|
||||
int tuanjieMinorVer1 = int.Parse(tuanjieMatch[0].Groups[2].Value);
|
||||
int tuanjieMinorVer2 = int.Parse(tuanjieMatch[0].Groups[3].Value);
|
||||
lines.Add($"#define HYBRIDCLR_TUANJIE_VERSION {tuanjieMajorVer}{tuanjieMinorVer1.ToString("D2")}{tuanjieMinorVer2.ToString("D2")}");
|
||||
#elif TUANJIE_2022_3_OR_NEWER
|
||||
lines.Add($"#define HYBRIDCLR_TUANJIE_VERSION 10000");
|
||||
#endif
|
||||
|
||||
frr.Replace("UNITY_VERSION", string.Join("\n", lines));
|
||||
|
||||
frr.Commit(_options.OutputFile);
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace HybridCLR.Editor.Meta
|
||||
{
|
||||
//Debug.Log($"do load module:{dllPath}");
|
||||
ModuleDefMD mod = ModuleDefMD.Load(File.ReadAllBytes(dllPath), _modCtx);
|
||||
mod.EnableTypeDefFindCache = true;
|
||||
_asmResolver.AddToCache(mod);
|
||||
_loadedModulesIncludeNetstandard.Add(mod);
|
||||
return mod;
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace HybridCLR.Editor.ReversePInvokeWrap
|
||||
codes.Add($@"
|
||||
{method.ReturnInfo.Type.GetTypeName()} __ReversePInvokeMethod_{methodIndex}({paramDeclaringListWithoutMethodInfoStr})
|
||||
{{
|
||||
il2cpp::vm::ScopedThreadAttacher _vmThreadHelper;
|
||||
const MethodInfo* method = MetadataModule::GetMethodInfoByReversePInvokeWrapperIndex({methodIndex});
|
||||
{methodTypeDef};
|
||||
{(method.ReturnInfo.IsVoid ? "" : "return ")}((Callback)(method->methodPointerCallByInterp))({paramNameListWithoutMethodInfoStr});
|
||||
|
||||
@@ -1,5 +1,40 @@
|
||||
# 发布日志
|
||||
|
||||
## 5.3.0
|
||||
|
||||
发布日期 2024.4.22.
|
||||
|
||||
### Runtime
|
||||
|
||||
- [fix] 修复WebGL平台MachineState::CollectFramesWithoutDuplicates错误地使用hybridclr::metadata::IsInterpreterMethod移除热更新函数,导致补充元数据函数没有移除,StackFrames列表越来越长,打印Stack时死循环的bug。调整实现,统一使用il2cpp::vm::StackTrace::PushFrame及PopFrame实现完美的解释器栈打印。缺点是调用解释器函数增加了维护栈的开销
|
||||
- [fix] 修复StringUtils::Utf16ToUtf8未正确处理maxinumSize==0,导致InterpreterImage::ConvertConstValue中转换长度为0的string时巨幅溢出的严重bug
|
||||
- [fix] 修复__ReversePInvokeMethod_XXX函数未设置Il2CppThreadContext,导致从native线程回调时获取Thread变量崩溃的bug
|
||||
- [merge] 合并 2021.3.34-2021.3.37f1 il2cpp改动
|
||||
- [merge] 合并 2022.3.19-2022.3.23f1 il2cpp改动
|
||||
|
||||
### Editor
|
||||
|
||||
- [fix] 修复导出tvOS工程时未修改xcode工程设置,导致打包失败的bug
|
||||
- [fix] 修复构建tvOS目标时未复制裁剪AOT dll,导致生成桥接函数失败的bug
|
||||
- [fix] 解决StripAOTDllCommand生成的临时项目的locationPathName不规范导致与某些插件如Embeded Browser不兼容的问题
|
||||
- [fix] 修复团结引擎1.1.0起删除TUANJIE_2022宏导致没有复制裁剪后的AOT程序集的bug
|
||||
- [fix] 修复__ReversePInvokeMethod_XXX函数未设置Il2CppThreadContext,导致从native线程回调时获取Thread变量崩溃的bug
|
||||
- [fix] 修复iOS平台开启development build选项时出现mono相关头文件找不到的bug
|
||||
|
||||
## 5.2.1
|
||||
|
||||
发布日期 2024.4.7.
|
||||
|
||||
### Runtime
|
||||
|
||||
- [fix] 修复WebGL平台不打印堆栈日志的bug
|
||||
- [fix] 修复RuntimeConfig::GetRuntimeOption获取InterpreterThreadExceptionFlowSize错误返回s_threadFrameStackSize的bug
|
||||
|
||||
### Editor
|
||||
|
||||
- [opt] LoadModule中设置 mod.EnableTypeDefFindCache = true,计算桥接函数的时间缩短为原来的1/3
|
||||
- [fix] 修复团结引擎导出iOS平台xcode工程文件名改名为Tuanjie-iPhone.xcodeproj导致构建xcode工程失败的bug
|
||||
|
||||
## 5.2.0
|
||||
|
||||
发布日期 2024.3.25.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "com.code-philosophy.hybridclr",
|
||||
"version": "5.2.0",
|
||||
"version": "5.3.0",
|
||||
"displayName": "HybridCLR",
|
||||
"description": "HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.",
|
||||
"category": "Runtime",
|
||||
|
||||
Reference in New Issue
Block a user