2024-05-26 11:59:54 +08:00
|
|
|
|
//using HybridCLR.Editor.ABI;
|
|
|
|
|
//using HybridCLR.Editor.Link;
|
|
|
|
|
//using HybridCLR.Editor.Meta;
|
|
|
|
|
//using HybridCLR.Editor.ReversePInvokeWrap;
|
|
|
|
|
//using System;
|
|
|
|
|
//using System.Collections.Generic;
|
|
|
|
|
//using System.IO;
|
|
|
|
|
//using System.Linq;
|
|
|
|
|
//using System.Reflection;
|
|
|
|
|
//using System.Text;
|
|
|
|
|
//using System.Threading.Tasks;
|
|
|
|
|
//using UnityEditor;
|
|
|
|
|
//using UnityEngine;
|
2022-09-22 08:56:07 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
//namespace HybridCLR.Editor.Commands
|
|
|
|
|
//{
|
2022-09-22 08:56:07 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// public static class ReversePInvokeWrapperGeneratorCommand
|
|
|
|
|
// {
|
2022-09-22 08:56:07 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// [MenuItem("HybridCLR/Generate/ReversePInvokeWrapper", priority = 103)]
|
2022-12-14 14:11:32 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// public static void CompileAndGenerateReversePInvokeWrapper()
|
|
|
|
|
// {
|
|
|
|
|
// BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
|
|
|
|
|
// CompileDllCommand.CompileDll(target);
|
|
|
|
|
// GenerateReversePInvokeWrapper(target);
|
|
|
|
|
// }
|
2022-12-14 14:11:32 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// public static void GenerateReversePInvokeWrapper(BuildTarget target)
|
|
|
|
|
// {
|
|
|
|
|
// List<string> hotUpdateDlls = SettingsUtil.HotUpdateAssemblyNamesExcludePreserved;
|
|
|
|
|
// var cache = new AssemblyCache(MetaUtil.CreateHotUpdateAndAOTAssemblyResolver(target, hotUpdateDlls));
|
|
|
|
|
// {
|
|
|
|
|
// var analyzer = new ReversePInvokeWrap.Analyzer(cache, hotUpdateDlls);
|
|
|
|
|
// analyzer.Run();
|
2022-10-17 21:38:39 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// string outputFile = $"{SettingsUtil.GeneratedCppDir}/ReversePInvokeMethodStub.cpp";
|
2022-10-17 12:16:18 +08:00
|
|
|
|
|
2024-05-26 11:59:54 +08:00
|
|
|
|
// List<ABIReversePInvokeMethodInfo> methods = analyzer.BuildABIMethods();
|
|
|
|
|
// Debug.Log($"GenerateReversePInvokeWrapper. wraperCount:{methods.Sum(m => m.Count)} output:{outputFile}");
|
|
|
|
|
// var generator = new Generator();
|
|
|
|
|
// generator.Generate(methods, outputFile);
|
|
|
|
|
// Debug.LogFormat("[ReversePInvokeWrapperGeneratorCommand] output:{0}", outputFile);
|
|
|
|
|
// }
|
|
|
|
|
// MethodBridgeGeneratorCommand.CleanIl2CppBuildCache();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//}
|