Skip to content

Commit

Permalink
Merge pull request #7 from typelevel/topic/mima
Browse files Browse the repository at this point in the history
Added MiMa to build
  • Loading branch information
milessabin authored May 26, 2021
2 parents ad21138 + 3be3514 commit dcacf4c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 15 deletions.
47 changes: 32 additions & 15 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ val dottyVersion = "3.0.0"
ThisBuild / organization := "org.typelevel"
ThisBuild / scalaVersion := dottyVersion
ThisBuild / crossScalaVersions := Seq(dottyVersion)
ThisBuild / mimaFailOnNoPrevious := false
ThisBuild / updateOptions := updateOptions.value.withLatestSnapshots(false)

val previousVersion = "3.0.0"

// GHA configuration

ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8")

ThisBuild / githubWorkflowArtifactUpload := false

ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false)

val JvmCond = s"matrix.platform == 'jvm'"
Expand Down Expand Up @@ -43,25 +44,19 @@ ThisBuild / githubWorkflowPublish := Seq(
)
)

// Aliases

addCommandAlias("validate", ";clean;validateJVM;validateJS")
addCommandAlias("validateJVM", ";buildJVM;testJVM")
addCommandAlias("validateJS", ";buildJS;testJS")
addCommandAlias("validateJVM", ";buildJVM;mimaJVM;testJVM")
addCommandAlias("validateJS", ";buildJS;mimaJS;testJS")
addCommandAlias("buildJVM", ";derivingJVM/compile;testJVM/compile;typeableJVM/compile")
addCommandAlias("buildJS", ";derivingJS/compile;testJS/compile;typeableJS/compile")
addCommandAlias("mimaJVM", ";derivingJVM/mimaReportBinaryIssues;testJVM/mimaReportBinaryIssues;typeableJVM/mimaReportBinaryIssues")
addCommandAlias("mimaJS", ";derivingJS/mimaReportBinaryIssues;testJS/mimaReportBinaryIssues;typeableJS/mimaReportBinaryIssues")
addCommandAlias("testJVM", ";derivingJVM/test;testJVM/test;typeableJVM/test")
addCommandAlias("testJS", ";derivingJS/test;testJS/test;typeableJS/test")

lazy val commonSettings = Seq(
crossScalaVersions := (ThisBuild / crossScalaVersions).value,

scalacOptions ++= Seq(
"-Xfatal-warnings",
"-Yexplicit-nulls"
),
Compile / doc / sources := Nil,

libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
)
// Projects

lazy val root = project
.in(file("."))
Expand All @@ -86,6 +81,7 @@ lazy val deriving = crossProject(JSPlatform, JVMPlatform)
libraryDependencies += "org.typelevel" %%% "cats-core" % "2.6.1" % "test"
)
.settings(commonSettings)
.settings(mimaSettings)
.settings(publishSettings)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))

Expand All @@ -99,6 +95,7 @@ lazy val test = crossProject(JSPlatform, JVMPlatform)
moduleName := "shapeless3-test"
)
.settings(commonSettings)
.settings(mimaSettings)
.settings(publishSettings)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))

Expand All @@ -113,6 +110,7 @@ lazy val typeable = crossProject(JSPlatform, JVMPlatform)
moduleName := "shapeless3-typeable"
)
.settings(commonSettings)
//.settings(mimaSettings) // Not yet
.settings(publishSettings)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))

Expand All @@ -134,6 +132,25 @@ lazy val local = crossProject(JSPlatform, JVMPlatform)
.settings(noPublishSettings)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))

// Settings

lazy val commonSettings = Seq(
crossScalaVersions := (ThisBuild / crossScalaVersions).value,

scalacOptions ++= Seq(
"-Xfatal-warnings",
"-Yexplicit-nulls"
),
Compile / doc / sources := Nil,

libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
)

lazy val mimaSettings = Seq(
mimaPreviousArtifacts := Set("org.typelevel" %% moduleName.value % previousVersion),
mimaBinaryIssueFilters := Seq()
)

lazy val publishSettings: Seq[Setting[_]] = Seq(
Test / publishArtifact := false,
pomIncludeRepository := (_ => false),
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.11.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.9.2")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.5.1")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")

0 comments on commit dcacf4c

Please sign in to comment.