-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sbt
187 lines (167 loc) · 6.97 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
ThisBuild / kantanProject := "regex"
ThisBuild / startYear := Some(2016)
lazy val jsModules: Seq[ProjectReference] = Seq(
catsJS,
coreJS,
enumeratumJS,
genericJS,
lawsJS,
refinedJS,
scalazJS
)
lazy val jvmModules: Seq[ProjectReference] = Seq(
catsJVM,
coreJVM,
enumeratumJVM,
genericJVM,
java8,
lawsJVM,
libra,
refinedJVM,
scalazJVM
)
// - root projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val root = Project(id = "kantan-regex", base = file("."))
.settings(moduleName := "root")
.enablePlugins(UnpublishedPlugin)
.settings(
console / initialCommands :=
"""
|import kantan.regex._
|import kantan.regex.implicits._
|import kantan.regex.generic._
|import kantan.regex.refined._
""".stripMargin
)
.aggregate((jsModules ++ jvmModules :+ (docs: ProjectReference)): _*)
.dependsOn(coreJVM, genericJVM, refinedJVM)
lazy val docs = project
.settings(
ScalaUnidoc / unidoc / unidocProjectFilter :=
inAnyProject -- inProjects(jsModules: _*)
)
.enablePlugins(DocumentationPlugin)
.settings(name := "docs")
.settings(libraryDependencies += "joda-time" % "joda-time" % Versions.jodaTime)
.dependsOn(catsJVM, coreJVM, enumeratumJVM, genericJVM, java8, libra, refinedJVM, scalazJVM)
// - core projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val core = kantanCrossProject("core")
.settings(moduleName := "kantan.regex")
.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.regex-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
// - java8 projects ----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val java8 = project
.settings(
moduleName := "kantan.regex-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"
)
)
// - cats projects -----------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val cats = kantanCrossProject("cats")
.settings(moduleName := "kantan.regex-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
// - scalaz projects ---------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val scalaz = kantanCrossProject("scalaz")
.settings(moduleName := "kantan.regex-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
// - shapeless projects ------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val generic = kantanCrossProject("generic")
.settings(moduleName := "kantan.regex-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
// - refined project ---------------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------------------------------
lazy val refined = kantanCrossProject("refined")
.settings(moduleName := "kantan.regex-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.regex-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.regex-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"
)
)