micronaut-projects / micronaut-aot

Experimental Ahead-of-time optimizations for Micronaut
Apache License 2.0
17 stars 5 forks source link

Provide a way to document optimizations #96

Open melix opened 2 years ago

melix commented 2 years ago

Feature description

Minimally, each optimization should be documented. Currently we have the @AOTModule which provides optimization metadata:

@AOTModule(
        id = NativeStaticServiceLoaderSourceGenerator.ID,
        description = AbstractStaticServiceLoaderSourceGenerator.DESCRIPTION,
        options = {
                @Option(
                        key = "service.types",
                        description = "The list of service types to be scanned (comma separated)",
                        sampleValue = AbstractStaticServiceLoaderSourceGenerator.DEFAULT_SERVICE_TYPES
                ),
                @Option(
                        key = "serviceloading.rejected.impls",
                        description = "A list of implementation types which shouldn't be included in the final application (comma separated)",
                        sampleValue = "com.Misc,org.Bar"
                ),
                @Option(
                        key = "serviceloading.force.include.impls",
                        description = "A list of implementation types to include even if they don't match bean requirements (comma separated)",
                        sampleValue = "com.Misc,org.Bar"
                ),
                @Option(
                        key = Environments.POSSIBLE_ENVIRONMENTS_NAMES,
                        description = Environments.POSSIBLE_ENVIRONMENTS_DESCRIPTION,
                        sampleValue = Environments.POSSIBLE_ENVIRONMENTS_SAMPLE
                )
        },
        enabledOn = Runtime.NATIVE,
        subgenerators = {YamlPropertySourceGenerator.class}
)

This provides samples which are used by the sample generation task. But ideally, we should also provide some documentation which could be used by a documentation generator, similarly to what is done with configuration properties in Micronaut Core.

alvarosanchez commented 2 years ago

Can they be documented manually first until we get there?

melix commented 2 years ago

Yes, that was the intent of my first sentence :)