Skip to content

add sbt 1.0.0-RC3 support, fixes #216 #229

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

Merged
merged 6 commits into from
Aug 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: scala

script: sbt ++$TRAVIS_SCALA_VERSION scripted
script: sbt ^scripted

scala:
- "2.10.6"
Expand Down
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,5 @@ pomExtra := {
</developer>
</developers>
}

crossSbtVersions := Vector("0.13.16", "1.0.0-RC3")
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.13
sbt.version=0.13.16
7 changes: 4 additions & 3 deletions src/main/scala/scoverage/ScoverageSbtPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ object ScoverageSbtPlugin extends AutoPlugin {

private lazy val scalacSettings = Seq(
scalacOptions in(Compile, compile) ++= {
val updateReport = update.value
if (coverageEnabled.value) {
val scoverageDeps: Seq[File] = update.value matching configurationFilter(ScoveragePluginConfig.name)
val scoverageDeps: Seq[File] = updateReport matching configurationFilter(ScoveragePluginConfig.name)
val pluginPath: File = scoverageDeps.find(_.getAbsolutePath.contains(ScalacPluginArtifact)) match {
case None => throw new Exception(s"Fatal: $ScalacPluginArtifact not in libraryDependencies")
case Some(pluginPath) => pluginPath
Expand All @@ -94,8 +95,8 @@ object ScoverageSbtPlugin extends AutoPlugin {

// returns "_sjs$sjsVersion" for Scala.js projects or "" otherwise
private def optionalScalaJsSuffix(deps: Seq[ModuleID]): String = {
val sjsClassifier = deps.collectFirst{
case ModuleID("org.scala-js", "scalajs-library", v, _, _, _, _, _, _, _, _) => v
val sjsClassifier = deps.collectFirst {
case moduleId if moduleId.organization == "org.scala-js" && moduleId.name == "scalajs-library" => moduleId.revision
}.map(_.take(3)).map(sjsVersion => "_sjs" + sjsVersion)

sjsClassifier getOrElse ""
Expand Down
4 changes: 2 additions & 2 deletions src/sbt-test/scoverage/preserve-set/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ libraryDependencies += "org.specs2" %% "specs2" % "2.3.13" % "test"
val checkScalaVersion = inputKey[Unit]("Input task to compare the value of scalaVersion setting with a given input.")
checkScalaVersion := {
val arg: String = (Space ~> StringBasic).parsed
if (scalaVersion.value != arg) error(s"scalaVersion [${scalaVersion.value}] not equal to expected [$arg]")
if (scalaVersion.value != arg) sys.error(s"scalaVersion [${scalaVersion.value}] not equal to expected [$arg]")
()
}

val checkScoverageEnabled = inputKey[Unit]("Input task to compare the value of coverageEnabled setting with a given input.")
checkScoverageEnabled := {
val arg: String = (Space ~> StringBasic).parsed
if (coverageEnabled.value.toString != arg) error(s"coverageEnabled [${coverageEnabled.value}] not equal to expected [$arg]")
if (coverageEnabled.value.toString != arg) sys.error(s"coverageEnabled [${coverageEnabled.value}] not equal to expected [$arg]")
()
}

Expand Down
2 changes: 1 addition & 1 deletion src/sbt-test/scoverage/scalajs/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ resolvers ++= {
Seq.empty
}

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.13")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.19")