-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.sbt
170 lines (154 loc) · 5.05 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
lazy val commonSettings = Seq(
libraryDependencies ++= {
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => Seq(compilerPlugin(Dependencies.kindProjector), compilerPlugin(Dependencies.macroParadise))
case Some((2, 13)) => Seq(compilerPlugin(Dependencies.kindProjector))
case _ => Seq.empty
}) ++
Seq(Dependencies.scalaReflect(scalaOrganization.value, scalaVersion.value) % Provided)
},
scalacOptions := {
val opts = scalacOptions.value
val excluded = Set("-Xfatal-warnings")
val wconf = "-Wconf:" +
Set("unused-params", "unused-privates", "unused-pat-vars", "other-match-analysis")
.foldRight("any:wv")((s, acc) => s"cat=$s:s,$acc")
val mannot = "-Ymacro-annotations"
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => opts.filterNot(excluded) ++ Seq(wconf)
case Some((2, 13)) => opts.filterNot(excluded) ++ Seq(wconf, mannot)
case _ => opts
}
},
Test / fork := true,
libraryDependencies ++= Seq(Dependencies.scalatest, Dependencies.estatico, Dependencies.supertagged).map(_ % Test),
resolvers += Resolver.sonatypeRepo("releases"),
)
lazy val noPublishSettings =
commonSettings ++ Seq(publish := {}, publishArtifact := false, publishTo := None, publish / skip := true)
lazy val publishSettings = commonSettings ++ Seq(
pomIncludeRepository := { _ =>
false
},
Test / publishArtifact := false
)
lazy val derevo = project
.in(file("."))
.settings(noPublishSettings)
.aggregate(
cats,
catsTagless,
circe,
circeMagnolia,
ciris,
core,
pureconfig,
reactivemongo,
scalacheck,
tethys,
tethysMagnolia,
sangria,
tests,
)
lazy val core =
(project in file("modules/core"))
.settings(publishSettings)
.settings(
name := "derevo-core"
)
lazy val cats =
(project in file("modules/cats"))
.settings(publishSettings)
.settings(
name := "derevo-cats",
libraryDependencies ++= Seq(Dependencies.magnolia, Dependencies.catsCore),
)
.dependsOn(core)
lazy val catsTagless =
(project in file("modules/catsTagless"))
.settings(publishSettings)
.settings(
name := "derevo-cats-tagless",
libraryDependencies ++= Seq(Dependencies.catsTaglessCore, Dependencies.catsTaglessMacros),
)
.dependsOn(core)
lazy val circe =
(project in file("modules/circe"))
.settings(publishSettings)
.settings(
name := "derevo-circe",
libraryDependencies ++= Seq(Dependencies.circeCore, Dependencies.circeDerivation),
libraryDependencies ++= Seq(Dependencies.circeParser).map(_ % Test)
)
.dependsOn(core)
lazy val circeMagnolia =
(project in file("modules/circeMagnolia"))
.settings(publishSettings)
.settings(
name := "derevo-circe-magnolia",
libraryDependencies ++= Seq(Dependencies.circeMagnolia),
libraryDependencies ++= Seq(Dependencies.circeParser).map(_ % Test)
)
.dependsOn(core)
lazy val ciris =
(project in file("modules/ciris"))
.settings(publishSettings)
.settings(
name := "derevo-ciris",
libraryDependencies ++= Seq(Dependencies.ciris, Dependencies.typesafeConfig, Dependencies.magnolia),
)
.dependsOn(core)
lazy val pureconfig =
(project in file("modules/pureconfig"))
.settings(publishSettings)
.settings(
name := "derevo-pureconfig",
libraryDependencies ++= Seq(Dependencies.pureconfig, Dependencies.pureconfigMagnolia),
)
.dependsOn(core)
lazy val reactivemongo =
(project in file("modules/reactivemongo"))
.settings(publishSettings)
.settings(
name := "derevo-reactivemongo",
libraryDependencies ++= Seq(Dependencies.reactivemongoBsonMacros),
)
.dependsOn(core)
lazy val tethys =
(project in file("modules/tethys"))
.settings(publishSettings)
.settings(
name := "derevo-tethys",
libraryDependencies ++= Seq(Dependencies.tethysCore, Dependencies.tethysDerivation),
libraryDependencies ++= Seq(Dependencies.tethysJackson).map(_ % Test)
)
.dependsOn(core)
lazy val tethysMagnolia =
(project in file("modules/tethysMagnolia"))
.settings(publishSettings)
.settings(
name := "derevo-tethys-magnolia",
libraryDependencies ++= Seq(Dependencies.tethysCore, Dependencies.magnolia),
libraryDependencies ++= Seq(Dependencies.tethysJackson).map(_ % Test)
)
.dependsOn(core)
lazy val scalacheck =
(project in file("modules/scalacheck"))
.settings(publishSettings)
.settings(
name := "derevo-scalacheck",
libraryDependencies ++= Seq(Dependencies.scalacheck, Dependencies.magnolia),
)
.dependsOn(core)
lazy val sangria =
(project in file("modules/sangria"))
.settings(publishSettings)
.settings(
name := "derevo-sangria",
libraryDependencies ++= Seq(Dependencies.sangria),
)
.dependsOn(core)
lazy val tests =
(project in file("modules/tests"))
.settings(noPublishSettings)
.dependsOn(core, circe, ciris, tethys, reactivemongo, catsTagless, pureconfig)