scalacenter / sbt-missinglink

An sbt plugin for missinglink
Apache License 2.0
133 stars 14 forks source link

Ignore conflicts in certain packages #23

Closed iRevive closed 4 years ago

iRevive commented 4 years ago

This PR partially covers https://github.com/scalacenter/sbt-missinglink/issues/12.

Conflicts can be ignored based on the package name of the class that has the conflict. Basically, this is just a backport from the maven plugin.

SBT:

missinglinkIgnoreDestinationPackages += IgnoredPackage("com.google.common", ignoreSubpackages = false)
missinglinkIgnoreSourcePackages += IgnoredPackage("com.example")

Maven:

<configuration>
  <!-- ignore conflicts with groovy.lang on the caller side -->
  <ignoreSourcePackages>
    <ignoreSourcePackages>
      <package>com.example</package>
    </ignoreSourcePackages>
    <ignoreSubpackages>false</ignoreSubpackages>
  </ignoreSourcePackages>
  <!-- ignore conflicts with com.foo on the callee side -->
  <ignoreDestinationPackages>
    <ignoreDestinationPackage>
      <package>com.google.common</package>
    </ignoreDestinationPackage>
  </ignoreDestinationPackages>
</configuration>

Also, this PR brings a new setting missinglinkFailOnConflicts:

SBT:

missinglinkFailOnConflicts := false

Maven:

<configuration>
  <failOnConflicts>true</failOnConflicts>
</configuration>
iRevive commented 4 years ago

Hi @sjrd. Once you have time, can you have a look, please?

iRevive commented 4 years ago

Hey! Thanks for the review. I will update the PR soon.