diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebb767f8..6304f3c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,7 +61,7 @@ jobs: - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck - - run: sbt ++${{ matrix.scala }} test doc + - run: sbt ++${{ matrix.scala }} test mimaReportBinaryIssues doc - name: Compress target directories run: tar cf targets.tar target core/js/target core/jvm/target aws-java-sdk2/target project/target diff --git a/build.sbt b/build.sbt index 84464708..0826afc2 100644 --- a/build.sbt +++ b/build.sbt @@ -1,4 +1,3 @@ -lazy val primaryName = "fs2-aws" lazy val fs2Version = "3.2.7" inThisBuild(List( @@ -18,7 +17,7 @@ inThisBuild(List( startYear := Option(2018), resolvers += Resolver.sonatypeRepo("releases"), - githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "doc"))), + githubWorkflowBuild := Seq(WorkflowStep.Sbt(List("test", "mimaReportBinaryIssues", "doc"))), githubWorkflowJavaVersions := Seq(JavaSpec.temurin("8"), JavaSpec.temurin("11")), githubWorkflowTargetTags ++= Seq("v*"), githubWorkflowPublishTargetBranches := @@ -34,6 +33,7 @@ inThisBuild(List( ) ) ), + localMimaPreviousVersions := Set("3.0.0-RC1"), )) lazy val compilerOptions = Seq( @@ -54,27 +54,23 @@ lazy val compilerOptions = Seq( }, ) -lazy val fs2Utils = crossProject(JSPlatform, JVMPlatform) +lazy val `fs2-utils` = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Full) .in(file("core")) .settings(compilerOptions: _*) .settings( - name := "fs2-utils", description := "Helpful utility functions for fs2 streams", libraryDependencies ++= Seq( "co.fs2" %%% "fs2-core" % fs2Version, "org.scalameta" %%% "munit" % "0.7.29" % Test, "com.eed3si9n.expecty" %%% "expecty" % "0.15.4" % Test, "org.typelevel" %%% "munit-cats-effect-3" % "1.0.7" % Test, - ) + ), ) -lazy val fs2UtilsJVM = fs2Utils.jvm - -lazy val fs2Aws2Utils = (project in file("aws-java-sdk2")) +lazy val `fs2-aws-java-sdk2` = (project in file("aws-java-sdk2")) .settings(compilerOptions: _*) .settings( - name := primaryName + "-java-sdk2", description := "Utility classes for interacting with the V2 AWS Java SDKs from Scala using fs2", libraryDependencies ++= { Seq( @@ -89,5 +85,6 @@ lazy val fs2Aws2Utils = (project in file("aws-java-sdk2")) lazy val `fs2-aws` = (project in file(".")) .settings( publish / skip := true, + publishArtifact := false, ) - .aggregate(fs2UtilsJVM, fs2Utils.js, fs2Aws2Utils) + .aggregate(`fs2-utils`.jvm, `fs2-utils`.js, `fs2-aws-java-sdk2`) diff --git a/project/LocalMimaSettings.scala b/project/LocalMimaSettings.scala new file mode 100644 index 00000000..30ec6d46 --- /dev/null +++ b/project/LocalMimaSettings.scala @@ -0,0 +1,29 @@ +import com.typesafe.tools.mima.plugin.MimaPlugin +import sbt._ +import sbt.Keys._ + +object LocalMimaSettings extends AutoPlugin { + override def requires = MimaPlugin + override def trigger = allRequirements + + object autoImport { + lazy val localMimaPreviousVersions = settingKey[Set[String]]("A set of previous versions to compare binary-compatibility against") + } + + import autoImport._ + import MimaPlugin.autoImport._ + + override def projectSettings = Seq[Setting[_]]( + mimaPreviousArtifacts := { + if (publishArtifact.value) + localMimaPreviousVersions.value.map { + projectID + .value + .withRevision(_) + .withExplicitArtifacts(Vector.empty) + } + else + Set.empty + }, + ) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 86c128bc..dd2dd79c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,5 +5,6 @@ addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.3.1") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0") addSbtPlugin("org.scalablytyped.converter" % "sbt-converter" % "1.0.0-beta37")