hybridclr_unity/Editor/Commands/ReversePInvokeWrapperGenera...

50 lines
1.9 KiB
C#
Raw Normal View History

//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
//namespace HybridCLR.Editor.Commands
//{
2022-09-22 08:56:07 +08:00
// public static class ReversePInvokeWrapperGeneratorCommand
// {
2022-09-22 08:56:07 +08:00
// [MenuItem("HybridCLR/Generate/ReversePInvokeWrapper", priority = 103)]
// public static void CompileAndGenerateReversePInvokeWrapper()
// {
// BuildTarget target = EditorUserBuildSettings.activeBuildTarget;
// CompileDllCommand.CompileDll(target);
// GenerateReversePInvokeWrapper(target);
// }
// 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();
// string outputFile = $"{SettingsUtil.GeneratedCppDir}/ReversePInvokeMethodStub.cpp";
2022-10-17 12:16:18 +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();
// }
// }
//}