fix: added new read/write symbol params (#806)

fix: added new read/write symbol params
This commit is contained in:
c6burns 2019-04-12 15:00:46 -06:00 committed by Paul Pacheco
parent 3f9045dbe8
commit 3a50ca6352

View File

@ -544,7 +544,7 @@ static bool CheckSyncList(TypeDefinition td)
static bool Weave(string assName, IEnumerable<string> dependencies, IAssemblyResolver assemblyResolver, string unityEngineDLLPath, string mirrorNetDLLPath, string outputDir)
{
using (DefaultAssemblyResolver asmResolver = new DefaultAssemblyResolver())
using (CurrentAssembly = AssemblyDefinition.ReadAssembly(assName, new ReaderParameters { ReadWrite = true, AssemblyResolver = asmResolver }))
using (CurrentAssembly = AssemblyDefinition.ReadAssembly(assName, new ReaderParameters { ReadWrite = true, ReadSymbols = true, AssemblyResolver = asmResolver }))
{
asmResolver.AddSearchDirectory(Path.GetDirectoryName(assName));
asmResolver.AddSearchDirectory(Helpers.UnityEngineDLLDirectoryName());
@ -624,13 +624,14 @@ static bool Weave(string assName, IEnumerable<string> dependencies, IAssemblyRes
}
// write to outputDir if specified, otherwise perform in-place write
WriterParameters writeParams = new WriterParameters { WriteSymbols = true };
if (outputDir != null)
{
CurrentAssembly.Write(Helpers.DestinationFileFor(outputDir, assName));
CurrentAssembly.Write(Helpers.DestinationFileFor(outputDir, assName), writeParams);
}
else
{
CurrentAssembly.Write();
CurrentAssembly.Write(writeParams);
}
}
}