mirror of https://github.com/sbt/sbt.git
Merge pull request #8119 from eed3si9n/wip/scala-3.7.0
[2.x] deps: Scala 3.7.0
This commit is contained in:
commit
c2bd256301
|
|
@ -38,7 +38,7 @@ class CacheIvyTest extends Properties("CacheIvy") {
|
||||||
content = converter.toJsonUnsafe(value)
|
content = converter.toJsonUnsafe(value)
|
||||||
}
|
}
|
||||||
|
|
||||||
private def testCache[T: JsonFormat, U](
|
private def testCache[T, U](
|
||||||
f: (SingletonCache[T], CacheStore) => U
|
f: (SingletonCache[T], CacheStore) => U
|
||||||
)(using cache: SingletonCache[T]): U = {
|
)(using cache: SingletonCache[T]): U = {
|
||||||
val store = new InMemoryStore(Converter)
|
val store = new InMemoryStore(Converter)
|
||||||
|
|
|
||||||
|
|
@ -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) }
|
${ TaskMacro.taskMacroImpl[A1]('a1, cached = true) }
|
||||||
|
|
||||||
inline def task[A1](inline a1: A1): Def.Initialize[Task[A1]] =
|
inline def task[A1](inline a1: A1): Def.Initialize[Task[A1]] =
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,7 @@ object Compiler:
|
||||||
state: State,
|
state: State,
|
||||||
topLoader: ClassLoader,
|
topLoader: ClassLoader,
|
||||||
): ScalaInstance =
|
): ScalaInstance =
|
||||||
import sbt.State.*
|
val classLoaderCache = State.StateOpsImpl(state).extendedClassLoaderCache
|
||||||
val classLoaderCache = state.extendedClassLoaderCache
|
|
||||||
val compilerJars = allCompilerJars.filterNot(libraryJars.contains).distinct.toArray
|
val compilerJars = allCompilerJars.filterNot(libraryJars.contains).distinct.toArray
|
||||||
val docJars = allDocJars
|
val docJars = allDocJars
|
||||||
.filterNot(jar => libraryJars.contains(jar) || compilerJars.contains(jar))
|
.filterNot(jar => libraryJars.contains(jar) || compilerJars.contains(jar))
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,10 @@ private[sbt] object InMemoryCacheStore {
|
||||||
.maximumWeight(maxSize)
|
.maximumWeight(maxSize)
|
||||||
.weigher(weigher)
|
.weigher(weigher)
|
||||||
.build()
|
.build()
|
||||||
def get[T](path: Path): Option[(T, Long)] = {
|
def get[A1](path: Path): Option[(A1, Long)] =
|
||||||
files.getIfPresent(path) match {
|
files.getIfPresent(path) match
|
||||||
case null => None
|
case null => None
|
||||||
case (value: T @unchecked, lastModified, _) => Some((value, lastModified))
|
case (value, lastModified, _) => Some((value.asInstanceOf[A1], lastModified))
|
||||||
}
|
|
||||||
}
|
|
||||||
def put(path: Path, value: Any, lastModified: Long): Unit = {
|
def put(path: Path, value: Any, lastModified: Long): Unit = {
|
||||||
try {
|
try {
|
||||||
if (lastModified > 0) {
|
if (lastModified > 0) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import Keys.*
|
||||||
object Dependencies {
|
object Dependencies {
|
||||||
// WARNING: Please Scala update versions in PluginCross.scala too
|
// WARNING: Please Scala update versions in PluginCross.scala too
|
||||||
val scala213 = "2.13.16"
|
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 checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
|
||||||
val baseScalaVersion = scala3
|
val baseScalaVersion = scala3
|
||||||
def nightlyVersion: Option[String] =
|
def nightlyVersion: Option[String] =
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import complete.Parser
|
||||||
val runFoo = inputKey[Unit]("Runs Foo with passed arguments")
|
val runFoo = inputKey[Unit]("Runs Foo with passed arguments")
|
||||||
val check = taskKey[Unit]("")
|
val check = taskKey[Unit]("")
|
||||||
|
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
|
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
settings(
|
settings(
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ lazy val checkMiss = taskKey[Unit]("")
|
||||||
|
|
||||||
Global / localCacheDirectory := baseDirectory.value / "diskcache"
|
Global / localCacheDirectory := baseDirectory.value / "diskcache"
|
||||||
|
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
checkMiss := {
|
checkMiss := {
|
||||||
val s = streams.value
|
val s = streams.value
|
||||||
val config = Def.cacheConfiguration.value
|
val config = Def.cacheConfiguration.value
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ lazy val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
|
||||||
|
|
||||||
Global / localCacheDirectory := baseDirectory.value / "diskcache"
|
Global / localCacheDirectory := baseDirectory.value / "diskcache"
|
||||||
|
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
libraryDependencies += verify % Test
|
libraryDependencies += verify % Test
|
||||||
testFrameworks += new TestFramework("verify.runner.Framework")
|
testFrameworks += new TestFramework("verify.runner.Framework")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
lazy val a1 = settingKey[Boolean]("")
|
lazy val a1 = settingKey[Boolean]("")
|
||||||
|
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
a1 := true
|
a1 := true
|
||||||
|
|
||||||
Compile / sourceGenerators += {
|
Compile / sourceGenerators += {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
libraryDependencies += "com.eed3si9n.verify" %% "verify" % "1.0.0" % Test
|
libraryDependencies += "com.eed3si9n.verify" %% "verify" % "1.0.0" % Test
|
||||||
testFrameworks += new TestFramework("verify.runner.Framework")
|
testFrameworks += new TestFramework("verify.runner.Framework")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
scalaVersion := "3.6.4"
|
scalaVersion := "3.7.0"
|
||||||
|
|
||||||
TaskKey[Unit]("willSucceed") := println("success")
|
TaskKey[Unit]("willSucceed") := println("success")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
package sbt
|
package sbt
|
||||||
package std
|
package std
|
||||||
|
|
||||||
|
import scala.annotation.nowarn
|
||||||
import scala.sys.process.{ BasicIO, ProcessIO, ProcessBuilder }
|
import scala.sys.process.{ BasicIO, ProcessIO, ProcessBuilder }
|
||||||
|
|
||||||
import sbt.internal.util.AttributeMap
|
import sbt.internal.util.AttributeMap
|
||||||
|
|
@ -205,7 +206,10 @@ trait TaskExtra extends TaskExtra0 {
|
||||||
|
|
||||||
extension [Key](
|
extension [Key](
|
||||||
in: Task[?]
|
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](f: BufferedInputStream => T): Task[T] = pipeBinary(None, f)
|
||||||
def binary[T](sid: String)(f: BufferedInputStream => T): Task[T] = pipeBinary(Some(sid), f)
|
def binary[T](sid: String)(f: BufferedInputStream => T): Task[T] = pipeBinary(Some(sid), f)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ object ActionCache:
|
||||||
* - config: The configuration that's used to store where the cache backends are.
|
* - config: The configuration that's used to store where the cache backends are.
|
||||||
* - action: The actual action to be cached.
|
* - action: The actual action to be cached.
|
||||||
*/
|
*/
|
||||||
def cache[I: HashWriter, O: JsonFormat: ClassTag](
|
def cache[I: HashWriter, O: JsonFormat](
|
||||||
key: I,
|
key: I,
|
||||||
codeContentHash: Digest,
|
codeContentHash: Digest,
|
||||||
extraHash: Digest,
|
extraHash: Digest,
|
||||||
|
|
@ -81,7 +81,7 @@ object ActionCache:
|
||||||
/**
|
/**
|
||||||
* Retrieves the cached value.
|
* Retrieves the cached value.
|
||||||
*/
|
*/
|
||||||
def get[I: HashWriter, O: JsonFormat: ClassTag](
|
def get[I: HashWriter, O: JsonFormat](
|
||||||
key: I,
|
key: I,
|
||||||
codeContentHash: Digest,
|
codeContentHash: Digest,
|
||||||
extraHash: Digest,
|
extraHash: Digest,
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import scala.util.Try
|
||||||
|
|
||||||
import sjsonnew.JsonFormat
|
import sjsonnew.JsonFormat
|
||||||
import sjsonnew.support.murmurhash.Hasher
|
import sjsonnew.support.murmurhash.Hasher
|
||||||
|
import scala.annotation.nowarn
|
||||||
|
|
||||||
import CacheImplicits.*
|
import CacheImplicits.*
|
||||||
|
|
||||||
|
|
@ -37,6 +38,7 @@ object SingletonCache {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A lazy `SingletonCache` */
|
/** A lazy `SingletonCache` */
|
||||||
|
@nowarn("msg=unused")
|
||||||
def lzy[A: JsonFormat](mkCache: => SingletonCache[A]): SingletonCache[A] =
|
def lzy[A: JsonFormat](mkCache: => SingletonCache[A]): SingletonCache[A] =
|
||||||
new SingletonCache[A] {
|
new SingletonCache[A] {
|
||||||
lazy val cache = mkCache
|
lazy val cache = mkCache
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import sbt.internal.util.EmptyCacheError
|
||||||
|
|
||||||
import sjsonnew.{ JsonFormat, JsonWriter }
|
import sjsonnew.{ JsonFormat, JsonWriter }
|
||||||
import sjsonnew.support.murmurhash.Hasher
|
import sjsonnew.support.murmurhash.Hasher
|
||||||
|
import scala.annotation.nowarn
|
||||||
|
|
||||||
object Tracked {
|
object Tracked {
|
||||||
|
|
||||||
|
|
@ -199,6 +200,7 @@ object Tracked {
|
||||||
* cachedDoc(inputs)(() => exists(outputDirectory.allPaths.get.toSet))
|
* cachedDoc(inputs)(() => exists(outputDirectory.allPaths.get.toSet))
|
||||||
* }}}
|
* }}}
|
||||||
*/
|
*/
|
||||||
|
@nowarn("msg=unused")
|
||||||
def inputChanged[I: JsonFormat: SingletonCache, O](store: CacheStore)(
|
def inputChanged[I: JsonFormat: SingletonCache, O](store: CacheStore)(
|
||||||
f: (Boolean, I) => O
|
f: (Boolean, I) => O
|
||||||
): I => O =
|
): I => O =
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue