Skip to content

Commit

Permalink
Support Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Tyley authored and rtyley committed Nov 2, 2023
1 parent b33f74c commit b90b81d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import ReleaseTransformations._
import Dependencies._

lazy val baseSettings = Seq(
scalaVersion := "2.13.10",
crossScalaVersions := Seq(scalaVersion.value),
crossScalaVersions := Seq(scalaVersion.value, "3.2.1"),
organization := "com.madgag.scala-git",
scmInfo := Some(ScmInfo(
url("https://github.com/rtyley/scala-git"),
"scm:git:git@github.com:rtyley/scala-git.git"
)),
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
scalacOptions ++= Seq("-deprecation", "-unchecked")
scalacOptions ++= Seq("-deprecation", "-unchecked"),
libraryDependencies ++= Seq(madgagCompress % Test, scalatest % Test)
)

lazy val `scala-git` = project.settings(baseSettings: _*).dependsOn(`scala-git-test` % Test)
Expand Down
4 changes: 2 additions & 2 deletions scala-git/src/main/scala/com/madgag/diff/MapDiff.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.madgag.diff

import com.madgag.scala.collection.decorators.MapDecorator
import com.madgag.scala.collection.decorators._

object MapDiff {
def apply[K,V](before: Map[K,V], after: Map[K,V]): MapDiff[K,V] =
Expand All @@ -12,7 +12,7 @@ case class MapDiff[K, V](beforeAndAfter: Map[BeforeAndAfter, Map[K,V]]) {
lazy val commonElements: Set[K] = beforeAndAfter.values.map(_.keySet).reduce(_ intersect _)

lazy val only: Map[BeforeAndAfter, Map[K,V]] =
beforeAndAfter.mapV(_.view.filterKeys(!commonElements(_)).toMap)
beforeAndAfter.mapV(_.view.filterKeys(!commonElements(_)).toMap).toMap

lazy val (unchanged, changed) =
commonElements.partition(k => beforeAndAfter(Before)(k) == beforeAndAfter(After)(k))
Expand Down

0 comments on commit b90b81d

Please sign in to comment.