Skip to content

Commit fc61929

Browse files
committed
Refine built-in exclusions
1 parent 7109ead commit fc61929

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

Editor/Aspect/Aspect.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,35 @@ public static void Process(){
2222
}
2323

2424
static void ProcessFile(string path){
25+
if(path .Contains("VRM"))
26+
{ print($"Skip VRM assembly"); return; }
27+
if(path .Contains("Runtime.dll"))
28+
{ print($"Skip: {path}"); return; }
29+
if(path .Contains("UnityEditor.UI"))
30+
{ print($"Skip: {path}"); return; }
31+
if(path.Contains("UnityEngine.UI"))
32+
{ print($"Skip: {path}"); return; }
33+
if(path.Contains("Assembly-CSharp"))
34+
{ print($"Skip C#: {path}"); return; }
2535
if(path.EndsWith(self))
2636
{ print($"Skip self: {self}"); return; }
2737
if(path.ToLower().Contains("test"))
2838
{ print($"Skip likely unit tests: {path}"); return; }
2939
if(path.ToLower().Contains("unity."))
3040
{ print($"Skip likely Engine module: {path}"); return; }
41+
if(path.ToLower().Contains("unityeditor."))
42+
{ print($"Skip likely Editor module: {path}"); return; }
3143
if(path.EndsWith("Assembly-CSharp-Editor.dll"))
3244
{ print($"Skip editor scripts: {path}"); return; }
33-
var module = ModuleDefinition.ReadModule
34-
(path, new ReaderParameters { InMemory = true });
45+
ModuleDefinition module;
46+
try{
47+
module = ModuleDefinition.ReadModule
48+
(path,
49+
new ReaderParameters { InMemory = true });
50+
}catch(System.BadImageFormatException ex){
51+
Debug.LogWarning($"Bad image: {path}\n{ex}");
52+
return;
53+
}
3554
int tc = module.Types.Count;
3655
int ptc = 0;
3756
foreach (var type in module.Types){

0 commit comments

Comments
 (0)