forked from json4s/json4s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
114 lines (102 loc) · 3.71 KB
/
build.sbt
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
import xml.Group
import sbtbuildinfo.Plugin._
import com.typesafe.sbt.SbtStartScript
import Dependencies._
import build._
lazy val root = Project(
id = "json4s",
base = file("."),
settings = json4sSettings ++ noPublish
) aggregate(core, native, json4sExt, jacksonSupport, scalazExt, json4sTests, mongo, ast, scalap, examples, benchmark)
lazy val ast = Project(
id = "json4s-ast",
base = file("ast"),
settings = json4sSettings ++ buildInfoSettings ++ Seq(
sourceGenerators in Compile <+= buildInfo,
buildInfoKeys := Seq[BuildInfoKey](name, organization, version, scalaVersion, sbtVersion),
buildInfoPackage := "org.json4s"
)
)
lazy val scalap = Project(
id = "json4s-scalap",
base = file("scalap"),
settings = json4sSettings
)
lazy val core = Project(
id = "json4s-core",
base = file("core"),
settings = json4sSettings ++ Seq(
libraryDependencies <++= scalaVersion { sv => Seq(paranamer) ++ scalaXml(sv) },
initialCommands in (Test, console) := """
|import org.json4s._
|import reflect._
""".stripMargin
)
) dependsOn(ast % "compile;test->test", scalap)
lazy val native = Project(
id = "json4s-native",
base = file("native"),
settings = json4sSettings
) dependsOn(core % "compile;test->test")
lazy val json4sExt = Project(
id = "json4s-ext",
base = file("ext"),
settings = json4sSettings ++ Seq(libraryDependencies ++= jodaTime)
) dependsOn(native % "provided->compile;test->test")
lazy val jacksonSupport = Project(
id = "json4s-jackson",
base = file("jackson"),
settings = json4sSettings ++ Seq(libraryDependencies ++= jackson)
) dependsOn(core % "compile;test->test")
lazy val examples = Project(
id = "json4s-examples",
base = file("examples"),
settings = json4sSettings ++ SbtStartScript.startScriptForClassesSettings ++ noPublish
) dependsOn(
core % "compile;test->test",
native % "compile;test->test",
jacksonSupport % "compile;test->test",
json4sExt,
mongo)
lazy val scalazExt = Project(
id = "json4s-scalaz",
base = file("scalaz"),
settings = json4sSettings ++ Seq(libraryDependencies += scalaz_core)
) dependsOn(core % "compile;test->test", native % "provided->compile", jacksonSupport % "provided->compile")
lazy val mongo = Project(
id = "json4s-mongo",
base = file("mongo"),
settings = json4sSettings ++ Seq(
libraryDependencies ++= Seq(
"org.mongodb" % "mongo-java-driver" % "3.2.1"
)
)) dependsOn(core % "compile;test->test")
lazy val json4sTests = Project(
id = "json4s-tests",
base = file("tests"),
settings = json4sSettings ++ Seq(
libraryDependencies ++= (specs.value :+ mockito),
initialCommands in (Test, console) :=
"""
|import org.json4s._
|import reflect._
""".stripMargin
) ++ noPublish
) dependsOn(core, native, json4sExt, scalazExt, jacksonSupport, mongo)
lazy val benchmark = Project(
id = "json4s-benchmark",
base = file("benchmark"),
settings = json4sSettings ++ SbtStartScript.startScriptForClassesSettings ++ Seq(
cancelable := true,
libraryDependencies ++= Seq(
"com.google.code.java-allocation-instrumenter" % "java-allocation-instrumenter" % "3.0.1",
"com.google.caliper" % "caliper" % "0.5-rc1",
"com.google.code.gson" % "gson" % "2.7"
),
runner in Compile in run <<= (thisProject, taskTemporaryDirectory, scalaInstance, baseDirectory, javaOptions, outputStrategy, javaHome, connectInput) map {
(tp, tmp, si, base, options, strategy, javaHomeDir, connectIn) =>
new MyRunner(tp.id, ForkOptions(javaHome = javaHomeDir, connectInput = connectIn, outputStrategy = strategy,
runJVMOptions = options, workingDirectory = Some(base)) )
}
) ++ noPublish
) dependsOn(core, native, jacksonSupport, json4sExt, mongo)