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
|
2019-09-11 22:45:43 +02:00
|
|
|
val scala212 = "2.12.10"
|
2019-12-08 00:49:13 +01:00
|
|
|
val scala213 = "2.13.1"
|
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-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
|
2019-12-24 10:10:38 +01:00
|
|
|
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M2")
|
2018-10-02 17:24:28 +02:00
|
|
|
private val lmVersion =
|
2020-01-10 14:41:55 +01:00
|
|
|
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.3.0")
|
2019-10-14 06:26:34 +02:00
|
|
|
val zincVersion = nightlyVersion.getOrElse("1.3.1")
|
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
|
|
|
|
2019-08-28 05:24:11 +02:00
|
|
|
val launcherVersion = "1.1.3"
|
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"
|
2018-01-30 06:43:30 +01:00
|
|
|
val ipcSocket = "org.scala-sbt.ipcsocket" % "ipcsocket" % "1.0.0"
|
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))
|
|
|
|
|
|
|
|
|
|
def addSbtCompilerInterface = addSbtModule(sbtZincPath, "compilerInterface212", compilerInterface)
|
|
|
|
|
def addSbtCompilerClasspath = addSbtModule(sbtZincPath, "zincClasspath212", compilerClasspath)
|
|
|
|
|
def addSbtCompilerApiInfo = addSbtModule(sbtZincPath, "zincApiInfo212", compilerApiInfo)
|
|
|
|
|
def addSbtCompilerBridge = addSbtModule(sbtZincPath, "compilerBridge212", compilerBridge)
|
|
|
|
|
def addSbtZinc = addSbtModule(sbtZincPath, "zinc", zinc)
|
|
|
|
|
def addSbtZincCompile = addSbtModule(sbtZincPath, "zincCompile", zincCompile)
|
|
|
|
|
def addSbtZincCompileCore = addSbtModule(sbtZincPath, "zincCompileCore", zincCompileCore)
|
|
|
|
|
|
2020-02-06 12:36:05 +01:00
|
|
|
val lmCoursierShaded = "io.get-coursier" %% "lm-coursier-shaded" % "2.0.0-RC6-1"
|
2020-01-10 14:41:55 +01:00
|
|
|
|
|
|
|
|
def sjsonNew(n: String) = Def.setting("com.eed3si9n" %% n % contrabandSjsonNewVersion.value)
|
|
|
|
|
val sjsonNewScalaJson = sjsonNew("sjson-new-scalajson")
|
|
|
|
|
val sjsonNewMurmurhash = sjsonNew("sjson-new-murmurhash")
|
2019-12-08 00:49:13 +01:00
|
|
|
|
2018-04-10 23:10:56 +02:00
|
|
|
val jline = "jline" % "jline" % "2.14.6"
|
2019-08-19 08:34:07 +02:00
|
|
|
val scalatest = "org.scalatest" %% "scalatest" % "3.0.8"
|
2018-09-29 22:01:37 +02:00
|
|
|
val scalacheck = "org.scalacheck" %% "scalacheck" % "1.14.0"
|
2017-11-26 05:59:50 +01:00
|
|
|
val specs2 = "org.specs2" %% "specs2-junit" % "4.0.1"
|
2016-11-23 18:29:52 +01:00
|
|
|
val junit = "junit" % "junit" % "4.11"
|
2019-10-21 02:42:52 +02:00
|
|
|
val scalaVerify = "com.eed3si9n.verify" %% "verify" % "0.2.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
|
|
|
|
2020-01-10 14:41:55 +01:00
|
|
|
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "1.2.0"
|
|
|
|
|
val scalaParsers = "org.scala-lang.modules" %% "scala-parser-combinators" % "1.1.2"
|
|
|
|
|
val scalaReflect = Def.setting("org.scala-lang" % "scala-reflect" % scalaVersion.value)
|
2017-07-28 06:08:27 +02:00
|
|
|
|
|
|
|
|
// 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)
|
2017-10-20 17:26:23 +02:00
|
|
|
|
|
|
|
|
val scalaCacheCaffeine = "com.github.cb372" %% "scalacache-caffeine" % "0.20.0"
|
2019-04-21 04:06:52 +02:00
|
|
|
|
|
|
|
|
val hedgehog = "hedgehog" %% "hedgehog-sbt" % "0.1.0"
|
2019-12-08 00:49:13 +01:00
|
|
|
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
|
|
|
}
|