Skip to content

Use custom source sets and compile-only dependencies instead of reflection #524

Closed
@nedtwigg

Description

@nedtwigg

Spotless supports many formatters, and they have many transitive dependencies. We write most integration code using reflection, so that we don't have to reconcile the conflicting transitive dependencies of every formatter we support.

An easier-to-use, but harder-to-setup method is to create a custom source set with compileOnly dependencies. e.g src/main/java-scalafmt. We're happy to accept piecemeal PR's which do this for any formatter that a contributor is interested in - no need to convert everything.

When contributing a PR of this sort, there is no need to worry about older versions of the formatter - we can always use the old reflection code to maintain support for these old versions if necessary.

Completed examples:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions