-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.sbt
198 lines (184 loc) · 5.85 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
lazy val commonSettings = Seq(
version := "0.27.0",
organization := "com.tethys-json",
scalaVersion := "2.12.15",
crossScalaVersions := Seq("2.12.15", "2.13.10"),
Compile / unmanagedSourceDirectories ++= {
def extraDirs(suffix: String) = Seq(file(sourceDirectory.value.getPath + "/main/scala" + suffix))
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) if y <= 12 =>
extraDirs("-2.12-")
case Some((2, y)) if y >= 13 =>
extraDirs("-2.13+")
case _ => Nil
}
},
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
homepage := Some(url("https://github.com/tethys-json/tethys")),
scmInfo := Some(
ScmInfo(
url("https://github.com/tethys-json/tethys"),
"scm:[email protected]:tethys-json/tethys.git"
)
),
developers := List(
Developer(
id = "eld0727",
name = "Aleksei Otts",
email = "[email protected]",
url = url("https://github.com/eld0727")
),
Developer(
id = "REDNBLACK",
name = "Boris Potepun",
email = "[email protected]",
url = url("https://github.com/REDNBLACK")
)
),
credentials ++= Option(Path.userHome / ".config" / "sbt" / ".tethys-credentials")
.filter(_.exists())
.map(Credentials(_)),
publishMavenStyle := true,
publishTo := {
if (isSnapshot.value)
Some(Opts.resolver.sonatypeSnapshots)
else
sonatypePublishToBundle.value
},
Test / publishArtifact := false
)
lazy val testSettings = Seq(
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest-flatspec" % "3.2.15" % Test,
"org.scalatest" %% "scalatest-shouldmatchers" % "3.2.15" % Test
)
)
lazy val tethys = project.in(file("."))
.settings(
publishTo := None,
commonSettings
)
.aggregate(core, `macro-derivation`, `jackson-211`, `jackson-212`, json4s, circe, enumeratum, refined)
lazy val modules = file("modules")
lazy val core = project.in(modules / "core")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-core",
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, y)) if y >= 13 =>
Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided
)
case _ => Nil
}
}
)
lazy val `macro-derivation` = project.in(modules / "macro-derivation")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-derivation",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value % Provided
)
)
.dependsOn(core)
lazy val jacksonSettings = Seq(
Compile / unmanagedSourceDirectories += modules / "jackson-backend" / "src" / "main",
Test / unmanagedSourceDirectories += modules / "jackson-backend" / "src" / "test",
Test / unmanagedResourceDirectories += modules / "jackson-backend" / "src" / "test" / "resources"
)
lazy val `jackson-211` = project.in(modules / "jackson-211")
.settings(commonSettings)
.settings(jacksonSettings)
.settings(testSettings)
.settings(
name := "tethys-jackson",
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-core" % "2.11.4"
)
)
.dependsOn(core)
lazy val `jackson-212` = project.in(modules / "jackson-212")
.settings(commonSettings)
.settings(jacksonSettings)
.settings(testSettings)
.settings(
name := "tethys-jackson212",
libraryDependencies ++= Seq(
"com.fasterxml.jackson.core" % "jackson-core" % "2.12.7"
)
)
.dependsOn(core)
lazy val circe = project.in(modules / "circe")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-circe",
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % "0.14.3"
)
)
.dependsOn(core, `jackson-212` % Test)
lazy val json4s = project.in(modules / "json4s")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-json4s",
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-core" % "4.0.6"
)
)
.dependsOn(core)
lazy val enumeratum = project.in(modules / "enumeratum")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-enumeratum",
libraryDependencies ++= Seq(
"com.beachape" %% "enumeratum" % "1.7.2"
)
)
.dependsOn(core)
lazy val refined = project.in(modules / "refined")
.settings(commonSettings)
.settings(testSettings)
.settings(
name := "tethys-refined",
libraryDependencies ++= Seq(
"eu.timepit" %% "refined" % "0.9.29"
)
)
.dependsOn(core)
lazy val benchmarks = project.in(modules / "benchmarks")
.settings(commonSettings)
.settings(
publishTo := None,
libraryDependencies ++= Seq(
"io.spray" %% "spray-json" % "1.3.6",
"org.json4s" %% "json4s-native" % "3.6.10",
"org.json4s" %% "json4s-jackson" % "3.6.10",
"io.circe" %% "circe-core" % "0.14.3",
"io.circe" %% "circe-generic" % "0.13.0",
"io.circe" %% "circe-jawn" % "0.13.0",
"io.circe" %% "circe-jackson210" % "0.13.0",
"com.typesafe.play" %% "play-json" % "2.9.2",
"org.knowm.xchart" % "xchart" % "3.8.0" exclude("de.erichseifert.vectorgraphics2d", "VectorGraphics2D") withSources()
),
libraryDependencies ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Nil
case _ => Seq(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
}
},
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 13)) => Seq("-Ymacro-annotations")
case _ => Nil
}
}
)
.dependsOn(core, `macro-derivation`, `jackson-211`)
.enablePlugins(JmhPlugin)