Skip to content
Open
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
8 changes: 7 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,13 @@ lazy val mima = project
.in(file("mima"))
.enablePlugins(SbtPlugin)
.settings(
name := "sbt-typelevel-mima"
name := "sbt-typelevel-mima",
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[IncompatibleResultTypeProblem](
"org.typelevel.sbt.TypelevelMimaPlugin.requires"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"org.typelevel.sbt.TypelevelMimaPlugin.requires")
)
)
.dependsOn(kernel)

Expand Down
15 changes: 14 additions & 1 deletion ci/src/main/scala/org/typelevel/sbt/TypelevelCiPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ object TypelevelCiPlugin extends AutoPlugin {
settingKey[Boolean]("Whether to do scalafix check in CI (default: false)")
lazy val tlCiMimaBinaryIssueCheck =
settingKey[Boolean]("Whether to do MiMa binary issues check in CI (default: false)")
lazy val tlCiTastyMimaCheck =
settingKey[Boolean]("Whether to do TASTy-MiMa issues check in CI (default: false)")
lazy val tlCiDocCheck =
settingKey[Boolean]("Whether to build API docs in CI (default: false)")

Expand All @@ -66,6 +68,7 @@ object TypelevelCiPlugin extends AutoPlugin {
tlCiJavafmtCheck := false,
tlCiScalafixCheck := false,
tlCiMimaBinaryIssueCheck := false,
tlCiTastyMimaCheck := false,
tlCiDocCheck := false,
tlCiDependencyGraphJob := true,
tlCiForkCondition := "github.event.repository.fork == false",
Expand Down Expand Up @@ -129,6 +132,16 @@ object TypelevelCiPlugin extends AutoPlugin {
))
else Nil

val tastyMima =
if (tlCiTastyMimaCheck.value)
List(
WorkflowStep.Sbt(
List("tastyMiMaReportIssues"),
name = Some("Check TASTy compatibility"),
cond = Some(primaryAxisCond.value)
))
else Nil

val doc =
if (tlCiDocCheck.value)
List(
Expand All @@ -140,7 +153,7 @@ object TypelevelCiPlugin extends AutoPlugin {
)
else Nil

style ++ scalafix ++ test ++ mima ++ doc
style ++ scalafix ++ test ++ mima ++ tastyMima ++ doc
},
githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8")),
githubWorkflowAddedJobs ++= {
Expand Down
1 change: 1 addition & 0 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Both plugins are documented in [**sbt-typelevel-github-actions**](gha.md).
- `tlCiJavafmtCheck` (setting): Whether to do javafmt check in CI (default: `false`).
- `tlCiScalafixCheck` (setting): Whether to do scalafix check in CI (default: `false`).
- `tlCiMimaBinaryIssueCheck` (setting): Whether to do MiMa binary issues check in CI (default: `false`).
- `tlCiTastyMimaCheck` (setting): Whether to do TASTy-MiMa issues check in CI (default: `false`).
- `tlCiDocCheck` (setting): Whether to build API docs in CI (default: `false`).
- `tlCiDependencyGraphJob` (setting): Whether to add a job to submit dependencies to GH (default: `true`).
- `tlCiForkCondition` (setting): Condition for checking on CI whether this project is a fork of another (default: `github.event.repository.fork == false`).
Expand Down
1 change: 1 addition & 0 deletions mima/build.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.5")
addSbtPlugin("ch.epfl.scala" % "sbt-tasty-mima" % "1.4.0")
25 changes: 24 additions & 1 deletion mima/src/main/scala/org/typelevel/sbt/TypelevelMimaPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@ import com.typesafe.tools.mima.plugin.MimaPlugin
import org.typelevel.sbt.kernel.GitHelper
import org.typelevel.sbt.kernel.V
import sbt._
import sbttastymima.TastyMiMaPlugin

import Keys._
import MimaPlugin.autoImport._
import TastyMiMaPlugin.autoImport._
import TypelevelKernelPlugin.autoImport._

object TypelevelMimaPlugin extends AutoPlugin {

override def requires = MimaPlugin
override def requires = TypelevelKernelPlugin && MimaPlugin && TastyMiMaPlugin

override def trigger = allRequirements

Expand Down Expand Up @@ -85,6 +88,26 @@ object TypelevelMimaPlugin extends AutoPlugin {
}
else
Set.empty
},
tastyMiMaReportIssues := {
if (tlIsScala3.value && publishArtifact.value) tastyMiMaReportIssues.value
else ()
},
tastyMiMaPreviousArtifacts := {
if (tlIsScala3.value && publishArtifact.value) {
tlMimaPreviousVersions
.value
.flatMap(v => V(v))
.toList
.sorted
.lastOption
.map { v =>
projectID.value.withRevision(v.toString).withExplicitArtifacts(Vector.empty)
}
.toSet
} else {
Set.empty
}
}
)

Expand Down
Loading