Skip to content

Commit

Permalink
fix: running weaver for editor scripts (#557)
Browse files Browse the repository at this point in the history
Basically reverts PR #537
It did not solve the problem we intended to solve,
and it broke some code for someone.

fixes #552
  • Loading branch information
paulpach committed Jan 29, 2021
1 parent 56c3547 commit 12a1d73
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions Assets/Mirror/Weaver/MirrorILPostProcessor.cs
Expand Up @@ -9,7 +9,6 @@ namespace Mirror.Weaver
public class MirrorILPostProcessor : ILPostProcessor
{
public const string RuntimeAssemblyName = "Mirror";
public const string EditorAssemblyName = "Mirror.Editor";

public override ILPostProcessor GetInstance() => this;

Expand Down Expand Up @@ -39,16 +38,8 @@ public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly)
return new ILPostProcessResult(new InMemoryAssembly(pe.ToArray(), pdb.ToArray()), logger.Diagnostics);
}

public override bool WillProcess(ICompiledAssembly compiledAssembly)
{
bool usesMirror =
public override bool WillProcess(ICompiledAssembly compiledAssembly) =>
compiledAssembly.Name == RuntimeAssemblyName ||
compiledAssembly.References.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == RuntimeAssemblyName);

bool usesMirrorEditor =
compiledAssembly.References.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == EditorAssemblyName);

return usesMirror && !usesMirrorEditor;
}
}
}

0 comments on commit 12a1d73

Please sign in to comment.