1.3 KiB
1.3 KiB
Roslyn Endpoint Source Generator (AOT-Compatible)
Module
Router
Status
IMPLEMENTED
Description
Roslyn incremental source generator that detects [StellaEndpoint] attributes at compile time and generates AOT-compatible endpoint registration code, eliminating runtime reflection for endpoint discovery. Supports Native AOT deployment scenarios.
Implementation Details
- Modules:
src/Router/__Libraries/StellaOps.Microservice.SourceGen/ - Key Classes:
StellaEndpointGenerator(src/Router/__Libraries/StellaOps.Microservice.SourceGen/StellaEndpointGenerator.cs) - Roslyn incremental source generator detecting[StellaEndpoint]attributes and generatingStellaEndpointsregistration class
- Interfaces:
IIncrementalGenerator(Roslyn API) - Source: batch_52/file_10.md
E2E Test Plan
- Compile a project with
[StellaEndpoint]attributes and verify the source generator produces registration code - Verify generated code is AOT-compatible: publish with Native AOT and confirm endpoints are discoverable without reflection
- Verify the generated
StellaEndpointsclass registers all annotated endpoints - Add a new
[StellaEndpoint]and verify incremental generation updates the output - Verify compile-time diagnostics: use invalid attribute parameters and confirm helpful error messages