[fix] 修复 externalHotUpdateAssembliyDirs 无法正确工作的bug

This commit is contained in:
walon
2022-12-13 11:40:18 +08:00
parent 8afdcb985d
commit c8acfef61d
7 changed files with 40 additions and 34 deletions
+3 -20
View File
@@ -26,29 +26,12 @@ namespace HybridCLR.Editor.Commands
var ls = SettingsUtil.HybridCLRSettings;
var allAssByNames = new Dictionary<string, Assembly>();
foreach (var ass in AppDomain.CurrentDomain.GetAssemblies())
{
allAssByNames[ass.GetName().Name] = ass;
}
var hotfixAssembles = new List<Assembly>();
foreach(var assName in SettingsUtil.HotUpdateAssemblyNames)
{
if (allAssByNames.TryGetValue(assName, out var ass))
{
hotfixAssembles.Add(ass);
}
else
{
throw new Exception($"assembly:{assName} 不存在");
}
}
List<string> hotfixAssemblies = SettingsUtil.HotUpdateAssemblyNames;
var analyzer = new Analyzer(Meta.MetaUtil.CreateBuildTargetAssemblyResolver(EditorUserBuildSettings.activeBuildTarget), HybridCLRSettings.Instance.collectAssetReferenceTypes);
var refTypes = analyzer.CollectRefs(hotfixAssembles);
var refTypes = analyzer.CollectRefs(hotfixAssemblies);
Debug.Log($"[LinkGeneratorCommand] hotfix assembly count:{hotfixAssembles.Count}, ref type count:{refTypes.Count} output:{Application.dataPath}/{ls.outputLinkFile}");
Debug.Log($"[LinkGeneratorCommand] hotfix assembly count:{hotfixAssemblies.Count}, ref type count:{refTypes.Count} output:{Application.dataPath}/{ls.outputLinkFile}");
var linkXmlWriter = new LinkXmlWriter();
linkXmlWriter.Write($"{Application.dataPath}/{ls.outputLinkFile}", refTypes);
AssetDatabase.Refresh();