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

2.0.0.-M0 changes #196

Closed
wants to merge 3 commits into from
Closed

2.0.0.-M0 changes #196

wants to merge 3 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 16, 2016

M0 version, no scala-js but should be OK to build scalac and some compiler plugins

@gslowikowski
Copy link
Member

Read scoverage/scalac-scoverage-plugin-core#1 (comment) and scoverage/scalac-scoverage-plugin#186 (comment) first.

These settings:

  lazy val coverageScalacRuntimeOrg = settingKey[String]("organisation name of scalac-scoverage-runtime to use")
  lazy val coverageScalacRuntimeArtifact = settingKey[String]("artifact name of scalac-scoverage-runtime to use")
  lazy val coverageScalacRuntimeVersion = settingKey[String]("version of scalac-scoverage-runtime to use")

can be replaced by one:

 lazy val coverageScalacRuntimeModule = settingKey[Option[ModuleID]]("alternative scalac-scoverage-runtime dependency, use only if you know what you are doing")

These settings:

  lazy val coverageScalacPluginOrg = settingKey[String]("organisation name of scalac-scoverage-plugin to use")
  lazy val coverageScalacPluginArtifact = settingKey[String]("artifact name of scalac-scoverage-plugin to use")
  lazy val coverageScalacPluginVersion = settingKey[String]("version of scalac-scoverage-plugin to use")

  lazy val coverageLibraryDependencies = settingKey[Seq[ModuleID]]("Use these library dependencies if coverage is enabled")

can be removed completely.

In your Scala 2.12.x with Scoverage settings you have

  coverageScalacRuntimeArtifact := "scalac-scoverage-runtime-java",
  coverageLibraryDependencies := Seq(
    coverageScalacRuntimeOrg.value %% coverageScalacRuntimeArtifact.value  % coverageScalacRuntimeVersion.value exclude("org.scala-lang", "*"),
    coverageScalacPluginOrg.value %% coverageScalacPluginArtifact.value  % coverageScalacPluginVersion.value % ScoverageSbtPlugin.ScoveragePluginConfig.name cross CrossVersion.full exclude("org.scala-lang", "*")
  )

Exclusions are part of ModuleID class so you can define

coverageScalacRuntimeModule := Some("org.scoverage" % "scalac-scoverage-runtime-java" % coverageScalacRuntimeVersion.value exclude("org.scala-lang", "*"))

or better

coverageScalacRuntimeModule := Some("org.scoverage" % "scalac-scoverage-runtime-java" % coverageScalacRuntimeVersion.value exclude("org.scala-lang", "scala-library"))

because wildcards are not translated to Maven syntax (it doesn't matter here).

Adding excludes to plugin dependency does not make sense because scalac plugins dependencies are ignored. Only plugin artifact's absolute path is passed to scalac.

@ckipp01
Copy link
Member

ckipp01 commented Apr 28, 2021

This is quite dated. In an effort to do some cleanup I'm going to go ahead and close.

@ckipp01 ckipp01 closed this Apr 28, 2021
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

Successfully merging this pull request may close these issues.

3 participants