-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
147 lines (135 loc) · 4.9 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
scalaVersion in ThisBuild := "2.12.6"
lazy val jmhSettings = Seq(
sourceDirectory in Jmh := (sourceDirectory in Test).value,
classDirectory in Jmh := (classDirectory in Test).value,
resourceDirectory in Jmh := (resourceDirectory in Test).value,
dependencyClasspath in Jmh := (dependencyClasspath in Test).value,
compile in Jmh := ((compile in Jmh) dependsOn (compile in Test)).value,
run in Jmh := ((run in Jmh) dependsOn (compile in Jmh)).evaluated
)
lazy val commonSettings = Seq(
scalacOptions := Seq(
"-encoding", "UTF-8",
"-deprecation",
"-unchecked"
)
)
lazy val common = (project in file("common"))
.settings(commonSettings)
.settings(
name := "common",
libraryDependencies ++= Seq(
"com.github.pathikrit" %% "better-files" % "3.5.0",
"log4j" % "log4j" % "1.2.17",
"org.slf4j" % "slf4j-api" % "1.7.25",
"ch.qos.logback" % "logback-classic" % "1.2.3",
)
)
lazy val csvBench = (project in file("csv-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "csv-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.csv.FileGen")
)
.dependsOn(common % "compile->compile")
lazy val circeBench = (project in file("circe-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "json-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.circe.FileGen"),
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.9.3",
"io.circe" %% "circe-generic" % "0.9.3",
"io.circe" %% "circe-parser" % "0.9.3"
)
)
.dependsOn(common % "compile->compile")
lazy val jsoniterScalaBench = (project in file("jsoniter-scala-bench"))
.enablePlugins(JmhPlugin)
.settings(jmhSettings)
.settings(
name := "jsoniter-scala-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.jsoniter.FileGen"),
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %% "macros" % "0.26.0"
)
)
.dependsOn(common % "compile->compile")
lazy val msgpack4zBench = (project in file("msgpack4z-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "msgpack4z-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.msgpack.msgpack4z.FileGen"),
libraryDependencies ++= Seq(
"com.github.xuwei-k" %% "msgpack4z-core" % "0.3.9",
"com.github.xuwei-k" %% "msgpack4z-native" % "0.3.5"
)
)
.dependsOn(common % "compile->compile")
lazy val msgpackJacksonBench = (project in file("msgpack-jackson-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "msgpack-jackson-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.msgpack.jackson.FileGen"),
libraryDependencies ++= Seq(
"com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.5",
"org.msgpack" % "jackson-dataformat-msgpack" % "0.8.16"
)
)
.dependsOn(common % "compile->compile")
lazy val avroBench = (project in file("avro-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "avro-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.avro.FileGen"),
libraryDependencies ++= Seq(
"org.apache.avro" % "avro" % "1.8.2"
)
)
.settings(
avroSpecificSourceDirectory in Compile := file("schema/avro"),
avroSpecificScalaSource in Compile := (sourceManaged in Compile).value,
sourceGenerators in Compile += (avroScalaGenerateSpecific in Compile).taskValue
)
.dependsOn(common % "compile->compile")
lazy val protoBench = (project in file("proto-bench"))
.enablePlugins(ProtocPlugin, JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "protobuf-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.protobuf.FileGen"),
)
.settings( // for ScalaPB
PB.targets in Compile := Seq(scalapb.gen() -> (sourceManaged in Compile).value),
PB.protoSources in Compile := Seq(file("schema/protocol-buffers"))
)
.dependsOn(common % "compile->compile")
lazy val thriftBench = (project in file("thrift-bench"))
.enablePlugins(JmhPlugin)
.settings(commonSettings)
.settings(jmhSettings)
.settings(
name := "thrift-bench",
mainClass := Some("com.github.saint1991.serialization.benchmark.thrift.FileGen"),
libraryDependencies ++= Seq(
"org.apache.thrift" % "libthrift" % "0.11.0",
"com.twitter" %% "scrooge-core" % "18.5.0" exclude("com.twitter", "libthrift")
)
)
.settings(
scroogeThriftIncludeFolders in Compile := Seq(file("schema/thrift")),
scroogeThriftSourceFolder in Compile := file("schema/thrift"),
scroogeThriftOutputFolder in Compile := (sourceManaged in Compile).value
)
.dependsOn(common % "compile->compile")