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

Update to Scala 3 final #347

Merged
merged 2 commits into from
May 17, 2021
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
21 changes: 10 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
val avroVersion = "1.10.2"

val catsVersion = "2.6.0"
val catsVersion = "2.6.1"

val enumeratumVersion = "1.6.1"

val magnoliaVersion = "0.17.0"

val refinedVersion = "0.9.24"
val refinedVersion = "0.9.25"

val shapelessVersion = "2.3.7"

val scala212 = "2.12.13"

val scala213 = "2.13.5"

val scala3 = "3.0.0-RC3"
val scala3 = "3.0.0"

lazy val vulcan = project
.in(file("."))
Expand All @@ -37,7 +37,7 @@ lazy val core = project
"org.apache.avro" % "avro" % avroVersion,
"org.typelevel" %% "cats-free" % catsVersion
) ++ {
if (isDotty.value) Nil
if (scalaVersion.value.startsWith("3")) Nil
else Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided)
}
),
Expand Down Expand Up @@ -125,7 +125,7 @@ lazy val docs = project

lazy val dependencySettings = Seq(
libraryDependencies ++= {
if (isDotty.value) Nil
if (scalaVersion.value.startsWith("3")) Nil
else
Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.4.4" % Test,
Expand All @@ -148,7 +148,7 @@ lazy val dependencySettings = Seq(

lazy val scalatestSettings = Seq(
libraryDependencies ++= Seq(
"org.typelevel" %% "discipline-scalatest" % "2.1.4",
"org.typelevel" %% "discipline-scalatest" % "2.1.5",
"org.typelevel" %% "cats-testkit" % catsVersion,
"org.slf4j" % "slf4j-nop" % "1.7.30"
).map(_ % Test)
Expand Down Expand Up @@ -267,7 +267,8 @@ lazy val publishSettings =

lazy val mimaSettings = Seq(
mimaPreviousArtifacts := {
if (publishArtifact.value && !isDotty.value) {
if (publishArtifact.value && !scalaVersion.value
.startsWith("3")) { // enable mima for Scala 3 after first release
Set(organization.value %% moduleName.value % (ThisBuild / previousStableVersion).value.get)
} else Set()
},
Expand Down Expand Up @@ -334,11 +335,9 @@ lazy val scalaSettings = Seq(
} else Seq()

val scala3ScalacOptions =
if (isDotty.value) {
if (scalaVersion.value.startsWith("3")) {
Seq(
"-Ykind-projector",
"-source:3.0-migration",
"-Xignore-scala2-macros"
"-Ykind-projector"
)
} else Seq()

Expand Down
14 changes: 13 additions & 1 deletion modules/core/src/test/scala/vulcan/BaseSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,17 @@ package vulcan

import org.scalatest.funspec.AnyFunSpec
import org.scalatestplus.scalacheck.ScalaCheckPropertyChecks
import org.scalactic.Equality
import cats.kernel.Eq
import scala.reflect.ClassTag

class BaseSpec extends AnyFunSpec with ScalaCheckPropertyChecks with EitherValues
class BaseSpec extends AnyFunSpec with ScalaCheckPropertyChecks with EitherValues {

// In Scala 3, `===` uses Scalactic rather than Cats syntax
implicit def catsEquality[A: Eq: ClassTag]: Equality[A] = new Equality[A] {
def areEqual(a: A, b: Any): Boolean = b match {
case b: A => Eq[A].eqv(a, b)
case _ => false
}
}
}
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.21")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.5")