2014-12-18 13:57:05 +01:00
|
|
|
import sbt._
|
|
|
|
|
import Keys._
|
2017-07-01 04:08:30 +02:00
|
|
|
import sbt.contraband.ContrabandPlugin.autoImport._
|
2014-12-18 13:57:05 +01:00
|
|
|
|
|
|
|
|
object Dependencies {
|
2018-02-06 17:02:45 +01:00
|
|
|
// WARNING: Please Scala update versions in PluginCross.scala too
|
2024-09-02 19:41:09 +02:00
|
|
|
val scala212 = "2.12.20"
|
2025-02-09 23:33:23 +01:00
|
|
|
val scala213 = "2.13.16"
|
2020-01-10 14:41:55 +01:00
|
|
|
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
|
2017-01-15 07:44:05 +01:00
|
|
|
val baseScalaVersion = scala212
|
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
|
2025-03-17 02:43:01 +01:00
|
|
|
private val ioVersion = nightlyVersion.getOrElse("1.10.5")
|
2018-10-02 17:24:28 +02:00
|
|
|
private val lmVersion =
|
2025-08-24 00:14:10 +02:00
|
|
|
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.11.5")
|
2025-03-03 18:22:09 +01:00
|
|
|
val zincVersion = nightlyVersion.getOrElse("1.10.8")
|
2016-11-23 17:19:22 +01:00
|
|
|
|
|
|
|
|
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
|
|
|
|
|
2017-07-16 00:09:40 +02:00
|
|
|
private val libraryManagementCore = "org.scala-sbt" %% "librarymanagement-core" % lmVersion
|
2019-04-28 23:27:10 +02:00
|
|
|
private val libraryManagementIvy = "org.scala-sbt" %% "librarymanagement-ivy" % lmVersion
|
2016-11-23 16:17:34 +01:00
|
|
|
|
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
|
2016-11-23 18:29:52 +01:00
|
|
|
val testInterface = "org.scala-sbt" % "test-interface" % "1.0"
|
2024-10-18 08:26:58 +02:00
|
|
|
val ipcSocket = "org.scala-sbt.ipcsocket" % "ipcsocket" % "1.6.3"
|
2016-11-23 16:17:34 +01:00
|
|
|
|
2017-06-26 12:38:37 +02:00
|
|
|
private val compilerInterface = "org.scala-sbt" % "compiler-interface" % zincVersion
|
|
|
|
|
private val compilerClasspath = "org.scala-sbt" %% "zinc-classpath" % zincVersion
|
2016-11-23 18:29:52 +01:00
|
|
|
private val compilerApiInfo = "org.scala-sbt" %% "zinc-apiinfo" % zincVersion
|
|
|
|
|
private val compilerBridge = "org.scala-sbt" %% "compiler-bridge" % zincVersion
|
|
|
|
|
private val zinc = "org.scala-sbt" %% "zinc" % zincVersion
|
|
|
|
|
private val zincCompile = "org.scala-sbt" %% "zinc-compile" % zincVersion
|
2019-04-18 09:14:04 +02:00
|
|
|
private val zincCompileCore = "org.scala-sbt" %% "zinc-compile-core" % zincVersion
|
2016-11-23 17:19:22 +01:00
|
|
|
|
2020-01-10 14:41:55 +01:00
|
|
|
def getSbtModulePath(key: String) = {
|
2016-11-23 17:19:22 +01:00
|
|
|
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"))
|
2016-11-23 17:19:22 +01:00
|
|
|
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")
|
2016-11-23 17:19:22 +01:00
|
|
|
|
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) => {
|
2019-04-18 09:14:04 +02:00
|
|
|
val m = moduleId.withConfigurations(c.map(_.name))
|
2016-11-23 17:19:22 +01:00
|
|
|
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)
|
2016-11-23 17:19:22 +01:00
|
|
|
}
|
2019-04-18 09:14:04 +02:00
|
|
|
}
|
2016-11-23 17:19:22 +01:00
|
|
|
|
2020-01-10 14:41:55 +01:00
|
|
|
def addSbtIO = addSbtModule(sbtIoPath, "io", sbtIO)
|
2017-06-26 12:38:37 +02:00
|
|
|
|
2020-01-10 14:41:55 +01:00
|
|
|
def addSbtLmCore = addSbtModule(sbtLmPath, "lmCore", libraryManagementCore)
|
|
|
|
|
def addSbtLmIvy = addSbtModule(sbtLmPath, "lmIvy", libraryManagementIvy)
|
|
|
|
|
def addSbtLmIvyTest = addSbtModule(sbtLmPath, "lmIvy", libraryManagementIvy, 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 addSbtCompilerBridge = addSbtModule(sbtZincPath, "compilerBridge2_12", compilerBridge)
|
|
|
|
|
def addSbtZinc = addSbtModule(sbtZincPath, "zinc", zinc)
|
|
|
|
|
def addSbtZincCompile = addSbtModule(sbtZincPath, "zincCompile", zincCompile)
|
|
|
|
|
def addSbtZincCompileCore = addSbtModule(sbtZincPath, "zincCompileCore", zincCompileCore)
|
2020-01-10 14:41:55 +01:00
|
|
|
|
2025-06-03 12:41:12 +02:00
|
|
|
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.1.10"
|
2020-01-10 14:41:55 +01:00
|
|
|
|
2020-06-09 06:42:56 +02:00
|
|
|
def sjsonNew(n: String) =
|
2024-07-06 21:20:13 +02:00
|
|
|
Def.setting("com.eed3si9n" %% n % "0.10.1") // contrabandSjsonNewVersion.value
|
2020-01-10 14:41:55 +01:00
|
|
|
val sjsonNewScalaJson = sjsonNew("sjson-new-scalajson")
|
|
|
|
|
val sjsonNewMurmurhash = sjsonNew("sjson-new-murmurhash")
|
2019-12-08 00:49:13 +01:00
|
|
|
|
2024-12-17 23:37:44 +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"
|
2020-11-17 22:19:01 +01:00
|
|
|
val jline3Terminal = "org.jline" % "jline-terminal" % jline3Version
|
2024-10-22 22:05:20 +02:00
|
|
|
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
|
2020-10-14 08:28:55 +02:00
|
|
|
val jline3Builtins = "org.jline" % "jline-builtins" % jline3Version
|
2021-11-14 14:00:10 +01:00
|
|
|
val scalatest = "org.scalatest" %% "scalatest" % "3.2.10"
|
2021-11-14 13:27:44 +01:00
|
|
|
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.15.4"
|
2020-10-17 08:50:10 +02:00
|
|
|
val junit = "junit" % "junit" % "4.13.1"
|
2021-01-16 06:47:53 +01:00
|
|
|
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
|
2016-08-22 08:38:46 +02:00
|
|
|
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
|
2016-11-23 16:17:34 +01:00
|
|
|
|
2021-11-16 02:19:26 +01:00
|
|
|
val scalaXml = Def.setting(
|
|
|
|
|
if (scalaBinaryVersion.value == "3") {
|
2024-03-16 11:39:47 +01:00
|
|
|
"org.scala-lang.modules" %% "scala-xml" % "2.2.0"
|
2021-11-16 02:19:26 +01:00
|
|
|
} else {
|
2024-03-16 11:39:47 +01:00
|
|
|
"org.scala-lang.modules" %% "scala-xml" % "2.2.0"
|
2021-11-16 02:19:26 +01:00
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
val scalaParsers = Def.setting(
|
|
|
|
|
if (scalaBinaryVersion.value == "3") {
|
|
|
|
|
"org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.0"
|
|
|
|
|
} else {
|
|
|
|
|
"org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
val scalaReflect = Def.setting(
|
|
|
|
|
if (scalaBinaryVersion.value == "3") {
|
|
|
|
|
"org.scala-lang" % "scala-reflect" % scala213
|
|
|
|
|
} else {
|
|
|
|
|
"org.scala-lang" % "scala-reflect" % scalaVersion.value
|
|
|
|
|
}
|
|
|
|
|
)
|
2021-01-11 01:23:43 +01:00
|
|
|
val scalaPar = "org.scala-lang.modules" %% "scala-parallel-collections" % "1.0.0"
|
2017-07-28 06:08:27 +02:00
|
|
|
|
|
|
|
|
// specify all of log4j modules to prevent misalignment
|
2021-12-29 05:07:39 +01:00
|
|
|
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)
|
2017-10-20 17:26:23 +02:00
|
|
|
|
2020-08-07 21:49:39 +02:00
|
|
|
val caffeine = "com.github.ben-manes.caffeine" % "caffeine" % "2.8.5"
|
2019-04-21 04:06:52 +02:00
|
|
|
|
2021-11-14 13:27:44 +01:00
|
|
|
val hedgehog = "qa.hedgehog" %% "hedgehog-sbt" % "0.7.0"
|
2019-12-08 00:49:13 +01:00
|
|
|
val disruptor = "com.lmax" % "disruptor" % "3.4.2"
|
2024-07-06 22:36:20 +02:00
|
|
|
val kindProjector = ("org.typelevel" % "kind-projector" % "0.13.3").cross(CrossVersion.full)
|
2025-05-14 06:01:20 +02:00
|
|
|
val gigahorseOkHttp = "com.eed3si9n" %% "gigahorse-apache-http" % "0.9.3"
|
2014-12-18 13:57:05 +01:00
|
|
|
}
|