sbt/project/Dependencies.scala

115 lines
5.4 KiB
Scala
Raw Normal View History

2014-12-18 13:57:05 +01:00
import sbt._
import Keys._
import sbt.contraband.ContrabandPlugin.autoImport._
2014-12-18 13:57:05 +01:00
object Dependencies {
// WARNING: Please Scala update versions in PluginCross.scala too
2020-03-18 08:49:14 +01:00
val scala212 = "2.12.11"
val scala213 = "2.13.1"
2020-01-10 14:41:55 +01:00
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
val baseScalaVersion = scala212
2020-01-10 14:41:55 +01:00
def nightlyVersion = sys.props.get("sbt.build.version")
2014-12-18 23:40:20 +01:00
2015-09-14 09:27:22 +02:00
// sbt modules
2020-05-08 03:47:06 +02:00
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M6")
private val lmVersion =
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.4.0-M2")
val zincVersion = nightlyVersion.getOrElse("1.4.0-M8")
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
val launcherVersion = "1.1.4"
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.1.0"
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 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
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) => {
2019-04-18 09:14:04 +02:00
val m = moduleId.withConfigurations(c.map(_.name))
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)
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))
2020-04-22 22:43:11 +02:00
def addSbtCompilerInterface = addSbtModule(sbtZincPath, "compilerInterfaceJVM", compilerInterface)
def addSbtCompilerClasspath = addSbtModule(sbtZincPath, "zincClasspathJVM2_12", compilerClasspath)
def addSbtCompilerApiInfo = addSbtModule(sbtZincPath, "zincApiInfoJVM2_12", compilerApiInfo)
def addSbtCompilerBridge = addSbtModule(sbtZincPath, "compilerBridgeJVM2_12", compilerBridge)
def addSbtZinc = addSbtModule(sbtZincPath, "zincJVM2_12", zinc)
def addSbtZincCompile = addSbtModule(sbtZincPath, "zincCompileJVM2_12", zincCompile)
def addSbtZincCompileCore = addSbtModule(sbtZincPath, "zincCompileCoreJVM2_12", zincCompileCore)
2020-01-10 14:41:55 +01:00
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.0.0-RC6-8"
2020-01-10 14:41:55 +01:00
2020-06-09 06:42:56 +02:00
def sjsonNew(n: String) =
Def.setting("com.eed3si9n" %% n % "0.9.0") // contrabandSjsonNewVersion.value
2020-01-10 14:41:55 +01:00
val sjsonNewScalaJson = sjsonNew("sjson-new-scalajson")
val sjsonNewMurmurhash = sjsonNew("sjson-new-murmurhash")
val jline = "org.scala-sbt.jline" % "jline" % "2.14.7-sbt-5e51b9d4f9631ebfa29753ce4accc57808e7fd6b"
Upgrade LineReader to JLine3 This commit upgrades sbt to using jline3. The advantage to jline3 is that it has a significantly better tab completion engine that is more similar to what you get from zsh or fish. The diff is bigger than I'd hoped because there are a number of behaviors that are different in jline3 vs jline2 in how the library consumes input streams and implements various features. I also was unable to remove jline2 because we need it for older versions of the scala console to work correctly with the thin client. As a result, the changes are largely additive. A good amount of this commit was in adding more protocol so that the remote client can forward its jline3 terminal information to the server. There were a number of minor changes that I made that either fixed outstanding ui bugs from #5620 or regressions due to differences between jline3 and jline2. The number one thing that caused problems is that the jline3 LineReader insists on using a NonBlockingInputStream. The implementation ofo NonBlockingInputStream seems buggy. Moreover, sbt internally uses a non blocking input stream for system in so jline is adding non blocking to an already non blocking stream, which is frustrating. A long term solution might be to consider insourcing LineReader.java from jline3 and just adapting it to use an sbt terminal rather than fighting with the jline3 api. This would also have the advantage of not conflicting with other versions of jline3. Even if we don't, we may want to shade jline3 if that is possible.
2020-06-30 17:57:57 +02:00
val jline3 = "org.jline" % "jline" % "3.15.0"
val jline3Jansi = "org.jline" % "jline-terminal-jansi" % "3.15.0"
val jansi = "org.fusesource.jansi" % "jansi" % "1.18"
2019-08-19 08:34:07 +02:00
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
2020-07-08 01:52:52 +02:00
val specs2 = "org.specs2" %% "specs2-junit" % "4.10.0"
val junit = "junit" % "junit" % "4.11"
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "0.2.0"
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
2016-11-23 16:17:34 +01:00
2020-06-27 07:14:35 +02:00
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.3.0"
2020-01-10 14:41:55 +01:00
val scalaParsers = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
val scalaReflect = Def.setting("org.scala-lang" % "scala-reflect" % scalaVersion.value)
// specify all of log4j modules to prevent misalignment
2020-01-10 14:41:55 +01:00
def log4jModule = (n: String) => "org.apache.logging.log4j" % n % "2.11.2"
val log4jApi = log4jModule("log4j-api")
val log4jCore = log4jModule("log4j-core")
val log4jSlf4jImpl = log4jModule("log4j-slf4j-impl")
val log4jModules = Vector(log4jApi, log4jCore, log4jSlf4jImpl)
val scalaCacheCaffeine = "com.github.cb372" %% "scalacache-caffeine" % "0.20.0"
val hedgehog = "hedgehog" %% "hedgehog-sbt" % "0.1.0"
val disruptor = "com.lmax" % "disruptor" % "3.4.2"
val silencerPlugin = "com.github.ghik" %% "silencer-plugin" % "1.4.2"
val silencerLib = "com.github.ghik" %% "silencer-lib" % "1.4.2" % Provided
2014-12-18 13:57:05 +01:00
}