[fix] 修复不正确地从EditorUserBuildSettings.selectedBuildTargetGroup获得BuildGroupTarget的bug
parent
9cf8f19517
commit
1eaaf44c97
|
@ -7,6 +7,7 @@ using UnityEditor;
|
|||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
using static UnityEngine.GraphicsBuffer;
|
||||
|
||||
namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
|
@ -39,7 +40,7 @@ namespace HybridCLR.Editor.BuildProcessors
|
|||
{
|
||||
return;
|
||||
}
|
||||
BuildTargetGroup buildTargetGroup = EditorUserBuildSettings.selectedBuildTargetGroup;
|
||||
BuildTargetGroup buildTargetGroup = BuildPipeline.GetBuildTargetGroup(EditorUserBuildSettings.activeBuildTarget);
|
||||
ScriptingImplementation curScriptingImplementation = PlayerSettings.GetScriptingBackend(buildTargetGroup);
|
||||
ScriptingImplementation targetScriptingImplementation = ScriptingImplementation.IL2CPP;
|
||||
if (curScriptingImplementation != targetScriptingImplementation)
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace HybridCLR.Editor.Commands
|
|||
LinkGeneratorCommand.GenerateLinkXml(target);
|
||||
|
||||
// 生成裁剪后的aot dll
|
||||
StripAOTDllCommand.GenerateStripedAOTDlls(target, EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
StripAOTDllCommand.GenerateStripedAOTDlls(target);
|
||||
|
||||
// 桥接函数生成依赖于AOT dll,必须保证已经build过,生成AOT dll
|
||||
MethodBridgeGeneratorCommand.GenerateMethodBridge(target);
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace HybridCLR.Editor.Commands
|
|||
[MenuItem("HybridCLR/Generate/AOTDlls", priority = 105)]
|
||||
public static void GenerateStripedAOTDlls()
|
||||
{
|
||||
GenerateStripedAOTDlls(EditorUserBuildSettings.activeBuildTarget, EditorUserBuildSettings.selectedBuildTargetGroup);
|
||||
GenerateStripedAOTDlls(EditorUserBuildSettings.activeBuildTarget);
|
||||
}
|
||||
|
||||
private static string GetLocationPathName(string buildDir, BuildTarget target)
|
||||
|
@ -32,7 +32,7 @@ namespace HybridCLR.Editor.Commands
|
|||
}
|
||||
}
|
||||
|
||||
public static void GenerateStripedAOTDlls(BuildTarget target, BuildTargetGroup group)
|
||||
public static void GenerateStripedAOTDlls(BuildTarget target)
|
||||
{
|
||||
string outputPath = $"{SettingsUtil.HybridCLRDataDir}/StrippedAOTDllsTempProj/{target}";
|
||||
BashUtil.RemoveDir(outputPath);
|
||||
|
@ -81,7 +81,7 @@ namespace HybridCLR.Editor.Commands
|
|||
locationPathName = GetLocationPathName(outputPath, target),
|
||||
options = buildOptions,
|
||||
target = target,
|
||||
targetGroup = group,
|
||||
targetGroup = BuildPipeline.GetBuildTargetGroup(target),
|
||||
};
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(buildPlayerOptions);
|
||||
|
@ -115,7 +115,7 @@ namespace HybridCLR.Editor.Commands
|
|||
{
|
||||
throw new Exception("GenerateStripedAOTDlls failed");
|
||||
}
|
||||
Debug.Log($"GenerateStripedAOTDlls target:{target} group:{group} path:{outputPath}");
|
||||
Debug.Log($"GenerateStripedAOTDlls target:{target} path:{outputPath}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue