Skip to content

Commit 1d95a66

Browse files
committed
sbt 2.0.0-RC2
1 parent 80b265e commit 1d95a66

File tree

8 files changed

+23
-13
lines changed

8 files changed

+23
-13
lines changed

build.sbt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ThisBuild / version := {
66
if (orig.endsWith("-SNAPSHOT")) "0.11.0-SNAPSHOT"
77
else orig
88
}
9-
val scala3 = "3.6.4"
9+
val scala3 = "3.7.2"
1010
ThisBuild / scalaVersion := scala3
1111

1212
lazy val root = (project in file("."))
@@ -32,13 +32,13 @@ lazy val root = (project in file("."))
3232
(pluginCrossBuild / sbtVersion) := {
3333
scalaBinaryVersion.value match {
3434
case "2.12" => "1.5.8"
35-
case _ => "2.0.0-M4"
35+
case _ => "2.0.0-RC2"
3636
}
3737
},
3838
scriptedSbt := {
3939
scalaBinaryVersion.value match {
4040
case "2.12" => "1.10.7"
41-
case _ => "2.0.0-M4"
41+
case _ => "2.0.0-RC2"
4242
}
4343
},
4444
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.10
1+
sbt.version=1.11.4

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.3")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")

src/main/scala-2.12/sbtbuildinfo/PluginCompat.scala

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package sbtbuildinfo
33
import java.nio.file.{ Path => NioPath }
44
import sbt.*
55
import scala.language.higherKinds
6-
import scala.annotation.nowarn
6+
import scala.annotation.{ meta, nowarn, StaticAnnotation }
77

88
object PluginCompat {
99
type FileRef = java.io.File
@@ -51,4 +51,11 @@ object PluginCompat {
5151
def flatMapN[R](f: (A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) => Task[R]) =
5252
taskable.flatMap(f)
5353
}
54+
implicit class DefOp(singleton: Def.type) {
55+
def uncached[A1](a: A1): A1 = a
56+
}
57+
@meta.getter
58+
class cacheLevel(
59+
include: Array[String]
60+
) extends StaticAnnotation
5461
}

src/main/scala/sbtbuildinfo/BuildInfoKeys.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package sbtbuildinfo
22

3-
import sbt._
3+
import sbt.*
44

55
trait BuildInfoKeys {
66
lazy val buildInfo = taskKey[Seq[File]]("The task that generates the build info.")

src/main/scala/sbtbuildinfo/BuildInfoPlugin.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import sbt._, Keys._
44
import java.io.File
55
import PluginCompat.*
66
import sbt.Plugins.Basic
7+
import sbt.util.CacheImplicits.given
78

89
object BuildInfoPlugin extends AutoPlugin {
910
type BuildInfoKey = PluginCompat.Entry[_]
@@ -61,7 +62,7 @@ object BuildInfoPlugin extends AutoPlugin {
6162
import TupleSyntax._
6263

6364
def buildInfoScopedSettings(conf: Configuration): Seq[Def.Setting[_]] = inConfig(conf)(Seq(
64-
buildInfo := (
65+
buildInfo := Def.uncached((
6566
RichRichTaskable11((
6667
buildInfoRenderer,
6768
sourceManaged,
@@ -102,12 +103,12 @@ object BuildInfoPlugin extends AutoPlugin {
102103
}
103104
BuildInfo(dir, renderer, obj, keys, opts, pr, s, taskStreams.cacheDirectory) map (Seq(_))
104105
}
105-
).value,
106-
buildInfoValues := (
106+
).value),
107+
buildInfoValues := Def.uncached((
107108
RichRichTaskable4((buildInfoKeys, buildInfoOptions, thisProjectRef, state)).flatMapN ((keys, opts, pr, s) =>
108109
BuildInfo.results(keys, opts, pr, s)
109110
)
110-
).value,
111+
).value),
111112

112113
sourceGenerators ++= (if (buildInfoRenderer.value.isSource) Seq(buildInfo.taskValue) else Nil),
113114
resourceGenerators ++= (if (buildInfoRenderer.value.isResource) Seq(buildInfo.taskValue) else Nil),

src/sbt-test/sbt-buildinfo/gh211/build.sbt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import sbtbuildinfo.PluginCompat.*
2+
13
lazy val check = taskKey[Unit]("checks this plugin")
24

35
lazy val a1 = project.settings(scalaVersion := "2.13.15")
@@ -11,12 +13,11 @@ lazy val a3 = project
1113
BuildInfoKey.map((a1 / scalaVersion): SettingKey[String])("scalaVersion_a1" -> _._2),
1214
BuildInfoKey.map((a2 / scalaVersion): SettingKey[String])("scalaVersion_a2" -> _._2),
1315
),
14-
check := {
16+
check := Def.uncached {
1517
val sv = scalaVersion.value
1618
val _ = (Compile / compile).value
1719
val f = (Compile / sourceManaged).value / "sbt-buildinfo" / ("BuildInfo.scala")
1820
val lines = scala.io.Source.fromFile(f).getLines.toList
19-
2021
assert(lines.contains(" val scalaVersion_a2: String = \"3.3.4\""), lines.toString)
2122
},
2223
)

src/sbt-test/sbt-buildinfo/simple/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ lazy val root = (project in file("."))
1414
TaskKey[Classpath]("someCp") := {
1515
val c0 = fileConverter.value
1616
implicit val c: xsbti.FileConverter = c0
17+
IO.touch(file("/tmp/f.txt"))
1718
PluginCompat.toClasspath(Vector(file("/tmp/f.txt").toPath()))
1819
},
1920
buildInfoKeys := Seq[BuildInfoKey](

0 commit comments

Comments
 (0)