AArnott / CodeGeneration.Roslyn

Assists in performing Roslyn-based code generation during a build.
Microsoft Public License
408 stars 60 forks source link

Caching console output #182

Closed amis92 closed 4 years ago

amis92 commented 4 years ago

Our tool has the ability to output into msbuild log (via standard/error out).

However, since we attempt to support incremental build, if we skip some generation, some output may "disappear" on incremental build.

Is caching the output (warnings/errors) viable? So that when we skip something, we still provide an output as if the generation ran?

AArnott commented 4 years ago

That sounds like a general limitation of msbuild. Most aspects of incremental build in msbuild simply omit messages from the skipped steps. Is there some reason this is an important problem to solve for code generation in particular?

amis92 commented 4 years ago

Not really. It was more like, for my specific RecordGenerator, I wanted to output some diagnostics for when generator skipped some things (e.g. sealed-class-only stuff) to inform user why he doesn't get everything.

But it does seem like just an Analyzer job, and I'll probably, at some point, do it like that :)

amis92 commented 4 years ago

Well I've got my answer, I think this can be closed.