Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,31 @@

using Assembly = System.Reflection.Assembly;

using ILPPInterface = Unity.CompilationPipeline.Common.ILPostProcessing.ILPostProcessor;

namespace MLAPI.Editor.CodeGen
{
// There is a behaviour difference between 2019.4 and 2020+ codegen
Comment thread
mattwalsh-unity marked this conversation as resolved.
// that essentially does checking on the existence of ILPP vs if a CodeGen assembly
// is present. So in order to make sure ILPP runs properly in 2019.4 from a clean
// import of the project we add this dummy ILPP which forces the callback to made
// and meets the internal ScriptCompilation pipeline requirements
internal sealed class ILPP2019CodegenWorkaround : ILPPInterface
{
public override ILPPInterface GetInstance()
{
return this;
}

public override ILPostProcessResult Process(ICompiledAssembly compiledAssembly)
{
return null;
}

public override bool WillProcess(ICompiledAssembly compiledAssembly) => compiledAssembly.References.Any(filePath => Path.GetFileNameWithoutExtension(filePath) == CodeGenHelpers.RuntimeAssemblyName);

}

internal static class ILPostProcessProgram
{
private static ILPostProcessor[] s_ILPostProcessors { get; set; }
Expand Down Expand Up @@ -213,4 +236,4 @@ void WriteAssembly(InMemoryAssembly inMemoryAssembly, string outputPath, string
}
}
}
#endif
#endif
4 changes: 0 additions & 4 deletions com.unity.multiplayer.mlapi/Tests/Runtime/RpcQueueTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class RpcQueueTests
[UnityTest]
public IEnumerator RpcQueueUnitTest()
{
#if UNITY_2020_2_OR_NEWER // Disabling this test on 2019.4 due to ILPP issues on Yamato CI/CD runs
var networkManagerObject = new GameObject(nameof(NetworkManager));
m_NetworkManager = networkManagerObject.AddComponent<NetworkManager>();
var unetTransport = networkManagerObject.AddComponent<UNetTransport>();
Expand Down Expand Up @@ -102,9 +101,6 @@ public IEnumerator RpcQueueUnitTest()

GameObject.DestroyImmediate(playerObject);
GameObject.DestroyImmediate(networkManagerObject);
#else
yield return null;
#endif
}
}
}