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

Update sbt 2 up to 2.0.0-M3 #272

Merged
merged 3 commits into from
Dec 19, 2024
Merged
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
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage := scmInfo.value map (_.browseUrl)
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-git"), "scm:git:git@github.com:sbt/sbt-git.git"))

lazy val scala212 = "2.12.20"
lazy val scala3 = "3.3.4"
lazy val scala3 = "3.6.2"

crossScalaVersions := Seq(scala212, scala3)

Expand All @@ -25,7 +25,7 @@ libraryDependencies ++= Seq(
(pluginCrossBuild / sbtVersion) := {
scalaBinaryVersion.value match {
case "2.12" => "1.5.8"
case _ => "2.0.0-M2"
case _ => "2.0.0-M3"
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/main/scala/com/github/sbt/git/GitPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ object SbtGit {

val prompt: State => String = { state =>
val extracted = Project.extract(state)
val reader = extracted get GitKeys.gitReader
val dir = extracted get baseDirectory
val name = extracted get Keys.name
val reader = extracted `get` GitKeys.gitReader
val dir = extracted `get` baseDirectory
val name = extracted `get` Keys.name
if (isGitRepo(dir)) {
val branch = reader.withGit(_.branch)
name + "(" + branch + ")> "
Expand Down Expand Up @@ -284,7 +284,7 @@ object SbtGit {
val formattedDateVersion = ThisBuild / GitKeys.formattedDateVersion

val defaultTagByVersionStrategy: String => Option[String] = { tag =>
if (tag matches "v[0-9].*") Some(tag drop 1)
if (tag `matches` "v[0-9].*") Some(tag drop 1)
else None
}

Expand All @@ -294,8 +294,8 @@ object SbtGit {

def defaultFormatDateVersion(baseVersion: Option[String], date: java.util.Date): String = {
val df = new java.text.SimpleDateFormat("yyyyMMdd'T'HHmmss")
df setTimeZone java.util.TimeZone.getTimeZone("GMT")
baseVersion.map(_ + "-").getOrElse("") + (df format (new java.util.Date))
df.setTimeZone(java.util.TimeZone.getTimeZone("GMT"))
baseVersion.map(_ + "-").getOrElse("") + (df.format(new java.util.Date))
}

def flaggedOptional(flag: Boolean, value: Option[String]): Option[String] =
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/github/sbt/git/JGit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class JGit(val repo: Repository) extends GitReadonlyInterface {
taghash = tagHash(unpeeledTag)
if taghash == hash
ref = unpeeledTag.getName
if ref startsWith "refs/tags/"
if ref `startsWith` "refs/tags/"
} yield ref drop 10
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/github/sbt/git/ReadableGit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ trait GitReadonlyInterface {
final class DefaultReadableGit(base: sbt.File, gitOverride: Option[GitReadonlyInterface]) extends ReadableGit {
// TODO - Should we cache git, or just create on each request?
// For now, let's cache.
private[this] val git = gitOverride getOrElse JGit(base)
private val git = gitOverride getOrElse JGit(base)
/** Use the git read-only interface. */
def withGit[A](f: GitReadonlyInterface => A): A =
// JGit has concurrency issues so we synchronize access to it.
Expand Down
Loading