hybridclr_unity/Editor/Commands/PrebuildCommand.cs

30 lines
995 B
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEditor;
namespace HybridCLR.Editor.Commands
{
public static class PrebuildCommand
{
/// <summary>
/// 按照必要的顺序,执行所有生成操作,适合打包前操作
/// </summary>
[MenuItem("HybridCLR/Generate/All", priority = 200)]
public static void GenerateAll()
{
// 顺序随意
ReversePInvokeWrapperGeneratorCommand.GenerateReversePInvokeWrapper();
// AOTReferenceGeneratorCommand 涉及到代码生成必须在MethodBridgeGeneratorCommand之前
AOTReferenceGeneratorCommand.GenerateAOTGenericReference();
MethodBridgeGeneratorCommand.GenerateMethodBridge();
// 顺序随意,只要保证 GenerateLinkXml之前有调用过CompileDll即可
LinkGeneratorCommand.GenerateLinkXml(false);
}
}
}