Roslyn-Based GenAPI Backend
This epic is a prerequisite for #9672.
Goals and Motivation
One of the steps to close the gap between the existing official build and the .NET source-build is enabling prebuilt detection on the individual product repository level.
Currently, we detect new prebuilt introduction when source-building the whole product. This not only requires a lot of effort from the A&D team, but also takes significant time to remediate as the prebuilt detection is done late in the process. This late detection can seriously impact the product release as has been proven several times in the past.
Our goal is to introduce prebuilt detection on an individual product repo level so that developers could detect prebuilts during their PR validation and resolve the problem by generating the SBRPs themselves with minimum assistance from the A&D team. Unfortunately, the current SBRP generation tooling, GenAPI, is not sufficient for this scenario as it uses the old Microsoft Common Compiler Infrastructure (Microsoft CCI) to generate the API surface for individual packages. The Microsoft CCI backend needs to be periodically updated to reflect the latest language changes which is often a time-consuming task requiring significant expertise.
The goal of this epic is to introduce a new backend for the GenAPI tool that would be based on Roslyn, rather than on Microsoft CCI.
Milestones
- [ ] Introduce a shared library that incapsulates logic of loading and traversion of assembly symbols
- [ ] Implement filtering and sorting of assembly symbols features (like
allow public only,filter out the list of attributes) 1w - [ ] Implement UTs and cover traversion, C# code generation, filtering, etc. 2w
- [ ] Implement filtering and sorting of assembly symbols features (like
- [ ] Introduce Cli tool/frontend 2d
- [ ] Introduce MSBuild task and implement options listed in https://github.com/dotnet/arcade/issues/10411 1w
- [ ] Update referencePackageSourceGenerator tool to use new GenAPI backend. 2d
- [ ] Test Roslyn-based GenAPI 4w
- [ ] Re-generate existed reference packages and compare generated code with existed one; fix bugs, implement additional features ...