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

drop sbt-dotty plugin for Scala 3.0.0 final #54

Merged
merged 1 commit into from
May 16, 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
1 change: 0 additions & 1 deletion core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
2 changes: 1 addition & 1 deletion core/src/main/scala/sbtspiewak/NoPublishPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ object NoPublishPlugin extends AutoPlugin {
mimaPreviousArtifacts := Set.empty,
undeclaredCompileDependenciesTest := {},
unusedCompileDependenciesTest := {},
skip in publish := true
publish / skip := true
)
}
48 changes: 4 additions & 44 deletions core/src/main/scala/sbtspiewak/SpiewakPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -45,7 +43,6 @@ object SpiewakPlugin extends AutoPlugin {
GitHubActionsPlugin &&
GenerativePlugin &&
MimaPlugin &&
DottyPlugin &&
CrossPlugin &&
plugins.JvmPlugin

Expand Down Expand Up @@ -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(
Expand All @@ -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
Expand Down Expand Up @@ -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 ++
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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*"))
Expand Down
2 changes: 1 addition & 1 deletion core/src/sbt-test/sbtspiewak/dotty/build.sbt
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
1 change: 0 additions & 1 deletion core/src/sbt-test/sbtspiewak/dottyjs/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
2 changes: 1 addition & 1 deletion core/src/sbt-test/sbtspiewak/mima/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
2 changes: 1 addition & 1 deletion core/src/sbt-test/sbtspiewak/nowarn/build.sbt
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2
7 changes: 0 additions & 7 deletions core/src/test/scala/sbtspiewak/FullScalaVersionSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.5.2