Merge pull request #8119 from eed3si9n/wip/scala-3.7.0

[2.x] deps: Scala 3.7.0
This commit is contained in:
eugene yokota 2025-05-10 22:48:22 -07:00 committed by GitHub
commit c2bd256301
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 25 additions and 20 deletions

View File

@ -38,7 +38,7 @@ class CacheIvyTest extends Properties("CacheIvy") {
content = converter.toJsonUnsafe(value)
}
private def testCache[T: JsonFormat, U](
private def testCache[T, U](
f: (SingletonCache[T], CacheStore) => U
)(using cache: SingletonCache[T]): U = {
val store = new InMemoryStore(Converter)

View File

@ -298,7 +298,7 @@ object Def extends BuildSyntax with Init with InitializeImplicits:
)
}
inline def cachedTask[A1: JsonFormat](inline a1: A1): Def.Initialize[Task[A1]] =
inline def cachedTask[A1](inline a1: A1): Def.Initialize[Task[A1]] =
${ TaskMacro.taskMacroImpl[A1]('a1, cached = true) }
inline def task[A1](inline a1: A1): Def.Initialize[Task[A1]] =

View File

@ -165,8 +165,7 @@ object Compiler:
state: State,
topLoader: ClassLoader,
): ScalaInstance =
import sbt.State.*
val classLoaderCache = state.extendedClassLoaderCache
val classLoaderCache = State.StateOpsImpl(state).extendedClassLoaderCache
val compilerJars = allCompilerJars.filterNot(libraryJars.contains).distinct.toArray
val docJars = allDocJars
.filterNot(jar => libraryJars.contains(jar) || compilerJars.contains(jar))

View File

@ -27,12 +27,10 @@ private[sbt] object InMemoryCacheStore {
.maximumWeight(maxSize)
.weigher(weigher)
.build()
def get[T](path: Path): Option[(T, Long)] = {
files.getIfPresent(path) match {
case null => None
case (value: T @unchecked, lastModified, _) => Some((value, lastModified))
}
}
def get[A1](path: Path): Option[(A1, Long)] =
files.getIfPresent(path) match
case null => None
case (value, lastModified, _) => Some((value.asInstanceOf[A1], lastModified))
def put(path: Path, value: Any, lastModified: Long): Unit = {
try {
if (lastModified > 0) {

View File

@ -4,7 +4,7 @@ import Keys.*
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
val scala213 = "2.13.16"
val scala3 = "3.6.4"
val scala3 = "3.7.0"
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
val baseScalaVersion = scala3
def nightlyVersion: Option[String] =

View File

@ -5,7 +5,7 @@ import complete.Parser
val runFoo = inputKey[Unit]("Runs Foo with passed arguments")
val check = taskKey[Unit]("")
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
lazy val root = (project in file(".")).
settings(

View File

@ -4,7 +4,7 @@ lazy val checkMiss = taskKey[Unit]("")
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
checkMiss := {
val s = streams.value
val config = Def.cacheConfiguration.value

View File

@ -5,7 +5,7 @@ lazy val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
Global / localCacheDirectory := baseDirectory.value / "diskcache"
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
libraryDependencies += verify % Test
testFrameworks += new TestFramework("verify.runner.Framework")

View File

@ -1,6 +1,6 @@
lazy val a1 = settingKey[Boolean]("")
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
a1 := true
Compile / sourceGenerators += {

View File

@ -1,3 +1,3 @@
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
libraryDependencies += "com.eed3si9n.verify" %% "verify" % "1.0.0" % Test
testFrameworks += new TestFramework("verify.runner.Framework")

View File

@ -1,4 +1,4 @@
scalaVersion := "3.6.4"
scalaVersion := "3.7.0"
TaskKey[Unit]("willSucceed") := println("success")

View File

@ -9,6 +9,7 @@
package sbt
package std
import scala.annotation.nowarn
import scala.sys.process.{ BasicIO, ProcessIO, ProcessBuilder }
import sbt.internal.util.AttributeMap
@ -205,7 +206,10 @@ trait TaskExtra extends TaskExtra0 {
extension [Key](
in: Task[?]
)(using streams: Task[TaskStreams[Key]], key: Task[?] => Key) {
)(using
@nowarn("msg=unused") streams: Task[TaskStreams[Key]],
@nowarn("msg=unused") key: Task[?] => Key
) {
def binary[T](f: BufferedInputStream => T): Task[T] = pipeBinary(None, f)
def binary[T](sid: String)(f: BufferedInputStream => T): Task[T] = pipeBinary(Some(sid), f)

View File

@ -34,7 +34,7 @@ object ActionCache:
* - config: The configuration that's used to store where the cache backends are.
* - action: The actual action to be cached.
*/
def cache[I: HashWriter, O: JsonFormat: ClassTag](
def cache[I: HashWriter, O: JsonFormat](
key: I,
codeContentHash: Digest,
extraHash: Digest,
@ -81,7 +81,7 @@ object ActionCache:
/**
* Retrieves the cached value.
*/
def get[I: HashWriter, O: JsonFormat: ClassTag](
def get[I: HashWriter, O: JsonFormat](
key: I,
codeContentHash: Digest,
extraHash: Digest,

View File

@ -12,6 +12,7 @@ import scala.util.Try
import sjsonnew.JsonFormat
import sjsonnew.support.murmurhash.Hasher
import scala.annotation.nowarn
import CacheImplicits.*
@ -37,6 +38,7 @@ object SingletonCache {
}
/** A lazy `SingletonCache` */
@nowarn("msg=unused")
def lzy[A: JsonFormat](mkCache: => SingletonCache[A]): SingletonCache[A] =
new SingletonCache[A] {
lazy val cache = mkCache

View File

@ -16,6 +16,7 @@ import sbt.internal.util.EmptyCacheError
import sjsonnew.{ JsonFormat, JsonWriter }
import sjsonnew.support.murmurhash.Hasher
import scala.annotation.nowarn
object Tracked {
@ -199,6 +200,7 @@ object Tracked {
* cachedDoc(inputs)(() => exists(outputDirectory.allPaths.get.toSet))
* }}}
*/
@nowarn("msg=unused")
def inputChanged[I: JsonFormat: SingletonCache, O](store: CacheStore)(
f: (Boolean, I) => O
): I => O =