diff --git a/build.sbt b/build.sbt index 780f5bb..dd5db8c 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,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.6.4" +lazy val scala3 = "3.7.2" crossScalaVersions := Seq(scala212, scala3) @@ -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" } } diff --git a/project/build.properties b/project/build.properties index c02c575..489e0a7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.11.3 +sbt.version=1.11.4 diff --git a/src/main/scala-2.12/PluginCompat.scala b/src/main/scala-2.12/PluginCompat.scala new file mode 100644 index 0000000..9edfff8 --- /dev/null +++ b/src/main/scala-2.12/PluginCompat.scala @@ -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 +} diff --git a/src/main/scala-3/PluginCompat.scala b/src/main/scala-3/PluginCompat.scala new file mode 100644 index 0000000..63840dc --- /dev/null +++ b/src/main/scala-3/PluginCompat.scala @@ -0,0 +1,5 @@ +package com.github.sbt.git + +private[git] object PluginCompat { + type cacheLevel = sbt.util.cacheLevel +} diff --git a/src/main/scala/com/github/sbt/git/GitPlugin.scala b/src/main/scala/com/github/sbt/git/GitPlugin.scala index fe763d7..8ca36b6 100644 --- a/src/main/scala/com/github/sbt/git/GitPlugin.scala +++ b/src/main/scala/com/github/sbt/git/GitPlugin.scala @@ -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 { @@ -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) val gitRunner = TaskKey[GitRunner]("git-runner", "The mechanism used to run git in the current build.") // Keys associated with setting a version number.