Skip to content

Commit

Permalink
project: fix mima issues
Browse files Browse the repository at this point in the history
  • Loading branch information
etorreborre committed Jun 21, 2022
1 parent 3fbbc14 commit a2af5f5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ lazy val rootSettings =
Compile / doc / sources := sources.all(aggregateCompile).value.flatten,
packagedArtifacts := Map.empty,
test := {},
mimaPreviousArtifacts := Set(),
mimaFailOnNoPrevious := false
)

Expand All @@ -72,8 +73,9 @@ lazy val commonSettings =

lazy val mimaSettings =
Seq(
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "5.0.0-RC-23"),
mimaFailOnNoPrevious := false
mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "5.0.0"),
mimaFailOnNoPrevious := false,
mimaBinaryIssueFilters := Mima.excluded
)

lazy val commonJvmSettings =
Expand Down
8 changes: 4 additions & 4 deletions html/src/main/scala/org/specs2/html/Htmlx.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.specs2
package html

import io.*
import scala.xml.*
import scala.xml.*, NodeSeq.*
import transform.RewriteRule
import org.specs2.fp.*, Tree.*
import xml.Nodex.{given, *}
Expand Down Expand Up @@ -31,21 +31,21 @@ trait Htmlx:

extension (ns: Seq[Node])(using nothing: Int = 0)
def updateHead(f: PartialFunction[Node, Node]): NodeSeq =
outer.updateHeadNode(ns)(f)
outer.updateHead(fromSeq(ns))(f)

def updateHeadAttribute(name: String, value: String): NodeSeq =
outer.updateHeadAttribute(ns, name, value)

/** @return a NodeSeq where the first Node is updated with a partial function */
def updateHeadNode(ns: NodeSeq)(f: PartialFunction[Node, Node]): NodeSeq =
def updateHead(ns: NodeSeq)(f: PartialFunction[Node, Node]): NodeSeq =
(ns.toList match {
case (e: Node) :: rest if f.isDefinedAt(e) => f(e) :: rest
case other => other
}).reduceNodes

/** @return a NodeSeq where the first Node attribute named 'named' has a new value */
def updateHeadAttribute(ns: NodeSeq, name: String, value: String): NodeSeq =
updateHeadNode(ns) { case (e: Elem) => e % (name -> value) }
updateHead(ns) { case (e: Elem) => e % (name -> value) }

/** @return a NodeSeq where the first Node attribute named 'named' has a new value, from an Int */
def updateHeadAttribute(ns: NodeSeq, name: String, value: Int): NodeSeq =
Expand Down
2 changes: 1 addition & 1 deletion junit/src/main/scala/org/specs2/runner/JUnitRunner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class JUnitRunner(klass: Class[?]) extends org.junit.runner.Runner with Filterab
lazy val env: Env =
EnvDefault.create(arguments)

lazy val getDescription: org.junit.runner.Description =
def getDescription(): org.junit.runner.Description =
getDescription(env)

def getDescription(env: Env): org.junit.runner.Description =
Expand Down
10 changes: 10 additions & 0 deletions project/mima.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import com.typesafe.tools.mima.core._
import com.typesafe.tools.mima.core.ProblemFilters._

object Mima {

lazy val excluded = Seq(
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.specs2.specification.dsl.mutable.ReferenceDsl.org$specs2$specification$dsl$mutable$ReferenceDsl$$super$~"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("org.specs2.specification.dsl.mutable.ReferenceDsl.org$specs2$specification$dsl$mutable$ReferenceDsl$$super$~/")
)
}

0 comments on commit a2af5f5

Please sign in to comment.