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

don't add to libraryDependencies unless enabled #153

Closed
fommil opened this issue Jan 3, 2016 · 18 comments
Closed

don't add to libraryDependencies unless enabled #153

fommil opened this issue Jan 3, 2016 · 18 comments

Comments

@fommil
Copy link

fommil commented Jan 3, 2016

I've noticed that the scoverage plugin and runtime support is added to libraryDependencies even if coverage is not enabled. Would it be hard to not do it this way? And only add the jars when coverage is enabled?

Currently, scoverage gets added as a provided dependency on Maven Central to all projects that might use it (plus it shows up as a real dependency in IDEs)

@sksamuel
Copy link
Member

sksamuel commented Jan 3, 2016

It should actually never be added in a package. And only added when you
invoke it.

On 3 January 2016 at 11:29, Sam Halliday notifications@github.com wrote:

I've noticed that the scoverage plugin and runtime support is added to
libraryDependencies even if coverage is not enabled. Would it be hard to
not do it this way? And only add the jars when coverage is enabled?

Currently, scoverage gets added as a provided dependency on Maven Central
to all projects that might use it (plus it shows up as a real dependency in
IDEs)


Reply to this email directly or view it on GitHub
#153.

@fommil
Copy link
Author

fommil commented Jan 3, 2016

@heartsucker
Copy link

Hey, adding to the discussion. On sbt 0.13.8 with scoverage 1.3.3, we get this added the generated pom for projects with scoverage disabled and not running the coverage command.

<dependency>
    <groupId>org.scoverage</groupId>
    <artifactId>scalac-scoverage-runtime_2.11</artifactId>
    <version>1.1.1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.scoverage</groupId>
    <artifactId>scalac-scoverage-plugin_2.11</artifactId>
    <version>1.1.1</version>
    <scope>provided</scope>
</dependency>

I'm pretty sure there shouldn't be any scoverage jars added to the project.

@fommil
Copy link
Author

fommil commented Jan 4, 2016

yes, this is exactly the same thing.

@rklaehn
Copy link

rklaehn commented Jan 14, 2016

I also noticed this when looking at the pom for cats-kernel here https://github.com/non/cats/pull/806#issuecomment-171791057

@fommil
Copy link
Author

fommil commented Jan 21, 2016

that was sneaky! I didn't even see you fix this 😄

Will there be a release soon?

@fommil fommil closed this as completed Jan 21, 2016
@sksamuel
Copy link
Member

Lol. Do you want to confirm it before I do?

On 21 January 2016 at 20:49, Sam Halliday notifications@github.com wrote:

that was sneaky! I didn't even see you fix this [image: 😄]

Will there be a release soon?


Reply to this email directly or view it on GitHub
#153 (comment)
.

@fommil
Copy link
Author

fommil commented Jan 21, 2016

do you publish snapshots?

@fommil
Copy link
Author

fommil commented Jan 21, 2016

I'll test locally

@fommil
Copy link
Author

fommil commented Jan 21, 2016

ok, I need you to publish a snapshot. classic mismatched pgp config stuff...

java.lang.ClassCastException: Cannot cast com.typesafe.sbt.SbtPgp$ to sbt.Plugin
    at java.lang.Class.cast(Class.java:3369)

I personally put all my gpg setup in my global settings to avoid this nonsense.

@sksamuel
Copy link
Member

What's the advantage of that one vs the one I use ?

On 21 January 2016 at 21:12, Sam Halliday notifications@github.com wrote:

https://github.com/fommil/dotfiles/blob/master/.sbt/0.13/plugins/plugins.sbt#L5

https://github.com/fommil/dotfiles/blob/master/.sbt/0.13/global.sbt#L8


Reply to this email directly or view it on GitHub
#153 (comment)
.

@fommil
Copy link
Author

fommil commented Jan 22, 2016

I think this is the latest version and yours is the deprecated one.

@sksamuel
Copy link
Member

Ahh so the com.typesafe one is deprecated and com.josh one is the latest.
Makes sense, instead of bumping the com.typesafe version :)

On 22 January 2016 at 07:28, Sam Halliday notifications@github.com wrote:

I think this is the latest version and yours is the deprecated one.


Reply to this email directly or view it on GitHub
#153 (comment)
.

@gslowikowski
Copy link
Member

I've just tried to test it, but it doesn't work. Simple sbt clean test command doesn't work. Fix it, please.

@gslowikowski gslowikowski reopened this Feb 12, 2016
@sksamuel
Copy link
Member

It's green on travis. It's green on my machine. What makes you think it doesn't work.

sam@sam-xubuntu:~/development/workspace/scoverage/sbt-scoverage$ sbt clean test
[info] Loading project definition from /home/sam/development/workspace/scoverage/sbt-scoverage/project
[info] Updating {file:/home/sam/development/workspace/scoverage/sbt-scoverage/project/}sbt-scoverage-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Set current project to sbt-scoverage (in build file:/home/sam/development/workspace/scoverage/sbt-scoverage/)
[success] Total time: 0 s, completed 12-Feb-2016 08:45:15
[info] Updating {file:/home/sam/development/workspace/scoverage/sbt-scoverage/}sbt-scoverage...
[info] Resolving org.scala-sbt#sbt-launch;0.13.9 ...
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-sbt/0.13.9/jars/scripted-sbt.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-sbt;0.13.9!scripted-sbt.jar (2626ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/scripted-framework/0.13.9/jars/scripted-framework.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#scripted-framework;0.13.9!scripted-framework.jar (2571ms)
[info] downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.9/jars/sbt-launch.jar ...
[info] [SUCCESSFUL ] org.scala-sbt#sbt-launch;0.13.9!sbt-launch.jar (4861ms)
[info] Done updating.
[info] Compiling 2 Scala sources to /home/sam/development/workspace/scoverage/sbt-scoverage/target/scala-2.10/sbt-0.13/classes...
[success] Total time: 22 s, completed 12-Feb-2016 08:45:37

@gslowikowski
Copy link
Member

  1. There are no tests executed during the plugin testing. Why?
  2. Run sbt clean test on any simple SBT project using Scoverage. It throws:
java.lang.Exception: Fatal: scalac-scoverage-plugin not in libraryDependencies
    at scoverage.ScoverageSbtPlugin$$anonfun$scoverageScalacOptions$1.apply(ScoverageSbtPlugin.scala:123)
    at scoverage.ScoverageSbtPlugin$$anonfun$scoverageScalacOptions$1.apply(ScoverageSbtPlugin.scala:120)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
    at sbt.std.Transform$$anon$4.work(System.scala:63)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
    at sbt.Execute.work(Execute.scala:235)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
[error] (compile:compile::scalacOptions) java.lang.Exception: Fatal: scalac-scoverage-plugin not in libraryDependencies

@lustefaniak
Copy link
Contributor

I think current libraryDependencies support is broken, as it ignores coverageEnabled := true in build file, I fixed those issues here: #166

alexandru added a commit to monix/monix that referenced this issue Apr 7, 2016
rozza added a commit to rozza/mongo-spark that referenced this issue May 18, 2016
Removed scoverage plugin from the published pom (ref: scoverage/sbt-scoverage#153)
Updated scm section
@fommil fommil closed this as completed Aug 27, 2018
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

6 participants