Skip to content

Improved Plugin API #1834

@mpkorstanje

Description

@mpkorstanje

Issues with the plugin system

  1. Concrete plugin implementations should not be in core. Plugins tend to use third party dependencies. We have to shade these in or suffer the dependency. Doing this in core make the core heavier then it needs to be.
  2. We can't list all available plugins (for CLI options).
  3. Third party plugins must be referenced by FQN while our own plugins have short names.
  4. Input validation should happen when parsing. Currently happens at plugin instantiation.
  5. URLOutputStream is an abomination.
  6. No support for Path and FileSystem APIs.
  7. The use of standard out is implicit in the constructor arguments of the plugin.
  8. Appendable can't be closed but we trick around that in NiceAppendable.
  9. OutputStream argument must always be closed. Plugins however can't tell if Cucumber crashed and thus can't clean it up. This should be done by Cucumber (it created the stream so it owns it).

Solution

  1. Register and create plugins with SPI.
  2. Provide interfaces to create an instance of a plugin from specific arguments
  3. Remove Appendable as valid argument.

Something in that direction anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🧷 pinnedTells Stalebot not to close this issue⚡ enhancementRequest for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions