Skip to content

Commit 35fda76

Browse files
committed
Fixed for build 2.11
1 parent 0af2a79 commit 35fda76

File tree

2 files changed

+21
-16
lines changed

2 files changed

+21
-16
lines changed

build.sbt

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ javacOptions ++= Seq("-source", "1.6", "-target", "1.6")
3030

3131
scalaVersion := "2.10.3"
3232

33-
//crossScalaVersions := Seq("2.10.3", "2.11.0-RC1")
34-
//
35-
//libraryDependencies := {
36-
// CrossVersion.partialVersion(scalaVersion.value) match {
37-
// case Some((2, scalaMajor)) if scalaMajor >= 11 =>
38-
// libraryDependencies.value :+ "org.scala-lang.modules" %% "scala-xml" % "1.0.0"
39-
// case _ =>
40-
// libraryDependencies.value
41-
// }
42-
//}
33+
crossScalaVersions := Seq("2.10.3", "2.11.0-RC1")
34+
35+
libraryDependencies := {
36+
CrossVersion.partialVersion(scalaVersion.value) match {
37+
case Some((2, scalaMajor)) if scalaMajor >= 11 =>
38+
libraryDependencies.value :+ "org.scala-lang.modules" %% "scala-xml" % "1.0.0"
39+
case _ =>
40+
libraryDependencies.value
41+
}
42+
}
43+
44+
libraryDependencies := {
45+
val version = CrossVersion.binaryScalaVersion(scalaVersion.value)
46+
libraryDependencies.value :+ "org.scala-lang" % "scala-compiler" % version % "provided"
47+
}
4348

4449
publishTo <<= version {
4550
(v: String) =>

src/main/scala/scoverage/plugin.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ class ScoveragePlugin(val global: Global) extends Plugin {
1212

1313
val name: String = "scoverage"
1414
val description: String = "scoverage code coverage compiler plugin"
15-
val options = new ScoverageOptions
16-
val components: List[PluginComponent] = List(new ScoverageComponent(global, options))
15+
val opts = new ScoverageOptions
16+
val components: List[PluginComponent] = List(new ScoverageComponent(global, opts))
1717

18-
override def processOptions(opts: List[String], error: String => Unit) {
19-
for ( opt <- opts ) {
18+
override def processOptions(options: List[String], error: String => Unit) {
19+
for ( opt <- options ) {
2020
if (opt.startsWith("excludedPackages:")) {
21-
options.excludedPackages = opt.substring("excludedPackages:".length).split(";").map(_.trim).filterNot(_.isEmpty)
21+
opts.excludedPackages = opt.substring("excludedPackages:".length).split(";").map(_.trim).filterNot(_.isEmpty)
2222
} else if (opt.startsWith("dataDir:")) {
23-
options.dataDir = opt.substring("dataDir:".length)
23+
opts.dataDir = opt.substring("dataDir:".length)
2424
} else {
2525
error("Unknown option: " + opt)
2626
}

0 commit comments

Comments
 (0)