Closed mwpowellhtx closed 5 years ago
Possibly GetLastModifiedAssemblyTime
is working around that concern. However, I am pretty sure the assembly registry would still grow and never be shaken.
Are you asking about incremental build and the inputs/outputs check that it does? If so, you're quite possibly right. It's been so long since I looked at it. I probably didn't consider it a priority to make sure that incremental build over the long haul (with no clean/rebuilds along the way) didn't grow heavy on the regenerate-unnecessarily side.
It probably requires fixing. Although whole incremental build support definitely needs fixing, and quite honestly, while using the generators I've come to a conclusion that the incremental build just doesn't work for me. Often my code generation depends not only on a given source file, but also on the base class's source, leading me to conclusion that it should be at least possible to completely disable incremental-ish computations inside the tool, or even drop them completely since they have so many issues.
The tool is invoked anyway, and the time of doing the Compilation is considerable. It'll probably need profiling, but I'd guess that creating Compilation (loading all Roslyn DLLs etc.) is considerably more expensive than any following code generation.
Sorry, I think I derailed. 😅😇👀
@amis92 No worries. I'm recasting the execution on the implementation anyway, so this is quite informative, something I can keep my eyes open for.
@AArnott Best I can figure, the registry of assemblies used during code generation is only ever glommed on to. That is to say, the list is read, the loaded assemblies are appended, and it is re-saved. See
LoadAssembly
andSaveGeneratorAssemblyList
. As internal and external dependencies adjust, grow, shrink, etc, over the course of a project, does this tree ever get shaken in order to discard stale code generation references?