[fix] 修复检查更新未生效的bug

main 0.10.1
walon 2022-11-06 20:16:38 +08:00
parent bdc0d772c8
commit fdb9cc034a
3 changed files with 24 additions and 6 deletions

View File

@ -11,7 +11,7 @@
var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git", var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", });
BashUtil.RunCommand2(hybridclrRepoDir, "git", BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "fetch", "depth=1" }); new string[] { "fetch", "--depth=1" });
var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git", var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", });
if (ret1.StdOut != ret2.StdOut) if (ret1.StdOut != ret2.StdOut)
@ -25,7 +25,7 @@
var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
BashUtil.RunCommand2(il2cppPlusRepoDir, "git", BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "fetch", "depth=1" }); new string[] { "fetch", "--depth=1" });
var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git", var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", }); new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
if (ret1.StdOut != ret2.StdOut) if (ret1.StdOut != ret2.StdOut)

View File

@ -56,10 +56,28 @@ namespace HybridCLR
// } // }
//} //}
/// <summary>
/// 指示混合执行assembly使用原始的AOT代码。当assembly没有发生变化时必须调用此接口。
/// </summary>
/// <param name="assemblyName"></param>
/// <returns></returns>
#if UNITY_EDITOR
public static LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName)
{
return LoadImageErrorCode.OK;
}
#else
[DllImport(dllName, EntryPoint = "RuntimeApi_UseDifferentialHybridAOTAssembly")] [DllImport(dllName, EntryPoint = "RuntimeApi_UseDifferentialHybridAOTAssembly")]
public static extern LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName); public static extern LoadImageErrorCode UseDifferentialHybridAOTAssembly(string assemblyName);
#endif
/// <summary>
/// 加载差分混合执行 assembly
/// </summary>
/// <param name="dllBytes"></param>
/// <param name="optionBytes"></param>
/// <returns></returns>
public static unsafe LoadImageErrorCode LoadDifferentialHybridAssembly(byte[] dllBytes, byte[] optionBytes) public static unsafe LoadImageErrorCode LoadDifferentialHybridAssembly(byte[] dllBytes, byte[] optionBytes)
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
@ -67,16 +85,16 @@ namespace HybridCLR
#else #else
fixed(byte* dllBytesPtr = dllBytes) fixed(byte* dllBytesPtr = dllBytes)
{ {
fixed(byte* tokenPtr = optionBytes) fixed(byte* optionBytesPtr = optionBytes)
{ {
return (LoadImageErrorCode)LoadDifferentialHybridAssembly(dllBytesPtr, dllBytes.Length, tokenPtr, optionBytes.Length); return (LoadImageErrorCode)LoadDifferentialHybridAssembly(dllBytesPtr, dllBytes.Length, optionBytesPtr, optionBytes.Length);
} }
} }
#endif #endif
} }
[DllImport(dllName, EntryPoint = "RuntimeApi_LoadDifferentialHybridAssembly")] [DllImport(dllName, EntryPoint = "RuntimeApi_LoadDifferentialHybridAssembly")]
public static extern unsafe int LoadDifferentialHybridAssembly(byte* dllBytes, int dllSize, byte* notChangeMethodTokens, int tokenCount); public static extern unsafe int LoadDifferentialHybridAssembly(byte* dllBytes, int dllSize, byte* optionBytesPtr, int optionBytesLength);
/// <summary> /// <summary>
/// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小) /// 获取解释器线程栈的最大StackObject个数(size*8 为最终占用的内存大小)

View File

@ -1,6 +1,6 @@
{ {
"name": "com.focus-creative-games.hybridclr_unity", "name": "com.focus-creative-games.hybridclr_unity",
"version": "0.10.0", "version": "0.10.1",
"displayName": "HybridCLR", "displayName": "HybridCLR",
"description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR", "description": "Unity package for HybridCLR. It includes editor and runtime scripts and assets for HybridCLR",
"category": "Runtime", "category": "Runtime",