Skip to content
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 @@ -8,7 +8,7 @@ homepage := scmInfo.value map (_.browseUrl)
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-git"), "scm:git:[email protected]:sbt/sbt-git.git"))

lazy val scala212 = "2.12.20"
lazy val scala3 = "3.6.4"
lazy val scala3 = "3.7.2"

crossScalaVersions := Seq(scala212, scala3)

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

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.11.3
sbt.version=1.11.4
14 changes: 14 additions & 0 deletions src/main/scala-2.12/PluginCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.github.sbt.git

import sbt.*
import scala.annotation.{meta, StaticAnnotation}

private[git] object PluginCompat {
implicit class DefOp(singleton: Def.type) {
def uncached[A1](a: A1): A1 = a
}
@meta.getter
class cacheLevel(
include: Array[String]
) extends StaticAnnotation
}
5 changes: 5 additions & 0 deletions src/main/scala-3/PluginCompat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.github.sbt.git

private[git] object PluginCompat {
type cacheLevel = sbt.util.cacheLevel
}
2 changes: 2 additions & 0 deletions src/main/scala/com/github/sbt/git/GitPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.github.sbt.git

import sbt.*
import Keys.*
import PluginCompat.*

/** This plugin has all the basic 'git' functionality for other plugins. */
object SbtGit {
Expand All @@ -21,6 +22,7 @@ object SbtGit {
val gitUncommittedChanges = SettingKey[Boolean]("git-uncommitted-changes", "Whether there are uncommitted changes.")

// A Mechanism to run Git directly.
@cacheLevel(include = Array.empty)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be an option to use @transient annotation which would be less boilerplate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea - sbt/sbt#8204

val gitRunner = TaskKey[GitRunner]("git-runner", "The mechanism used to run git in the current build.")

// Keys associated with setting a version number.
Expand Down