-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDependencies.scala
More file actions
97 lines (83 loc) · 3.77 KB
/
Dependencies.scala
File metadata and controls
97 lines (83 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import sbt._, Keys._
object Dependencies {
def nightlyVersion: Option[String] =
sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")
val scala210 = "2.10.7"
val scala211 = "2.11.12"
val scala212 = "2.12.21"
val scala213 = "2.13.16"
val scala3 = "3.8.2"
val scala3ForBridge = "3.3.4"
val scala213ForBridge = "2.13.16"
val defaultScalaVersion = scala3
val compilerBridgeVersions = Seq(scala212, scala210, scala211, scala213)
val scala3_only = Seq(scala3)
private val ioVersion = nightlyVersion.getOrElse("1.10.5")
private val utilVersion = nightlyVersion.getOrElse("2.0.0-RC10")
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
private val utilLogging = "org.scala-sbt" %% "util-logging" % utilVersion
private val utilControl = "org.scala-sbt" %% "util-control" % utilVersion
private val utilRelation = "org.scala-sbt" %% "util-relation" % utilVersion
private val utilInterface = "org.scala-sbt" % "util-interface" % utilVersion
private val utilScripted = "org.scala-sbt" %% "util-scripted" % utilVersion
val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.6.1"
def getSbtModulePath(key: String, name: String) = {
val localProps = new java.util.Properties()
IO.load(localProps, file("project/local.properties"))
val path = Option(localProps getProperty key) orElse (sys.props get key)
path foreach (f => println(s"Using $name from $f"))
path
}
def addSbtModule(
p: Project,
path: Option[String],
projectName: String,
m: ModuleID,
c: Option[Configuration] = None
) =
path match {
case Some(f) =>
p dependsOn ClasspathDependency(ProjectRef(file(f), projectName), c.map(_.name))
case None =>
p settings (libraryDependencies += m.withConfigurations(c.map(_.name)))
}
lazy val sbtIoPath = getSbtModulePath("sbtio.path", "sbt/io")
lazy val sbtUtilPath = getSbtModulePath("sbtutil.path", "sbt/util")
def addSbtIO(p: Project): Project = addSbtModule(p, sbtIoPath, "io", sbtIO)
def addSbtUtilControl(p: Project): Project =
addSbtModule(p, sbtUtilPath, "utilControl", utilControl)
def addSbtUtilInterface(p: Project): Project =
addSbtModule(p, sbtUtilPath, "utilInterface", utilInterface)
def addSbtUtilLogging(p: Project): Project =
addSbtModule(p, sbtUtilPath, "utilLogging", utilLogging)
def addSbtUtilRelation(p: Project): Project =
addSbtModule(p, sbtUtilPath, "utilRelation", utilRelation)
def addSbtUtilScripted(p: Project): Project =
addSbtModule(p, sbtUtilPath, "utilScripted", utilScripted, Some(Test))
val scalaCompiler = Def.setting { "org.scala-lang" % "scala-compiler" % scalaVersion.value }
val parserCombinator = "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.0"
// sbinary 0.5.2 uses 2.13 build of scala-xml, so use 0.5.1
val sbinary = "org.scala-sbt" %% "sbinary" % "0.5.1"
val sjsonNewVersion = "0.14.0-M5"
val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.4.0"
val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.19.0"
val scalatest = "org.scalatest" %% "scalatest" % "3.2.20"
val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0"
val sjsonnew = Def.setting {
"com.eed3si9n" %% "sjson-new-core" % sjsonNewVersion
}
val sjsonnewScalaJson = Def.setting {
"com.eed3si9n" %% "sjson-new-scalajson" % sjsonNewVersion
}
val zeroAllocationHashing = "net.openhft" % "zero-allocation-hashing" % "0.16"
val scala2BinaryBridge = "org.scala-lang" % "scala2-sbt-bridge" % scala213ForBridge
val scala3BinaryBridge = "org.scala-lang" % "scala3-sbt-bridge" % scala3ForBridge
def addTestDependencies(p: Project): Project =
p.settings(
libraryDependencies ++= Seq(
scalaCheck % Test,
scalatest % Test,
verify % Test,
)
)
}