comments; run ILPP in all cases not just on mac

This commit is contained in:
vis2k 2021-08-28 21:29:20 +08:00
parent 47b66430c2
commit 50cadb7060

View File

@ -115,28 +115,23 @@ public static void Build(Action<string> OnWarning, Action<string> OnError)
}
}
#if UNITY_2020_1_OR_NEWER && UNITY_EDITOR_OSX
// CompilationFinishedHook weaves test pre Unity 2020.
// after Unity 2020, ILPostProcessor is invoked by AssemblyBuilder.
// on mac, it is not invoked automatically.
// need to do it manually until it's fixed by Unity.
#if UNITY_2020_1_OR_NEWER
// on 2018/2019, CompilationFinishedHook weaved after building.
// on 2020, ILPostProcessor weaves after building.
// on windows, it runs after AssemblyBuilder.Build()
// on mac, it does not run after AssemblyBuidler.Build()
// => run it manually in all cases
// => this way we can feed result.Logs to test results too
// TODO invoke ILPostProcessor manually
// TODO save to file manually, so tests using the DLLs use the waved ones.
//
// References needs to be set to something.
// otherwise we get NullReferenceException in WillProcess while
// checking References.
// -> copy the AssemblyBuilder's references
// copy references from assemblyBuilder's references
List<string> references = new List<string>();
if (assemblyBuilder.defaultReferences != null)
references.AddRange(assemblyBuilder.defaultReferences);
if (assemblyBuilder.additionalReferences != null)
references.AddRange(assemblyBuilder.additionalReferences);
// we COULD Weave() with a test logger manually.
// invoke ILPostProcessor with an assembly from file.
// we could Weave() with a test logger manually.
// but for test result consistency on all platforms,
// let's invoke the ILPostProcessor here too.
// NOTE: CompilationPipeline can only be imported if this