Changes in -quit command line option in unity 2022 ?


We upgraded our tools from 2021.3 to 2022.3 rencetly and are facing a change in behaviour.
We developped a tool that allows to transform asmdef files to assemblies (dll). Our continuous integration calls our tool in -batchmode with the "-quit" option and requires asset reimport and recompilation.
Since 2022.3 Unity exits as soon as the main method finishes and does not wait for the compilation of assembly files to be done.

I'm looking for a way to solve this, meaning, being able to execute a method and wait for the assemblies to be recompiled and other steps performed (script execution order, update of guid in asset files, ...) before exiting.

P.S. Compilation is forced by adding a dummy define symbole (SetScriptingDefineSymbolsForGroup) because
CompilationPipeline.RequestScriptCompilation(RequestScriptCompilationOptions.CleanBuildCache); does not recompile assembly from asmdef files

I am not familiar with the issue you describe, but i was just wondering about the tool - why do you need to convert an .asmdef to an assembly (dll) ? and how does it work ? out of curiosity.

We want to provide tools in form of an npm package but without disclosing all the source files.
what the mentioned tool does is that it takes the assembly files unity creates in the library and replaces the asmdef and source files in the project with this assembly. It also recovers the execution order and Guids to keep/update the files/prefabs accordingly. this requires multiple compilation steps.
I found a solution by registering to AssemblyReloadEvents.afterAssemblyReload but my code gets executed multiple times (sometimes too soon). It now works as before but that was difficult to adapt