@@ -1,10 +1,8 @@
|
||||
using HybridCLR.Editor.Settings;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
@@ -18,8 +16,6 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
{
|
||||
public int callbackOrder => 0;
|
||||
|
||||
public static bool DisableMethodBridgeDevelopmentFlagChecking { get; set; }
|
||||
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
{
|
||||
HybridCLRSettings globalSettings = SettingsUtil.HybridCLRSettings;
|
||||
@@ -71,24 +67,6 @@ namespace HybridCLR.Editor.BuildProcessors
|
||||
Debug.LogWarning("[CheckSettings] No hot update modules configured in HybridCLRSettings");
|
||||
}
|
||||
|
||||
if (!DisableMethodBridgeDevelopmentFlagChecking)
|
||||
{
|
||||
string methodBridgeFile = $"{SettingsUtil.GeneratedCppDir}/MethodBridge.cpp";
|
||||
var match = Regex.Match(File.ReadAllText(methodBridgeFile), @"// DEVELOPMENT=(\d)");
|
||||
if (match.Success)
|
||||
{
|
||||
int developmentFlagInMethodBridge = int.Parse(match.Groups[1].Value);
|
||||
int developmentFlagInEditorSettings = EditorUserBuildSettings.development ? 1 : 0;
|
||||
if (developmentFlagInMethodBridge != developmentFlagInEditorSettings)
|
||||
{
|
||||
Debug.LogError($"[CheckSettings] MethodBridge.cpp DEVELOPMENT flag:{developmentFlagInMethodBridge} is inconsistent with EditorUserBuildSettings.development:{developmentFlagInEditorSettings}. Please run 'HybridCLR/Generate/All' before building.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[CheckSettings] MethodBridge.cpp DEVELOPMENT flag not found. Please run 'HybridCLR/Generate/All' before building.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user