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

Can not disable ScoverageSbtPlugin in a multi-project build #96

Closed
jeffreyolchovy opened this issue Feb 26, 2015 · 11 comments
Closed

Can not disable ScoverageSbtPlugin in a multi-project build #96

jeffreyolchovy opened this issue Feb 26, 2015 · 11 comments
Labels

Comments

@jeffreyolchovy
Copy link

Given a trivial multi-project definition such as:

import sbt._
import Keys._
import scoverage.ScoverageSbtPlugin

object MyProject extends Build {

  lazy val root = (project in file(".")).aggregate(common, reports, labs)

  lazy val common = (project in file("common"))

  lazy val reports = (project in file("reports")).dependsOn(common)

  lazy val labs = (project in file("labs")).dependsOn(reports).disablePlugins(ScoverageSbtPlugin)
}

The following error will be thrown at sbt startup:

sbt.AutoPluginException: Error determining plugins for project 'labs' in /projects/foo-scoverage/labs:
Contradiction in selected plugins.  These plugins were both included and excluded: scoverage.ScoverageSbtPlugin
    at sbt.AutoPluginException.withPrefix(Plugins.scala:108)
    at sbt.Load$.sbt$Load$$translateAutoPluginException(Load.scala:490)
    at sbt.Load$$anonfun$loadForProjects$1$1.apply(Load.scala:467)
    at sbt.Load$$anonfun$loadForProjects$1$1.apply(Load.scala:465)
    ...
    at xsbt.boot.Boot$.runImpl(Boot.scala:44)
    at xsbt.boot.Boot$.main(Boot.scala:20)
    at xsbt.boot.Boot.main(Boot.scala)
[error] sbt.AutoPluginException: Error determining plugins for project 'labs' in /projects/foo-scoverage/labs:
[error] Contradiction in selected plugins.  These plugins were both included and excluded: scoverage.ScoverageSbtPlugin

I consider this an issue since this is the advertised way of disabling an AutoPlugin, according to sbt documentation (http://www.scala-sbt.org/0.13/docs/Plugins.html#Using+an+auto+plugin). Though, in general, I'd like to know if it's currently possible to disable Scoverage for particular projects in a multi-project build by any other means.

@fommil
Copy link

fommil commented Mar 15, 2015

I'd also like to disable instrumentation/reports for submodules. As a workaround, I do this

[some submodule].settings(
    ScoverageKeys.coverageExcludedPackages := ".*"
  )

@yardena
Copy link

yardena commented Apr 30, 2015

+1

@sksamuel sksamuel added the bug label Jun 4, 2015
@myyk
Copy link

myyk commented Jun 18, 2015

I'm having a similar problem with another AutoPlugin that is has no requirements when I have subprojects. It seems to be an issue with sbt possibly related to this: sbt/sbt#1926

@jeffreyolchovy
Copy link
Author

@myyk yep, sounds like it. thanks for the notice.

@jeffmay
Copy link

jeffmay commented Nov 16, 2015

+1

1 similar comment
@alexandru
Copy link

👍

@edmondop
Copy link

Is this fixed? I get the unfamous symmetric/asymmetric tree problem on 2.11.8 and I am not able to disable the plugin on a submodule where I don't really need it. As a consequence I had to disable coverage completely

@alexandru
Copy link

@edmondo1984 personally I worked around it by using an SBT "profile", only enabling it when -Dsbt.profile=coverage is passed as a command-line option to SBT.

If you're interested in details, see https://github.com/monix/monix/blob/master/build.sbt

@edmondop
Copy link

edmondop commented Dec 17, 2016 via email

@gslowikowski
Copy link
Member

Add coverageEnabled := false to module settings.

@ckipp01
Copy link
Member

ckipp01 commented May 7, 2021

So testing this again (5 years later) it does seem that disablePlugins(ScoverageSbtPlugin) does work as expected. Unsure if it was fixed upstream or not. Pair that with the possibility of using coverageEnabled := false, I'm going to go ahead and close.

@ckipp01 ckipp01 closed this as completed May 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants