From ebe2d37f0cb4b1ceea8143bc95bd782040fd0436 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Fri, 12 Mar 2021 08:57:50 -0800 Subject: [PATCH 1/3] add sbt-version-policy and advance mimaPreviousVersion fixes #497 --- build.sbt | 71 +++++---------------------------------------- build.sh | 2 +- project/plugins.sbt | 1 + 3 files changed, 10 insertions(+), 64 deletions(-) diff --git a/build.sbt b/build.sbt index 200aac178..511d1a688 100644 --- a/build.sbt +++ b/build.sbt @@ -3,6 +3,9 @@ import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType} ThisBuild / startYear := Some(2002) ThisBuild / licenses += (("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))) +ThisBuild / versionScheme := Some("early-semver") +ThisBuild / versionPolicyIntention := Compatibility.BinaryAndSourceCompatible + lazy val configSettings: Seq[Setting[_]] = Seq( unmanagedSourceDirectories ++= { unmanagedSourceDirectories.value.flatMap { dir => @@ -59,74 +62,16 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform) |""".stripMargin)), scalaModuleMimaPreviousVersion := { - if (isDotty.value) None // No such release yet - else Some("1.3.0") + // pending resolution of https://github.com/scalacenter/sbt-version-policy/issues/62 + if (isDotty.value) None + else Some("2.0.0-M5") }, mimaBinaryIssueFilters ++= { import com.typesafe.tools.mima.core._ import com.typesafe.tools.mima.core.ProblemFilters._ Seq( - // scala-xml 1.1.1 deprecated XMLEventReader, so it broke - // binary compatibility for 2.0.0 in the following way: - exclude[MissingClassProblem]("scala.xml.pull.EvComment"), - exclude[MissingClassProblem]("scala.xml.pull.EvComment$"), - exclude[MissingClassProblem]("scala.xml.pull.EvElemEnd"), - exclude[MissingClassProblem]("scala.xml.pull.EvElemEnd$"), - exclude[MissingClassProblem]("scala.xml.pull.EvElemStart"), - exclude[MissingClassProblem]("scala.xml.pull.EvElemStart$"), - exclude[MissingClassProblem]("scala.xml.pull.EvEntityRef"), - exclude[MissingClassProblem]("scala.xml.pull.EvEntityRef$"), - exclude[MissingClassProblem]("scala.xml.pull.EvProcInstr"), - exclude[MissingClassProblem]("scala.xml.pull.EvProcInstr$"), - exclude[MissingClassProblem]("scala.xml.pull.EvText"), - exclude[MissingClassProblem]("scala.xml.pull.EvText$"), - exclude[MissingClassProblem]("scala.xml.pull.ExceptionEvent"), - exclude[MissingClassProblem]("scala.xml.pull.ExceptionEvent$"), - exclude[MissingClassProblem]("scala.xml.pull.ProducerConsumerIterator"), - exclude[MissingClassProblem]("scala.xml.pull.XMLEvent"), - exclude[MissingClassProblem]("scala.xml.pull.XMLEventReader"), - exclude[MissingClassProblem]("scala.xml.pull.XMLEventReader$POISON$"), - exclude[MissingClassProblem]("scala.xml.pull.XMLEventReader$Parser"), - exclude[MissingClassProblem]("scala.xml.pull.package"), - exclude[MissingClassProblem]("scala.xml.pull.package$"), - exclude[MissingTypesProblem]("scala.xml.Atom"), - exclude[MissingTypesProblem]("scala.xml.Comment"), - exclude[MissingTypesProblem]("scala.xml.Document"), - exclude[MissingTypesProblem]("scala.xml.EntityRef"), - exclude[MissingTypesProblem]("scala.xml.PCData"), - exclude[MissingTypesProblem]("scala.xml.ProcInstr"), - exclude[MissingTypesProblem]("scala.xml.SpecialNode"), - exclude[MissingTypesProblem]("scala.xml.Text"), - exclude[MissingTypesProblem]("scala.xml.Unparsed"), - // Miscellaneous deprecations - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp"), - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp$TopIter$"), - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp$Node$"), - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp$Point$"), - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp$TopIter"), - exclude[MissingClassProblem]("scala.xml.dtd.impl.PointedHedgeExp$Node"), - exclude[MissingClassProblem]("scala.xml.dtd.Scanner"), - exclude[MissingClassProblem]("scala.xml.dtd.ContentModelParser$"), - exclude[MissingClassProblem]("scala.xml.dtd.ContentModelParser"), - exclude[MissingClassProblem]("scala.xml.dtd.ElementValidator"), - exclude[MissingClassProblem]("scala.xml.dtd.ElementValidator"), - exclude[MissingClassProblem]("scala.xml.factory.Binder"), - exclude[MissingClassProblem]("scala.xml.parsing.ValidatingMarkupHandler"), - exclude[MissingClassProblem]("scala.xml.persistent.CachedFileStorage"), - exclude[MissingClassProblem]("scala.xml.persistent.Index"), - exclude[MissingClassProblem]("scala.xml.persistent.SetStorage"), - exclude[DirectMissingMethodProblem]("scala.xml.dtd.ContentModel.parse"), - exclude[DirectMissingMethodProblem]("scala.xml.Elem.this"), - exclude[DirectMissingMethodProblem]("scala.xml.Elem.apply"), - exclude[DirectMissingMethodProblem]("scala.xml.Elem.processXml"), - exclude[DirectMissingMethodProblem]("scala.xml.Elem.xmlToProcess"), - // Scala 2.12 deprecated mutable.Stack, so we broke - // binary compatibility for 2.0.0 in the following way: - exclude[IncompatibleMethTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack_="), - exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.hStack"), - exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.scopeStack"), - exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.attribStack"), - exclude[IncompatibleResultTypeProblem]("scala.xml.parsing.FactoryAdapter.tagStack"), + // because we reverted #279 + exclude[DirectMissingMethodProblem]("scala.xml.Utility.escapeText"), // New MiMa checks for generic signature changes exclude[IncompatibleSignatureProblem]("*"), ) diff --git a/build.sh b/build.sh index b5253d68b..373cc1eca 100755 --- a/build.sh +++ b/build.sh @@ -53,4 +53,4 @@ export CI_SNAPSHOT_RELEASE="${projectPrefix}publish" # for now, until we're confident in the new release scripts, just close the staging repo. export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" -sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask +sbt clean ${projectPrefix}test ${projectPrefix}versionPolicyCheck ${projectPrefix}publishLocal $releaseTask diff --git a/project/plugins.sbt b/project/plugins.sbt index 16f79e89f..f3aa6c35e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,3 +11,4 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion) addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion) addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.3") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "1.0.0-RC5") From 5ee7224f81c936d4d1ad801ea1fae7b51263609e Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Sat, 13 Mar 2021 11:34:12 -0800 Subject: [PATCH 2/3] fix versionPolicyCheck on JDK 15 --- build.sbt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sbt b/build.sbt index 511d1a688..cad4936aa 100644 --- a/build.sbt +++ b/build.sbt @@ -74,6 +74,10 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform) exclude[DirectMissingMethodProblem]("scala.xml.Utility.escapeText"), // New MiMa checks for generic signature changes exclude[IncompatibleSignatureProblem]("*"), + // afaict this is just a JDK 8 vs 15 difference, producing a false positive when + // we compare classes built on JDK 15 (which we only do on CI, not at release time) + // to previous-version artifacts that were built on 8. see scala/scala-xml#501 + exclude[DirectMissingMethodProblem]("scala.xml.include.sax.XIncluder.declaration"), ) }, From 5f6b6a0b9261f9b378281c3246ac0eec0f54a5b1 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Sat, 13 Mar 2021 11:40:02 -0800 Subject: [PATCH 3/3] make CircleCI run versionPolicyCheck, too --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 10936d085..290ef709a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -58,7 +58,7 @@ jobs: - run: java -version - sbt_cmd: scala_version: << parameters.scala_version >> - sbt_tasks: xml/update xml/compile xml/test:compile xml/test xml/doc xml/package xml/osgiBundle + sbt_tasks: xml/update xml/compile xml/Test/compile xml/test xml/doc xml/package xml/osgiBundle xml/versionPolicyCheck scalajs_job: executor: scala_jdk8_executor parameters: @@ -78,7 +78,7 @@ jobs: - run: node -v - sbt_cmd: scala_version: << parameters.scala_version >> - sbt_tasks: xmlJS/update xmlJS/compile xmlJS/test:compile xmlJS/test xmlJS/doc xmlJS/package + sbt_tasks: xmlJS/update xmlJS/compile xmlJS/Test/compile xmlJS/test xmlJS/doc xmlJS/package scalanative_job: executor: scala_native_executor parameters: