Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Scala 3 #10

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:[email protected]: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
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import sbt._

object Dependencies {

val jgit = "org.eclipse.jgit" % "org.eclipse.jgit" % "6.4.0.202211300538-r"
val jgit = "org.eclipse.jgit" % "org.eclipse.jgit" % "6.7.0.202309050840-r"

val scalatest = "org.scalatest" %% "scalatest" % "3.2.14"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.15"

val madgagCompress = "com.madgag" % "util-compress" % "1.35"

val guava = Seq("com.google.guava" % "guava" % "31.1-jre", "com.google.code.findbugs" % "jsr305" % "2.0.1")
val guava = Seq("com.google.guava" % "guava" % "31.1-jre", "com.google.code.findbugs" % "jsr305" % "3.0.2")

}
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.8.0
sbt.version=1.9.7
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.15")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
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
4 changes: 2 additions & 2 deletions scala-git/src/main/scala/com/madgag/git/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ package object git {
(revWalk, revWalk.getObjectReader)
}

def nonSymbolicRefs = repo.getAllRefs.asScala.values.filterNot(_.isSymbolic)
def nonSymbolicRefs = repo.getRefDatabase.getRefs.asScala.filterNot(_.isSymbolic).toSeq

}

Expand Down Expand Up @@ -172,7 +172,7 @@ package object git {
implicit class RichRevObject(revObject: RevObject) {
lazy val typeString = Constants.typeString(revObject.getType)

def toTree(implicit revWalk: RevWalk): Option[RevTree] = treeOrBlobPointedToBy(revObject).right.toOption
def toTree(implicit revWalk: RevWalk): Option[RevTree] = treeOrBlobPointedToBy(revObject).toOption
}

val FileModeNames = Map(
Expand Down
Loading