Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler plugin Silencer-lib is flagged as undeclared #50

Open
disordered opened this issue Feb 26, 2020 · 1 comment
Open

Compiler plugin Silencer-lib is flagged as undeclared #50

disordered opened this issue Feb 26, 2020 · 1 comment

Comments

@disordered
Copy link

Compiler plugin https://github.com/ghik/silencer instructs to declare dependencies the following way:

libraryDependencies ++= Seq(
  compilerPlugin("com.github.ghik" % "silencer-plugin" % silencerVersion cross CrossVersion.full),
  "com.github.ghik" % "silencer-lib" % silencerVersion % Provided cross CrossVersion.full
)

Unfortunately, explicit dependencies then flags this as undeclared compile dependency.
We are using the filter to suppress the warning, but it would be nice if this would be handled somehow automatically.

rossabaker added a commit to rossabaker/http4s that referenced this issue Mar 22, 2020
@agile-jordi
Copy link

I came up with this workaround that may help diagnose the issue:

    unusedCompileDependenciesFilter := moduleFilter() - moduleFilter(
      "com.github.ghik",
      "silencer-lib"
    ),
    undeclaredCompileDependenciesFilter := moduleFilter() - moduleFilter(
      "com.github.ghik",
      "silencer-lib" + "_" + scalaVersion.value
    ),

It seems that when you don't actually use silencer (but you included it in the classpath as provided, acording to silencer-lib README) sbt-explicit-dependencies complains about "com.github.ghik" % "silencer-lib" % "XXX" not being used. But when you actually use it, sbt-explicit-dependencies complains about "com.github.ghik" % "silencer-lib_2_12" % "XXX" not being declared but used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants