From d262cc4e0757844e722539527bd7078d199883ee Mon Sep 17 00:00:00 2001 From: Lars Hupel Date: Fri, 14 May 2021 13:36:02 +0200 Subject: [PATCH] drop sbt-dotty plugin for Scala 3.0.0 final --- core/build.sbt | 1 - .../scala/sbtspiewak/NoPublishPlugin.scala | 2 +- .../main/scala/sbtspiewak/SpiewakPlugin.scala | 48 ++----------------- core/src/sbt-test/sbtspiewak/dotty/build.sbt | 2 +- .../sbtspiewak/dotty/project/build.properties | 2 +- .../src/sbt-test/sbtspiewak/dottyjs/build.sbt | 1 - .../dottyjs/project/build.properties | 2 +- .../sbtspiewak/mima/project/build.properties | 2 +- core/src/sbt-test/sbtspiewak/nowarn/build.sbt | 2 +- .../nowarn/project/build.properties | 2 +- .../relevance/project/build.properties | 2 +- .../scalaversions/project/build.properties | 2 +- .../versions/project/build.properties | 2 +- .../sbtspiewak/FullScalaVersionSpec.scala | 7 --- project/build.properties | 2 +- 15 files changed, 15 insertions(+), 64 deletions(-) diff --git a/core/build.sbt b/core/build.sbt index 2fd1d0b..695a60d 100644 --- a/core/build.sbt +++ b/core/build.sbt @@ -4,5 +4,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1") addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") -addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.3") addSbtPlugin("org.portable-scala" % "sbt-crossproject" % "1.0.0") diff --git a/core/src/main/scala/sbtspiewak/NoPublishPlugin.scala b/core/src/main/scala/sbtspiewak/NoPublishPlugin.scala index 1da97e7..94ca822 100644 --- a/core/src/main/scala/sbtspiewak/NoPublishPlugin.scala +++ b/core/src/main/scala/sbtspiewak/NoPublishPlugin.scala @@ -33,6 +33,6 @@ object NoPublishPlugin extends AutoPlugin { mimaPreviousArtifacts := Set.empty, undeclaredCompileDependenciesTest := {}, unusedCompileDependenciesTest := {}, - skip in publish := true + publish / skip := true ) } diff --git a/core/src/main/scala/sbtspiewak/SpiewakPlugin.scala b/core/src/main/scala/sbtspiewak/SpiewakPlugin.scala index 2bf91ae..668670e 100644 --- a/core/src/main/scala/sbtspiewak/SpiewakPlugin.scala +++ b/core/src/main/scala/sbtspiewak/SpiewakPlugin.scala @@ -24,8 +24,6 @@ import com.typesafe.tools.mima.plugin.MimaPlugin, MimaPlugin.autoImport._ import de.heikoseeberger.sbtheader.{AutomateHeaderPlugin, HeaderPlugin, License, SpdxLicense}, HeaderPlugin.autoImport._ -import dotty.tools.sbtplugin.DottyPlugin, DottyPlugin.autoImport._ - import explicitdeps.ExplicitDepsPlugin.autoImport._ import _root_.io.crashbox.gpg.SbtGpg @@ -45,7 +43,6 @@ object SpiewakPlugin extends AutoPlugin { GitHubActionsPlugin && GenerativePlugin && MimaPlugin && - DottyPlugin && CrossPlugin && plugins.JvmPlugin @@ -76,6 +73,7 @@ object SpiewakPlugin extends AutoPlugin { lazy val publishLocalIfRelevant = taskKey[Unit]("A wrapper around the `publishLocal` task which checks to ensure the current scalaVersion is in crossScalaVersions") lazy val endYear = settingKey[Option[Int]]("A dual to startYear: the year in which the project ended (usually current year). If this is set, then licenses will be encoded as a range from startYear to endYear. Otherwise, only startYear will apply. (default: None)") + lazy val isDotty = settingKey[Boolean]("True if building with Scala 3") @deprecated("Use .enablePlugin(NoPublishPlugin)", "0.18.0") val noPublishSettings = Seq( @@ -86,36 +84,6 @@ object SpiewakPlugin extends AutoPlugin { mimaPreviousArtifacts := Set.empty, skip in publish := true) - val dottyLibrarySettings = Seq( - libraryDependencies := - libraryDependencies.value map { lib => - // hack to avoid slapping dotty compat on the SJS dotty lib - if (!(lib.organization == "ch.epfl.lamp" && lib.name == "dotty_library") && - !(lib.organization == "org.scala-lang" && lib.name.startsWith("scala3-library"))) - lib.withDottyCompat(scalaVersion.value) - else - lib - }) - - /** - * Only required if you have Dotty versions prior to 0.27.0-RC1 in your - * crossScalaVersions. This shim will eventually be removed. - */ - def dottyJsSettings(defaultCrossScalaVersions: SettingKey[Seq[String]]) = Seq( - crossScalaVersions := { - val default = defaultCrossScalaVersions.value - - if (crossProjectPlatform.value.identifier != "jvm") { - default collect { - case v @ FullScalaVersion(2, _, _, _, _) => v - case v @ FullScalaVersion(3, _, _, _, _) => v - case v @ FullScalaVersion(0, min, _, _, _) if min >= 27 => v - } - } else { - default - } - }) - def filterTaskWhereRelevant(delegate: TaskKey[Unit]) = Def.taskDyn { val cross = crossScalaVersions.value @@ -151,7 +119,8 @@ object SpiewakPlugin extends AutoPlugin { fatalWarningsInCI := true, versionIntroduced := Map(), crossScalaVersions := Seq("2.13.2"), - Def.derive(scalaVersion := crossScalaVersions.value.last, default = true)) + Def.derive(scalaVersion := crossScalaVersions.value.last, default = true), + Def.derive(isDotty := scalaVersion.value.startsWith("3."))) override def buildSettings = GitPlugin.autoImport.versionWithGit ++ @@ -410,7 +379,7 @@ object SpiewakPlugin extends AutoPlugin { "-Wunused:patvars", "-Wunused:privates"), - Test / console / scalacOptions := (scalacOptions in (Compile, console)).value, + Test / console / scalacOptions := (Compile / console / scalacOptions).value, Compile / doc / scalacOptions ++= { if (isDotty.value) @@ -560,15 +529,6 @@ object SpiewakPlugin extends AutoPlugin { new RuleTransformer(stripTestScope).transform(node)(0) }, - // dottydoc really doesn't work at all right now - Compile / doc / sources := { - val old = (Compile / doc / sources).value - if (isDotty.value && !useScala3doc.value) // allow opt-in usage! - Seq() - else - old - }, - unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library*") | moduleFilter("org.scala-lang", "scala3-library*")) diff --git a/core/src/sbt-test/sbtspiewak/dotty/build.sbt b/core/src/sbt-test/sbtspiewak/dotty/build.sbt index 0ac6089..d8dec93 100644 --- a/core/src/sbt-test/sbtspiewak/dotty/build.sbt +++ b/core/src/sbt-test/sbtspiewak/dotty/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / crossScalaVersions := Seq("2.13.4", "0.27.0-RC1", "3.0.0-M1", "3.0.0-M2", "3.0.0-M3", "3.0.0-RC1") +ThisBuild / crossScalaVersions := Seq("2.13.4", "3.0.0-M1", "3.0.0-M2", "3.0.0-M3", "3.0.0-RC1") ThisBuild / baseVersion := "0.1" diff --git a/core/src/sbt-test/sbtspiewak/dotty/project/build.properties b/core/src/sbt-test/sbtspiewak/dotty/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/dotty/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/dotty/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/dottyjs/build.sbt b/core/src/sbt-test/sbtspiewak/dottyjs/build.sbt index d0fa14b..e6fd37f 100644 --- a/core/src/sbt-test/sbtspiewak/dottyjs/build.sbt +++ b/core/src/sbt-test/sbtspiewak/dottyjs/build.sbt @@ -20,5 +20,4 @@ val setting = { lazy val root = project.in(file(".")).aggregate(core.js, core.jvm).settings(setting) lazy val core = crossProject(JSPlatform, JVMPlatform).in(file("core")) - .settings(dottyJsSettings(ThisBuild / crossScalaVersions)) .settings(setting) diff --git a/core/src/sbt-test/sbtspiewak/dottyjs/project/build.properties b/core/src/sbt-test/sbtspiewak/dottyjs/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/dottyjs/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/dottyjs/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/mima/project/build.properties b/core/src/sbt-test/sbtspiewak/mima/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/mima/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/mima/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/nowarn/build.sbt b/core/src/sbt-test/sbtspiewak/nowarn/build.sbt index d357808..e3b31d6 100644 --- a/core/src/sbt-test/sbtspiewak/nowarn/build.sbt +++ b/core/src/sbt-test/sbtspiewak/nowarn/build.sbt @@ -1,4 +1,4 @@ -ThisBuild / crossScalaVersions := Seq("2.11.12", "2.12.12", "2.13.3", "0.27.0-RC1", "3.0.0-M1") +ThisBuild / crossScalaVersions := Seq("2.11.12", "2.12.12", "2.13.3", "3.0.0-M1") ThisBuild / baseVersion := "0.1" diff --git a/core/src/sbt-test/sbtspiewak/nowarn/project/build.properties b/core/src/sbt-test/sbtspiewak/nowarn/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/nowarn/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/nowarn/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/relevance/project/build.properties b/core/src/sbt-test/sbtspiewak/relevance/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/relevance/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/relevance/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/scalaversions/project/build.properties b/core/src/sbt-test/sbtspiewak/scalaversions/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/scalaversions/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/scalaversions/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/sbt-test/sbtspiewak/versions/project/build.properties b/core/src/sbt-test/sbtspiewak/versions/project/build.properties index 0b2e09c..19479ba 100644 --- a/core/src/sbt-test/sbtspiewak/versions/project/build.properties +++ b/core/src/sbt-test/sbtspiewak/versions/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2 diff --git a/core/src/test/scala/sbtspiewak/FullScalaVersionSpec.scala b/core/src/test/scala/sbtspiewak/FullScalaVersionSpec.scala index 498efbe..68e6fd0 100644 --- a/core/src/test/scala/sbtspiewak/FullScalaVersionSpec.scala +++ b/core/src/test/scala/sbtspiewak/FullScalaVersionSpec.scala @@ -35,13 +35,6 @@ class FullScalaVersionSpec extends Specification { } } - "handle dotty 0.27.0-RC1" in { - val input = "0.27.0-RC1" - input must beLike { - case FullScalaVersion(0, 27, 0, MRC.ReleaseCandidate(1), None) => ok - } - } - "handle scala 3 rc snapshots" in { val input = "3.0.0-RC1-bin-SNAPSHOT" input must beLike { diff --git a/project/build.properties b/project/build.properties index 0b2e09c..19479ba 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.7 +sbt.version=1.5.2