Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Assets/Scripts/Editor/Compilation/DotnetExeCompilator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,16 +218,22 @@ private static string GenerateCompilerArgsRspFileContents(string outLibraryPath,
rspContents.AppendLine($"-define:{symbol}");
}

Dictionary<string, bool> nameLoaded = new Dictionary<string, bool>();
foreach (var referenceToAdd in ResolveReferencesToAdd(new List<string>()))
{
if (originalAssemblyPathToAsmWithInternalsVisibleToCompiled.TryGetValue(referenceToAdd, out var asmWithInternalsVisibleTo))
string key = Path.GetFileName(referenceToAdd);
if (!nameLoaded.ContainsKey(key)) // Avoid duplicates of the same assembly
{
//Changed assembly have InternalsVisibleTo added to it to avoid any issues where types are defined internal
rspContents.AppendLine($"-r:\"{asmWithInternalsVisibleTo}\"");
}
else
{
rspContents.AppendLine($"-r:\"{referenceToAdd}\"");
if (originalAssemblyPathToAsmWithInternalsVisibleToCompiled.TryGetValue(referenceToAdd, out var asmWithInternalsVisibleTo))
{
//Changed assembly have InternalsVisibleTo added to it to avoid any issues where types are defined internal
rspContents.AppendLine($"-r:\"{asmWithInternalsVisibleTo}\"");
}
else
{
rspContents.AppendLine($"-r:\"{referenceToAdd}\"");
}
nameLoaded.Add(key, true);
}
}

Expand Down Expand Up @@ -344,4 +350,4 @@ public HotReloadCompilationException(string message, Exception innerException, s
SourceCodeCombinedFileCreated = sourceCodeCombinedFileCreated;
}
}
}
}