Skip to content

Support configurable Spi Implementations #3071

@ro0sterjam

Description

@ro0sterjam

Use case

Spi Implementations have a better opportunity for reusability if they are configurable. Currently MapStruct's MappingProcessor does not pass the compilerArgs down to the MapStructProcessingEnvironment which is received on the init methods of the Spi classes (such as AccessorNamingStrategy).

Example of such use case: entur/mapstruct-spi-protobuf#133 (this approach ultimately failed because a workaround was needed to retrieve the options that MapStruct does not pass through).

Generated Code

To resolve this we can just pass the options down to MapStructProcessingEnvironment. To be safe, we can limit this to only options under the namespace of mapstruct.ap.spi.

Possible workarounds

There are no viable work arounds. An attempt was made to have the options loaded from a parallel processor but there is no guarantee of processor initialization order.

MapStruct Version

MapStruct 1.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions