From 1bba24762593245f363972809de9f27f7cbef7d1 Mon Sep 17 00:00:00 2001 From: Michal Sitko Date: Tue, 4 May 2021 14:30:24 +0200 Subject: [PATCH] Remove sbt-dotty plugin --- .gitignore | 2 ++ build.sbt | 14 ++++++++++---- project/plugins.sbt | 2 -- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 618819029..91ce8534e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ lib_managed/ src_managed/ project/boot/ project/plugins/project/ +.bsp # Scala-IDE specific .scala_dependencies @@ -21,3 +22,4 @@ project/plugins/project/ .bloop/ .metals/ +.vscode diff --git a/build.sbt b/build.sbt index e8d203a7e..a96c0534c 100644 --- a/build.sbt +++ b/build.sbt @@ -151,6 +151,12 @@ lazy val cats = myCrossProject("cats") lazy val catsJVM = cats.jvm lazy val catsJS = cats.js +lazy val isScala3Setting = Def.setting { + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((3, _)) => true + case _ => false + } +} lazy val core = myCrossProject("core") .enablePlugins(BuildInfoPlugin) @@ -158,7 +164,7 @@ lazy val core = myCrossProject("core") .settings( libraryDependencies ++= { macroParadise(Compile).value ++ ( - if (isDotty.value) + if (isScala3Setting.value) Seq( "org.scala-lang.modules" %% "scala-xml" % "2.0.0-RC1" ) @@ -169,7 +175,7 @@ lazy val core = myCrossProject("core") "org.scala-lang.modules" %% "scala-xml" % "1.3.0" ) ) ++ Seq( - ("com.chuusai" %%% "shapeless" % shapelessVersion).withDottyCompat(scalaVersion.value), + ("com.chuusai" %%% "shapeless" % shapelessVersion).cross(CrossVersion.for3Use2_13), "org.scalacheck" %%% "scalacheck" % scalaCheckVersion % Test ) }, @@ -371,7 +377,7 @@ def moduleJsSettings(name: String): Seq[Def.Setting[_]] = else git.gitHeadCommit.value.getOrElse("master") val local = (LocalRootProject / baseDirectory).value.toURI.toString val remote = s"https://raw.githubusercontent.com/$gitHubOwner/$projectName/$tagOrHash/" - val opt = if (isDotty.value) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI" + val opt = if (isScala3Setting.value) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI" s"$opt:$local->$remote" } ) @@ -458,7 +464,7 @@ lazy val compileSettings = Def.settings( lazy val scaladocSettings = Def.settings( Compile / doc / sources := { val result = (Compile / doc / sources).value - if (isDotty.value) Seq.empty else result + if (isScala3Setting.value) Seq.empty else result }, Compile / doc / scalacOptions ++= { val tag = s"v${version.value}" diff --git a/project/plugins.sbt b/project/plugins.sbt index 2dfc0c5fc..c947c902f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,3 @@ -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.5") - addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.10.1") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")