-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sbt
269 lines (244 loc) · 8.64 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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
lazy val scala212 = "2.12.17"
lazy val scala213 = "2.13.10"
lazy val scala3 = "3.2.1"
lazy val supportedScalaVersions = List(
scala3,
scala213,
scala212
)
val Java11 = JavaSpec.temurin("11") // "[email protected]"
// val Java8 = JavaSpec.temurin("8") // "[email protected]"
lazy val utilsVersion = "0.2.25"
// Dependency versions
lazy val catsVersion = "2.9.0"
lazy val catsEffectVersion = "3.4.4"
lazy val circeVersion = "0.14.2"
lazy val declineVersion = "2.4.1"
lazy val fs2Version = "3.4.0"
lazy val http4sVersion = "1.0.0-M30"
lazy val jenaVersion = "4.5.0"
lazy val munitVersion = "0.7.29"
lazy val munitEffectVersion = "1.0.7"
lazy val rdf4jVersion = "3.4.2"
lazy val scalaCollCompatVersion = "2.7.0"
// lazy val xercesVersion = "2.12.2"
// Dependency modules
lazy val utils = "es.weso" %% "utils" % utilsVersion
lazy val catsCore = "org.typelevel" %% "cats-core" % catsVersion
lazy val catsKernel = "org.typelevel" %% "cats-kernel" % catsVersion
lazy val catsEffect = "org.typelevel" %% "cats-effect" % catsEffectVersion
lazy val circeCore = "io.circe" %% "circe-core" % circeVersion
lazy val circeGeneric = "io.circe" %% "circe-generic" % circeVersion
lazy val circeParser = "io.circe" %% "circe-parser" % circeVersion
lazy val decline = "com.monovore" %% "decline" % declineVersion
lazy val declineEffect = "com.monovore" %% "decline-effect" % declineVersion
lazy val fs2Core = "co.fs2" %% "fs2-core" % fs2Version
lazy val http4sEmberClient = "org.http4s" %% "http4s-ember-client" % http4sVersion
lazy val jenaArq = "org.apache.jena" % "jena-arq" % jenaVersion
lazy val jenaFuseki = "org.apache.jena" % "jena-fuseki-main" % jenaVersion
lazy val munit = "org.scalameta" %% "munit" % munitVersion
lazy val munitEffects = "org.typelevel" %% "munit-cats-effect-3" % munitEffectVersion
lazy val rdf4j_runtime = "org.eclipse.rdf4j" % "rdf4j-runtime" % rdf4jVersion pomOnly ()
// lazy val xercesImpl = "xerces" % "xercesImpl" % xercesVersion
lazy val scalaCollCompat =
"org.scala-lang.modules" %% "scala-collection-compat" % scalaCollCompatVersion
// addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full)
ThisBuild / githubWorkflowJavaVersions := Seq(Java11)
def priorTo2_13(scalaVersion: String): Boolean =
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, minor)) if minor < 13 => true
case _ => false
}
lazy val srdfMain = project
.in(file("."))
.settings(
commonSettings
)
.aggregate(srdf, srdfJena, srdf4j, docs)
.dependsOn(srdf, srdfJena)
.settings(
libraryDependencies ++= Seq(
decline,
declineEffect
),
crossScalaVersions := Nil,
publish / skip := true,
ThisBuild / turbo := true,
ThisBuild / scalaVersion := supportedScalaVersions.head,
fork := true,
console / initialCommands :=
"""
|import es.weso.rdf._
|import es.weso.rdf.nodes._
|import es.weso.rdf.jena._
""".stripMargin,
Compile / console / scalacOptions ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Yno-predef"))
}
)
lazy val srdf = project
.in(file("modules/srdf"))
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
catsCore,
catsKernel,
// catsMacros,
catsEffect,
circeCore,
circeGeneric,
circeParser,
fs2Core,
utils,
// xercesImpl // required only for totalDigits/fractionDigits
// scalaLogging,
// scalaCollCompat,
)
)
// .jvmPlatform(scalaVersions = supportedScalaVersions)
// .jsPlatform(scalaVersions = supportedScalaVersions)
lazy val srdfJena = project
.in(file("modules/srdfJena"))
.dependsOn(srdf)
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
// logbackClassic % Test,
// scalaLogging,
jenaFuseki % Test,
// typesafeConfig % Test,
utils,
jenaArq,
catsCore,
catsKernel,
catsEffect,
fs2Core,
http4sEmberClient
)
)
// .jvmPlatform(scalaVersions = supportedScalaVersions)
lazy val srdf4j = project
.in(file("modules/srdf4j"))
.dependsOn(srdf)
.settings(commonSettings)
.settings(
crossScalaVersions := supportedScalaVersions,
libraryDependencies ++= Seq(
utils,
rdf4j_runtime,
catsCore,
catsKernel,
catsEffect,
fs2Core,
scalaCollCompat // required for toScala conversions...
)
)
// .jvmPlatform(scalaVersions = supportedScalaVersions)
lazy val docs = project
.in(file("srdf-docs"))
.settings(
noPublishSettings,
mdocSettings,
crossScalaVersions := Nil,
ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects(noDocProjects: _*)
)
.dependsOn(
srdf,
srdfJena
// srdf4j
)
.enablePlugins(MdocPlugin, DocusaurusPlugin, ScalaUnidocPlugin)
lazy val mdocSettings = Seq(
mdocVariables := Map(
"VERSION" -> version.value
),
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(
srdf,
srdfJena,
srdf4j),
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite.dependsOn(Compile / unidoc).value,
docusaurusPublishGhpages :=
docusaurusPublishGhpages.dependsOn(Compile / unidoc).value,
ScalaUnidoc / unidoc / scalacOptions ++= Seq(
"-doc-source-url",
s"https://github.com/weso/srdf/tree/v${(ThisBuild / version).value}€{FILE_PATH}.scala",
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-title",
"SRDF",
"-doc-version",
s"v${(ThisBuild / version).value}"
)
)
lazy val noPublishSettings = publish / skip := true
/* ********************************************************
******************** Grouped Settings ********************
**********************************************************/
lazy val noDocProjects = Seq[ProjectReference](
)
lazy val sharedDependencies = Seq(
libraryDependencies ++= Seq(
munit % Test,
munitEffects % Test
),
testFrameworks += new TestFramework("munit.Framework")
)
lazy val compilationSettings = Seq(
// format: off
scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding", "utf-8", // Specify character encoding used by source files.
"-feature", // Emit warning and location for usages of features that should be imported explicitly. "-encoding", "UTF-8",
"-language:_"
)
// format: on
)
/*lazy val commonSettings = compilationSettings ++ sharedDependencies ++ Seq(
organization := "es.weso",
)
lazy val publishSettings = Seq(
homepage := Some(url("https://github.com/weso/srdf")),
publishMavenStyle := true,
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
homepage := Some(url("https://github.com/weso/srdf")),
scmInfo := Some(ScmInfo(url("https://github.com/weso/srdf"), "scm:git:[email protected]:weso/srdf.git")),
autoAPIMappings := true,
pomExtra := <developers>
<developer>
<id>labra</id>
<name>Jose Emilio Labra Gayo</name>
<url>https://github.com/labra/</url>
</developer>
</developers>,
ThisBuild / publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
)*/
lazy val commonSettings = compilationSettings ++ sharedDependencies ++ Seq(
coverageHighlighting := priorTo2_13(scalaVersion.value),
organization := "es.weso",
sonatypeProfileName := "es.weso",
homepage := Some(url("https://github.com/weso/srdf")),
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT")),
scmInfo := Some(
ScmInfo(url("https://github.com/weso/srdf"), "scm:git:[email protected]:weso/srdf.git")),
autoAPIMappings := true,
apiURL := Some(url("http://weso.github.io/utils/latest/api/")),
autoAPIMappings := true,
developers := List(
Developer(
id = "labra",
name = "Jose Emilio Labra Gayo",
email = "[email protected]",
url = url("https://weso.labra.es")
)
),
)