From 0ff2132074992bb494d8be5ee4a798a8062068c6 Mon Sep 17 00:00:00 2001 From: Tomasz Godzik Date: Thu, 22 Jul 2021 13:10:00 +0200 Subject: [PATCH] Drop Scala 3 RC versions and bump newest to 3.0.1 --- .github/workflows/ci.yml | 2 +- bin/test-release.sh | 3 --- build.sbt | 7 +++--- .../mdoc/internal/pprint/TypePrinter.scala | 24 ------------------- .../mdoc/internal/sourcecode/Macros.scala | 18 -------------- .../mdoc/internal/pprint/TypePrinter.scala | 24 ------------------- .../mdoc/internal/sourcecode/Macros.scala | 18 -------------- .../mdoc/internal/pprint/TypePrinter.scala | 24 ------------------- .../mdoc/internal/sourcecode/Macros.scala | 18 -------------- .../mdoc/internal/pprint/TypePrinter.scala | 0 .../mdoc/internal/sourcecode/Macros.scala | 0 11 files changed, 4 insertions(+), 134 deletions(-) delete mode 100644 runtime/src/main/scala-3.0.0-RC2/mdoc/internal/pprint/TypePrinter.scala delete mode 100644 runtime/src/main/scala-3.0.0-RC2/mdoc/internal/sourcecode/Macros.scala delete mode 100644 runtime/src/main/scala-3.0.0-RC3/mdoc/internal/pprint/TypePrinter.scala delete mode 100644 runtime/src/main/scala-3.0.0-RC3/mdoc/internal/sourcecode/Macros.scala delete mode 100644 runtime/src/main/scala-3.0.0/mdoc/internal/pprint/TypePrinter.scala delete mode 100644 runtime/src/main/scala-3.0.0/mdoc/internal/sourcecode/Macros.scala rename runtime/src/main/{scala-3.0.0-RC1 => scala-3}/mdoc/internal/pprint/TypePrinter.scala (100%) rename runtime/src/main/{scala-3.0.0-RC1 => scala-3}/mdoc/internal/sourcecode/Macros.scala (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4cd28788..8c255a451 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: - "'++2.12.12 test'" - "'++2.12.14 test' scripted" - "'++2.13.6 test'" - - "'++3.0.0 test'" + - "'++3.0.1 test'" steps: - uses: actions/checkout@v2 - uses: olafurpg/setup-scala@v12 diff --git a/bin/test-release.sh b/bin/test-release.sh index 2718d9326..676679588 100755 --- a/bin/test-release.sh +++ b/bin/test-release.sh @@ -9,9 +9,6 @@ coursier fetch \ org.scalameta:mdoc_2.11:$version \ org.scalameta:mdoc_2.12:$version \ org.scalameta:mdoc_2.13:$version \ - org.scalameta:mdoc_3.0.0-RC1:$version \ - org.scalameta:mdoc_3.0.0-RC2:$version \ - org.scalameta:mdoc_3.0.0-RC3:$version \ org.scalameta:mdoc_3:$version \ org.scalameta:mdoc-js_2.11:$version \ org.scalameta:mdoc-js_2.12:$version \ diff --git a/build.sbt b/build.sbt index a02270b5c..a113e8b04 100644 --- a/build.sbt +++ b/build.sbt @@ -3,9 +3,9 @@ import scala.collection.mutable def scala212 = "2.12.14" def scala211 = "2.11.12" def scala213 = "2.13.6" -def scala3 = List("3.0.0", "3.0.0-RC3", "3.0.0-RC2", "3.0.0-RC1") +def scala3 = "3.0.1" def scala2Versions = List(scala212, scala211, scala213) -def allScalaVersions = scala2Versions ::: scala3 +def allScalaVersions = scala2Versions :+ scala3 def scalajs = "1.5.1" def scalajsBinaryVersion = "1" @@ -68,7 +68,7 @@ def crossSetting[A]( inThisBuild( List( scalaVersion := scala213, - crossScalaVersions := scala2Versions ::: scala3, + crossScalaVersions := allScalaVersions, organization := "org.scalameta", licenses := Seq( "Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0") @@ -130,7 +130,6 @@ lazy val fansiVersion = Def.setting { lazy val fs2Version = Def.setting { if (scalaVersion.value.startsWith("2.11")) "2.1.0" - else if (scalaVersion.value == "3.0.0-RC1") "2.5.4" else "2.5.5" } diff --git a/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/pprint/TypePrinter.scala b/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/pprint/TypePrinter.scala deleted file mode 100644 index 13c2c7029..000000000 --- a/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/pprint/TypePrinter.scala +++ /dev/null @@ -1,24 +0,0 @@ -package mdoc.internal.pprint - -import scala.language.implicitConversions -import scala.quoted._ -import scala.quoted.runtime.impl.printers.SyntaxHighlight - -trait TPrint[T]{ - def render: String -} - -object TPrint { - inline given default[T]: TPrint[T] = ${ TypePrinter.typeString[T] } -} - -object TypePrinter{ - - def typeString[T](using ctx: Quotes, tpe: Type[T]): Expr[TPrint[T]] = { - import ctx.reflect._ - - val valueType = TypeTree.of[T](using tpe).tpe.show(using Printer.TypeReprShortCode) - - '{ new TPrint[T]{ def render: String = ${ Expr(valueType) } } } - } -} diff --git a/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/sourcecode/Macros.scala b/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/sourcecode/Macros.scala deleted file mode 100644 index e6d43fc8d..000000000 --- a/runtime/src/main/scala-3.0.0-RC2/mdoc/internal/sourcecode/Macros.scala +++ /dev/null @@ -1,18 +0,0 @@ -package mdoc.internal.sourcecode - -import scala.language.implicitConversions -import scala.quoted._ - -trait StatementMacro { - inline implicit def generate[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } - inline def apply[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } -} - -object Macros{ - - def text[T: Type](v: Expr[T])(using ctx: Quotes): Expr[SourceStatement[T]] = { - import ctx.reflect.{_, given} - val txt = v.asTerm.pos.sourceCode.getOrElse("") - '{SourceStatement[T]($v, ${Expr(txt)})} - } -} \ No newline at end of file diff --git a/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/pprint/TypePrinter.scala b/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/pprint/TypePrinter.scala deleted file mode 100644 index 13c2c7029..000000000 --- a/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/pprint/TypePrinter.scala +++ /dev/null @@ -1,24 +0,0 @@ -package mdoc.internal.pprint - -import scala.language.implicitConversions -import scala.quoted._ -import scala.quoted.runtime.impl.printers.SyntaxHighlight - -trait TPrint[T]{ - def render: String -} - -object TPrint { - inline given default[T]: TPrint[T] = ${ TypePrinter.typeString[T] } -} - -object TypePrinter{ - - def typeString[T](using ctx: Quotes, tpe: Type[T]): Expr[TPrint[T]] = { - import ctx.reflect._ - - val valueType = TypeTree.of[T](using tpe).tpe.show(using Printer.TypeReprShortCode) - - '{ new TPrint[T]{ def render: String = ${ Expr(valueType) } } } - } -} diff --git a/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/sourcecode/Macros.scala b/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/sourcecode/Macros.scala deleted file mode 100644 index e6d43fc8d..000000000 --- a/runtime/src/main/scala-3.0.0-RC3/mdoc/internal/sourcecode/Macros.scala +++ /dev/null @@ -1,18 +0,0 @@ -package mdoc.internal.sourcecode - -import scala.language.implicitConversions -import scala.quoted._ - -trait StatementMacro { - inline implicit def generate[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } - inline def apply[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } -} - -object Macros{ - - def text[T: Type](v: Expr[T])(using ctx: Quotes): Expr[SourceStatement[T]] = { - import ctx.reflect.{_, given} - val txt = v.asTerm.pos.sourceCode.getOrElse("") - '{SourceStatement[T]($v, ${Expr(txt)})} - } -} \ No newline at end of file diff --git a/runtime/src/main/scala-3.0.0/mdoc/internal/pprint/TypePrinter.scala b/runtime/src/main/scala-3.0.0/mdoc/internal/pprint/TypePrinter.scala deleted file mode 100644 index 13c2c7029..000000000 --- a/runtime/src/main/scala-3.0.0/mdoc/internal/pprint/TypePrinter.scala +++ /dev/null @@ -1,24 +0,0 @@ -package mdoc.internal.pprint - -import scala.language.implicitConversions -import scala.quoted._ -import scala.quoted.runtime.impl.printers.SyntaxHighlight - -trait TPrint[T]{ - def render: String -} - -object TPrint { - inline given default[T]: TPrint[T] = ${ TypePrinter.typeString[T] } -} - -object TypePrinter{ - - def typeString[T](using ctx: Quotes, tpe: Type[T]): Expr[TPrint[T]] = { - import ctx.reflect._ - - val valueType = TypeTree.of[T](using tpe).tpe.show(using Printer.TypeReprShortCode) - - '{ new TPrint[T]{ def render: String = ${ Expr(valueType) } } } - } -} diff --git a/runtime/src/main/scala-3.0.0/mdoc/internal/sourcecode/Macros.scala b/runtime/src/main/scala-3.0.0/mdoc/internal/sourcecode/Macros.scala deleted file mode 100644 index e6d43fc8d..000000000 --- a/runtime/src/main/scala-3.0.0/mdoc/internal/sourcecode/Macros.scala +++ /dev/null @@ -1,18 +0,0 @@ -package mdoc.internal.sourcecode - -import scala.language.implicitConversions -import scala.quoted._ - -trait StatementMacro { - inline implicit def generate[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } - inline def apply[T](v: => T): SourceStatement[T] = ${ Macros.text('v) } -} - -object Macros{ - - def text[T: Type](v: Expr[T])(using ctx: Quotes): Expr[SourceStatement[T]] = { - import ctx.reflect.{_, given} - val txt = v.asTerm.pos.sourceCode.getOrElse("") - '{SourceStatement[T]($v, ${Expr(txt)})} - } -} \ No newline at end of file diff --git a/runtime/src/main/scala-3.0.0-RC1/mdoc/internal/pprint/TypePrinter.scala b/runtime/src/main/scala-3/mdoc/internal/pprint/TypePrinter.scala similarity index 100% rename from runtime/src/main/scala-3.0.0-RC1/mdoc/internal/pprint/TypePrinter.scala rename to runtime/src/main/scala-3/mdoc/internal/pprint/TypePrinter.scala diff --git a/runtime/src/main/scala-3.0.0-RC1/mdoc/internal/sourcecode/Macros.scala b/runtime/src/main/scala-3/mdoc/internal/sourcecode/Macros.scala similarity index 100% rename from runtime/src/main/scala-3.0.0-RC1/mdoc/internal/sourcecode/Macros.scala rename to runtime/src/main/scala-3/mdoc/internal/sourcecode/Macros.scala