sbt/project/Dependencies.scala

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

136 lines
6.0 KiB
Scala
Raw Normal View History

import sbt.*
import Keys.*
2014-12-18 13:57:05 +01:00
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
2025-02-09 23:33:23 +01:00
val scala213 = "2.13.16"
2025-11-07 23:37:33 +01:00
val scala3 = "3.7.4"
2020-01-10 14:41:55 +01:00
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
2021-12-06 08:06:26 +01:00
val baseScalaVersion = scala3
2020-11-14 04:04:48 +01:00
def nightlyVersion: Option[String] =
sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")
2014-12-18 23:40:20 +01:00
2015-09-14 09:27:22 +02:00
// sbt modules
private val ioVersion = nightlyVersion.getOrElse("1.10.5")
2025-09-29 05:09:07 +02:00
val zincVersion = nightlyVersion.getOrElse("2.0.0-M9")
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
2025-09-13 21:36:09 +02:00
val launcherVersion = "1.5.1"
2018-04-07 00:36:10 +02:00
val launcherInterface = "org.scala-sbt" % "launcher-interface" % launcherVersion
val rawLauncher = "org.scala-sbt" % "launcher" % launcherVersion
val testInterface = "org.scala-sbt" % "test-interface" % "1.0"
val ipcSocket = "org.scala-sbt.ipcsocket" % "ipcsocket" % "1.6.3"
2016-11-23 16:17:34 +01:00
private val compilerInterface = "org.scala-sbt" % "compiler-interface" % zincVersion
private val compilerClasspath = "org.scala-sbt" %% "zinc-classpath" % zincVersion
private val compilerApiInfo = "org.scala-sbt" %% "zinc-apiinfo" % zincVersion
private val zinc = "org.scala-sbt" %% "zinc" % zincVersion
2019-04-18 09:14:04 +02:00
private val zincCompileCore = "org.scala-sbt" %% "zinc-compile-core" % zincVersion
2020-01-10 14:41:55 +01:00
def getSbtModulePath(key: String) = {
val localProps = new java.util.Properties()
IO.load(localProps, file("project/local.properties"))
2020-01-10 14:41:55 +01:00
val path = Option(localProps.getProperty(key)).orElse(sys.props.get(key))
path.foreach(f => println(s"Using $key=$f"))
path
}
2020-01-10 14:41:55 +01:00
lazy val sbtIoPath = getSbtModulePath("sbtio.path")
lazy val sbtUtilPath = getSbtModulePath("sbtutil.path")
lazy val sbtLmPath = getSbtModulePath("sbtlm.path")
lazy val sbtZincPath = getSbtModulePath("sbtzinc.path")
2019-04-18 09:14:04 +02:00
def addSbtModule(
path: Option[String],
projectName: String,
moduleId: ModuleID,
c: Option[Configuration] = None
2020-01-10 14:41:55 +01:00
) = (p: Project) => {
2022-01-17 09:06:08 +01:00
val m0 = moduleId.withConfigurations(c.map(_.name))
2022-01-30 19:23:36 +01:00
val m = m0
path match {
2019-05-13 19:59:58 +02:00
case Some(f) =>
2020-01-10 14:41:55 +01:00
p.dependsOn(ClasspathDependency(ProjectRef(file(f), projectName), c.map(_.name)))
case None => p.settings(libraryDependencies += m, dependencyOverrides += m)
}
2019-04-18 09:14:04 +02:00
}
2020-01-10 14:41:55 +01:00
def addSbtIO = addSbtModule(sbtIoPath, "io", sbtIO)
def addSbtIOForTest = addSbtModule(sbtIoPath, "io", sbtIO, Some(Test))
2022-03-08 18:19:20 +01:00
def addSbtCompilerInterface = addSbtModule(sbtZincPath, "compilerInterface", compilerInterface)
def addSbtCompilerClasspath = addSbtModule(sbtZincPath, "zincClasspath", compilerClasspath)
def addSbtCompilerApiInfo = addSbtModule(sbtZincPath, "zincApiInfo", compilerApiInfo)
def addSbtZinc = addSbtModule(sbtZincPath, "zinc", zinc)
def addSbtZincCompileCore = addSbtModule(sbtZincPath, "zincCompileCore", zincCompileCore)
2020-01-10 14:41:55 +01:00
lazy val sjsonNewVersion = "0.14.0-M5"
2021-12-06 08:06:26 +01:00
def sjsonNew(n: String) = Def.setting(
2022-01-17 08:27:20 +01:00
"com.eed3si9n" %% n % sjsonNewVersion
2021-12-06 08:06:26 +01:00
) // contrabandSjsonNewVersion.value
2020-01-10 14:41:55 +01:00
val sjsonNewScalaJson = sjsonNew("sjson-new-scalajson")
val sjsonNewMurmurhash = sjsonNew("sjson-new-murmurhash")
2021-12-20 08:00:30 +01:00
val sjsonNewCore = sjsonNew("sjson-new-core")
// JLine 3 version must be coordinated together with JAnsi version
// and the JLine 2 fork version, which uses the same JAnsi
2021-12-20 08:00:30 +01:00
val jline =
"org.scala-sbt.jline" % "jline" % "2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18"
2024-10-25 02:51:09 +02:00
val jline3Version = "3.27.1"
val jline3Terminal = "org.jline" % "jline-terminal" % jline3Version
val jline3JNI = "org.jline" % "jline-terminal-jni" % jline3Version
val jline3Native = "org.jline" % "jline-native" % jline3Version
Support scala 2.13 console in thin client In order to make the console task work with scala 2.13 and the thin client, we need to provide a way for the scala repl to use an sbt provided jline3 terminal instead of the default terminal typically built by the repl. We also need to put jline 3 higher up in the classloading hierarchy to ensure that two versions of jline 3 are not loaded (which makes it impossible to share the sbt terminal with the scala terminal). One impact of this change is the decoupling of the version of jline-terminal used by the in process scala console and the version of jline-terminal specified by the scala version itself. It is possible to override this by setting the `useScalaReplJLine` flag to true. When that is set, the scala REPL will run in a fully isolated classloader. That will ensure that the versions are consistent. It will, however, for sure break the thin client and may interfere with the embedded shell ui. As part of this work, I also discovered that jline 3 Terminal.getSize is very slow. In jline 2, the terminal attributes were automatically cached with a timeout of, I think, 1 second so it wasn't a big deal to call Terminal.getAttributes. The getSize method in jline 3 is not cached and it shells out to run a tty command. This caused a significant performance regression in sbt because when progress is enabled, we call Terminal.getSize whenever we log any messages. I added caching of getSize at the TerminalImpl level to address this. The timeout is 1 second, which seems responsive enough for most use cases. We could also move the calculation onto a background thread and have it periodically updated, but that seems like overkill.
2020-07-20 19:12:04 +02:00
val jline3Reader = "org.jline" % "jline-reader" % jline3Version
val jline3Builtins = "org.jline" % "jline-builtins" % jline3Version
2024-10-23 01:56:59 +02:00
val scalatest = "org.scalatest" %% "scalatest" % "3.2.19"
2025-09-13 05:14:15 +02:00
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.19.0"
2025-06-18 00:23:25 +02:00
val junit = "junit" % "junit" % "4.13.2"
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
val remoteapis =
"com.eed3si9n.remoteapis.shaded" % "shaded-remoteapis-java" % "2.3.0-M1-52317e00d8d4c37fa778c628485d220fb68a8d08"
val gson = "com.google.code.gson" % "gson" % "2.13.1"
2016-11-23 16:17:34 +01:00
val scalaCompiler = "org.scala-lang" %% "scala3-compiler" % scala3
val scala3Library = "org.scala-lang" %% "scala3-library" % scala3
2025-06-18 00:23:25 +02:00
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.4.0"
val scalaParsers = "org.scala-lang.modules" %% "scala-parser-combinators" % "2.4.0"
val scalaPar = "org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0"
// specify all of log4j modules to prevent misalignment
def log4jModule = (n: String) => "org.apache.logging.log4j" % n % "2.17.1"
2020-01-10 14:41:55 +01:00
val log4jApi = log4jModule("log4j-api")
val log4jCore = log4jModule("log4j-core")
val log4jSlf4jImpl = log4jModule("log4j-slf4j-impl")
val log4jModules = Vector(log4jApi, log4jCore, log4jSlf4jImpl)
2025-06-29 00:49:42 +02:00
val caffeine = "com.github.ben-manes.caffeine" % "caffeine" % "2.8.5"
2025-09-13 05:14:15 +02:00
val hedgehog = "qa.hedgehog" %% "hedgehog-sbt" % "0.13.0"
val disruptor = "com.lmax" % "disruptor" % "3.4.2"
2025-02-18 10:47:06 +01:00
val ivy = "org.scala-sbt.ivy" % "ivy" % "2.3.0-sbt-77cc781d727b367d3761f097d89f5a4762771d41"
2017-11-14 10:57:29 +01:00
2024-10-09 09:36:37 +02:00
// lm dependencies
2025-08-04 05:00:08 +02:00
val jsch = ("com.github.mwiede" % "jsch" % "0.2.23").intransitive()
val gigahorseApacheHttp = "com.eed3si9n" %% "gigahorse-apache-http" % "0.9.3"
2024-10-09 09:36:37 +02:00
// lm-coursier dependencies
2025-06-18 00:13:27 +02:00
val dataclassScalafixVersion = "0.3.0"
val coursierVersion = "2.1.23"
2024-10-09 09:36:37 +02:00
val coursier = ("io.get-coursier" %% "coursier" % coursierVersion)
.cross(CrossVersion.for3Use2_13)
.exclude("org.codehaus.plexus", "plexus-archiver")
.exclude("org.codehaus.plexus", "plexus-container-default")
2024-10-09 10:48:43 +02:00
val coursierSbtMavenRepo =
("io.get-coursier" %% "coursier-sbt-maven-repository" % coursierVersion)
.cross(CrossVersion.for3Use2_13)
2024-10-09 09:36:37 +02:00
// FIXME Ideally, we should depend on the same version of io.get-coursier.jniutils:windows-jni-utils that
// io.get-coursier::coursier depends on.
val jniUtilsVersion = "0.3.3"
2014-12-18 13:57:05 +01:00
}