jeudi 12 août 2021

Is it possible to access type information in a custom MSBuild taks?

Background for question: I Have recently been building a Roslyn source generator, which added additional source code to a compilation based on the types and type members in the project. I have found that the continual execution of source generator and associated code analysis consume too many resources. I am, therefore, looking to build a custom MSBuild task to handle the code analysis and source generation. This is an option because the generated source code will only be used after compilation.

The actual question: Is it possible to access the source trees and semantic information in a custom MSBuild task? Like it is a Roslyn source generator. Would this require a second compilation of the source code inside the custom MSBuild task? Or does the C# compiler expose such information to the tasks somehow?





Aucun commentaire:

Enregistrer un commentaire