forked from nrinaudo/kantan.csv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
244 lines (220 loc) · 8.89 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
ThisBuild / kantanProject := "csv"
ThisBuild / startYear := Some(2015)
lazy val jsModules: Seq[ProjectReference] = Seq(
catsJS,
coreJS,
enumeratumJS,
genericJS,
lawsJS,
refinedJS,
scalazJS
)
lazy val jvmModules: Seq[ProjectReference] = Seq(
benchmark,
catsJVM,
commons,
coreJVM,
enumeratumJVM,
genericJVM,
jackson,
java8,
lawsJVM,
libra,
refinedJVM,
scalazJVM
)
// - root projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val root = Project(id = "kantan-csv", base = file("."))
.settings(moduleName := "root")
.enablePlugins(UnpublishedPlugin)
.settings(
console / initialCommands :=
"""
|import kantan.csv._
|import kantan.csv.ops._
|import kantan.csv.generic._
|import kantan.csv.refined._
""".stripMargin
)
.aggregate((jsModules ++ jvmModules :+ (docs: ProjectReference)): _*)
.dependsOn(coreJVM, genericJVM, libra, refinedJVM, enumeratumJVM)
lazy val docs = project
.enablePlugins(DocumentationPlugin)
.settings(name := "docs")
.settings(
ScalaUnidoc / unidoc / unidocProjectFilter :=
inAnyProject -- inProjects(benchmark) -- inProjects(jsModules: _*)
)
.settings(libraryDependencies += "joda-time" % "joda-time" % Versions.jodaTime)
.dependsOn(
coreJVM,
java8,
lawsJVM,
libra,
catsJVM,
scalazJVM,
genericJVM,
jackson,
commons,
refinedJVM,
enumeratumJVM
)
lazy val benchmark = project
.enablePlugins(UnpublishedPlugin, JmhPlugin)
.dependsOn(coreJVM, jackson, commons, lawsJVM % "test")
.settings(
libraryDependencies ++= Seq(
"com.opencsv" % "opencsv" % Versions.opencsv,
"com.univocity" % "univocity-parsers" % Versions.univocity,
"com.github.tototoshi" %% "scala-csv" % Versions.scalaCsv
)
)
// - core projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val core = kantanCrossProject("core")
.settings(moduleName := "kantan.csv")
.enablePlugins(PublishedPlugin, BoilerplatePlugin)
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs" % Versions.kantanCodecs
)
)
.laws("laws")
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
lazy val laws = kantanCrossProject("laws")
.settings(moduleName := "kantan.csv-laws")
.enablePlugins(PublishedPlugin, BoilerplatePlugin)
.dependsOn(core)
.settings(libraryDependencies += "com.nrinaudo" %%% "kantan.codecs-laws" % Versions.kantanCodecs)
lazy val lawsJVM = laws.jvm
lazy val lawsJS = laws.js
// - external engines projects -----------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val jackson = project
.settings(moduleName := "kantan.csv-jackson")
.enablePlugins(PublishedPlugin)
.dependsOn(coreJVM, lawsJVM % "test")
.settings(
libraryDependencies ++= Seq(
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-csv" % Versions.jacksonCsv
)
)
lazy val commons = project
.settings(moduleName := "kantan.csv-commons")
.enablePlugins(PublishedPlugin)
.dependsOn(coreJVM, lawsJVM % "test")
.settings(
libraryDependencies ++= Seq(
"org.apache.commons" % "commons-csv" % Versions.commonsCsv,
"org.scala-lang.modules" %% "scala-collection-compat" % Versions.collectionCompat
)
)
// - shapeless projects ------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val generic = kantanCrossProject("generic")
.settings(moduleName := "kantan.csv-generic")
.enablePlugins(PublishedPlugin)
.dependsOn(core, laws % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs-shapeless" % Versions.kantanCodecs,
"com.nrinaudo" %%% "kantan.codecs-shapeless-laws" % Versions.kantanCodecs % "test"
)
)
lazy val genericJVM = generic.jvm
lazy val genericJS = generic.js
// - scalaz projects ---------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val scalaz = kantanCrossProject("scalaz")
.settings(moduleName := "kantan.csv-scalaz")
.enablePlugins(PublishedPlugin)
.dependsOn(core, laws % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs-scalaz" % Versions.kantanCodecs,
"com.nrinaudo" %%% "kantan.codecs-scalaz-laws" % Versions.kantanCodecs % "test"
)
)
lazy val scalazJVM = scalaz.jvm
lazy val scalazJS = scalaz.js
// - cats projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val cats = kantanCrossProject("cats")
.settings(moduleName := "kantan.csv-cats")
.enablePlugins(PublishedPlugin)
.dependsOn(core, laws % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs-cats" % Versions.kantanCodecs,
"com.nrinaudo" %%% "kantan.codecs-cats-laws" % Versions.kantanCodecs % "test"
)
)
lazy val catsJVM = cats.jvm
lazy val catsJS = cats.js
// - java8 projects ----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val java8 = project
.settings(
moduleName := "kantan.csv-java8",
name := "java8"
)
.enablePlugins(PublishedPlugin)
.dependsOn(coreJVM, lawsJVM % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %% "kantan.codecs-java8" % Versions.kantanCodecs,
"com.nrinaudo" %% "kantan.codecs-java8-laws" % Versions.kantanCodecs % "test"
)
)
// - refined project ---------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val refined = kantanCrossProject("refined")
.settings(moduleName := "kantan.csv-refined")
.enablePlugins(PublishedPlugin)
.dependsOn(core, laws % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs-refined" % Versions.kantanCodecs,
"com.nrinaudo" %%% "kantan.codecs-refined-laws" % Versions.kantanCodecs % "test"
)
)
lazy val refinedJVM = refined.jvm
lazy val refinedJS = refined.js
// - enumeratum project ---------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val enumeratum = kantanCrossProject("enumeratum")
.settings(moduleName := "kantan.csv-enumeratum")
.enablePlugins(PublishedPlugin)
.dependsOn(core, laws % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %%% "kantan.codecs-enumeratum" % Versions.kantanCodecs,
"com.nrinaudo" %%% "kantan.codecs-enumeratum-laws" % Versions.kantanCodecs % "test"
)
)
lazy val enumeratumJVM = enumeratum.jvm
lazy val enumeratumJS = enumeratum.js
// - libra project -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val libra = project
.settings(
moduleName := "kantan.csv-libra",
name := "libra"
)
.enablePlugins(PublishedPlugin)
.dependsOn(coreJVM, lawsJVM % "test")
.settings(
libraryDependencies ++= Seq(
"com.nrinaudo" %% "kantan.codecs-libra" % Versions.kantanCodecs,
"com.nrinaudo" %% "kantan.codecs-libra-laws" % Versions.kantanCodecs % "test"
)
)
// - Command alisases --------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
addCommandAlias("runBench", "benchmark/jmh:run -i 10 -wi 10 -f 2 -t 1 -rf csv -rff benchmarks.csv")
addCommandAlias(
"runProfiler",
"benchmark/jmh:run -i 10 -wi 5 -f 1 -t 1 -o profiler.txt -prof \"stack:detailLine=true;lines=5;period=1\" kantan.csv.benchmark.*kantan.*"
)