diff --git a/build.sbt b/build.sbt index 01151186..fd83f1be 100644 --- a/build.sbt +++ b/build.sbt @@ -87,6 +87,7 @@ def theScalacheckVersion(scalaVersion: String) = def scalaTestPlay(scalaVersion: String) = CrossVersion.partialVersion(scalaVersion) match { case Some((2, scalaMajor)) if scalaMajor >= 12 => "org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test + case _ => throw new IllegalArgumentException(s"Unsupported Scala version $scalaVersion for play-test") } @@ -494,8 +495,20 @@ lazy val enumeratumScalacheck = crossProject(JSPlatform, JVMPlatform) Seq( "org.scalacheck" %%% "scalacheck" % theScalacheckVersion(scalaVersion.value), "org.scalatestplus" %%% "scalacheck-1-14" % "3.1.1.1" % Test + ).map( + _.exclude("org.scala-lang.modules", "*") + .exclude("org.scalatest", "*") + .cross(CrossVersion.for3Use2_13) ) }, + libraryDependencies += { + val ver: String = { + if (scalaBinaryVersion.value == "2.11") "1.3.0" + else "2.1.0" + } + + "org.scala-lang.modules" %% "scala-xml" % ver % Test + }, libraryDependencies ++= { if (useLocalVersion) { Seq.empty @@ -766,7 +779,13 @@ lazy val publishSettings = Seq( val testSettings = { Seq( libraryDependencies += { - "org.scalatest" %%% "scalatest" % scalaTestVersion % Test + val dep = "org.scalatest" %%% "scalatest" % scalaTestVersion % Test + + if (scalaBinaryVersion.value == "3") { + dep.exclude("org.scala-lang.modules", "*") + } else { + dep + } }, doctestGenTests := { val originalValue = doctestGenTests.value @@ -779,9 +798,7 @@ val testSettings = { val jsTestSettings = { Seq( coverageEnabled := false, // Disable until Scala.js 1.0 support is there https://github.com/scoverage/scalac-scoverage-plugin/pull/287 - doctestGenTests := { - Seq.empty - } + doctestGenTests := Seq.empty ) } diff --git a/enumeratum-scalacheck/src/main/scala/enumeratum/ArbitraryInstances.scala b/enumeratum-scalacheck/src/main/scala/enumeratum/ArbitraryInstances.scala index 250c45ec..d51cea08 100644 --- a/enumeratum-scalacheck/src/main/scala/enumeratum/ArbitraryInstances.scala +++ b/enumeratum-scalacheck/src/main/scala/enumeratum/ArbitraryInstances.scala @@ -5,7 +5,7 @@ import org.scalacheck.{Arbitrary, Gen} trait ArbitraryInstances { implicit def arbEnumEntry[EnumType <: EnumEntry](implicit - enum: Enum[EnumType] - ): Arbitrary[EnumType] = Arbitrary(Gen.oneOf(enum.values)) + myEnum: Enum[EnumType] + ): Arbitrary[EnumType] = Arbitrary(Gen.oneOf(myEnum.values)) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 1a913c71..ff6fcfe0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,8 +3,6 @@ resolvers ++= Seq( ) addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.8.2") -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.7") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.1.0") @@ -12,3 +10,6 @@ addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.3") addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.9.9") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") + +addSbtPlugin(("org.scoverage" % "sbt-scoverage" % "2.0.2").exclude("org.scala-lang.modules", "*")) +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.2")