Skip to content

Commit

Permalink
Update Scala version for 3.0.0-M1
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Nov 3, 2020
1 parent d0c18b6 commit 1145729
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
14 changes: 6 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ def previousVersion = "0.7.0"
def scala213 = "2.13.2"
def scala212 = "2.12.11"
def scala211 = "2.11.12"
def dottyNext = "0.27.0-RC1"
def dottyStable = "0.26.0"
def dottyStable = "3.0.0-M1"
def junitVersion = "4.13"
def gcp = "com.google.cloud" % "google-cloud-storage" % "1.113.2"
inThisBuild(
Expand Down Expand Up @@ -62,11 +61,11 @@ addCommandAlias(
)
val isPreScala213 = Set[Option[(Long, Long)]](Some((2, 11)), Some((2, 12)))
val scala2Versions = List(scala213, scala212, scala211)
val scala3Versions = List(dottyNext, dottyStable)
val scala3Versions = List(dottyStable)
val allScalaVersions = scala2Versions ++ scala3Versions
def isNotScala211(v: Option[(Long, Long)]): Boolean = !v.contains((2, 11))
def isScala2(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 2)
def isScala3(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 0)
def isScala3(v: Option[(Long, Long)]): Boolean = v.exists(_._1 == 3)
val isScalaJS = Def.setting[Boolean](
SettingKey[Boolean]("scalaJSUseMainModuleInitializer").?.value.isDefined
)
Expand Down Expand Up @@ -132,7 +131,7 @@ val sharedSettings = List(
"-Xexperimental",
"-Ywarn-unused-import"
)
case Some((0, _)) => List()
case Some((3, _)) => List()
case _ =>
List(
"-target:jvm-1.8",
Expand Down Expand Up @@ -191,7 +190,7 @@ lazy val munit = crossProject(JSPlatform, JVMPlatform, NativePlatform)
},
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((0, _)) => Nil
case Some((3, _)) => Nil
case _ =>
List(
"org.scala-lang" % "scala-reflect" % scalaVersion.value
Expand Down Expand Up @@ -321,8 +320,7 @@ lazy val docs = project
mdocExtraArguments := List("--no-link-hygiene"),
mdocVariables := Map(
"VERSION" -> version.value.replaceFirst("\\+.*", ""),
"DOTTY_VERSION" -> dottyNext,
"DOTTY_NEXT_VERSION" -> dottyNext,
"DOTTY_VERSION" -> dottyStable,
"DOTTY_STABLE_VERSION" -> dottyStable,
"SUPPORTED_SCALA_VERSIONS" -> allScalaVersions.mkString(", ")
),
Expand Down
1 change: 0 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ testFrameworks += new TestFramework("munit.Framework")
| 2.11.x ||||
| 2.12.x ||| n/a |
| 2.13.x ||| n/a |
| @DOTTY_NEXT_VERSION@ || n/a | n/a |
| @DOTTY_STABLE_VERSION@ || n/a | n/a |

Next, write a test suite.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object MacroCompat {
}

def locationImpl()(using qctx: QuoteContext): Expr[Location] = {
import qctx.tasty.{_, given _}
import qctx.reflect.{_, given}
val path = rootPosition.sourceFile.jpath.toString
val startLine = rootPosition.startLine + 1
'{ new Location(${Expr(path)}, ${Expr(startLine)}) }
Expand All @@ -22,7 +22,7 @@ object MacroCompat {
}

def clueImpl[T:Type](value: Expr[T])(using qctx: QuoteContext): Expr[Clue[T]] = {
import qctx.tasty.{_, given _}
import qctx.reflect.{_, given}
val source = value.unseal.pos.sourceCode
val valueType = implicitly[scala.quoted.Type[T]].show
'{ new Clue(${Expr(source)}, $value, ${Expr(valueType)}) }
Expand Down

0 comments on commit 1145729

Please sign in to comment.