-
Notifications
You must be signed in to change notification settings - Fork 49
/
build.sbt
145 lines (132 loc) · 4.58 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
import ElasticsearchPluginPlugin.autoImport.*
import org.typelevel.sbt.tpolecat.{CiMode, DevMode}
import org.typelevel.scalacoptions.*
Global / scalaVersion := "3.3.4"
Global / scalacOptions += "-explain"
lazy val CirceVersion = "0.14.10"
lazy val ElasticsearchVersion = "8.15.4"
lazy val Elastic4sVersion = "8.15.4"
lazy val ElastiknnVersion = IO.read(file("version")).strip()
lazy val LuceneVersion = "9.11.1"
// Setting this to simplify local development.
// https://github.com/typelevel/sbt-tpolecat/tree/v0.5.1?tab=readme-ov-file#modes
ThisBuild / tpolecatOptionsMode := {
if (sys.env.get("CI").contains("true")) CiMode else DevMode
}
lazy val TestSettings = Seq(
Test / parallelExecution := false,
Test / logBuffered := false,
Test / testOptions += Tests.Argument("-oD"),
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % Test,
// https://github.com/typelevel/sbt-tpolecat/tree/v0.5.1?tab=readme-ov-file#scalatest-warnings
Test / tpolecatExcludeOptions += ScalacOptions.warnNonUnitStatement
)
lazy val `elastiknn-root` = project
.in(file("."))
.settings(
name := "elastiknn-root"
)
.aggregate(
`elastiknn-api4s`,
`elastiknn-client-elastic4s`,
`elastiknn-lucene`,
`elastiknn-models`,
`elastiknn-jmh-benchmarks`,
`elastiknn-plugin`,
`elastiknn-plugin-integration-tests`
)
lazy val `elastiknn-api4s` = project
.in(file("elastiknn-api4s"))
.settings(
name := "api4s",
version := ElastiknnVersion,
libraryDependencies ++= Seq(
"org.elasticsearch" % "elasticsearch-x-content" % ElasticsearchVersion,
"io.circe" %% "circe-parser" % CirceVersion % Test
),
TestSettings
)
lazy val `elastiknn-client-elastic4s` = project
.in(file("elastiknn-client-elastic4s"))
.dependsOn(`elastiknn-api4s`)
.settings(
name := "client-elastic4s",
version := ElastiknnVersion,
libraryDependencies ++= Seq(
"nl.gn0s1s" %% "elastic4s-client-esjava" % Elastic4sVersion
),
TestSettings
)
lazy val `elastiknn-lucene` = project
.in(file("elastiknn-lucene"))
.dependsOn(`elastiknn-models`)
.settings(
name := "lucene",
version := ElastiknnVersion,
libraryDependencies ++= Seq(
"org.apache.lucene" % "lucene-core" % LuceneVersion,
"org.apache.lucene" % "lucene-analysis-common" % LuceneVersion % Test
),
TestSettings
)
lazy val `elastiknn-models` = project
.in(file("elastiknn-models"))
.dependsOn(`elastiknn-api4s` % "test->compile")
.settings(
name := "models",
version := ElastiknnVersion,
javacOptions ++= Seq(
"--add-modules",
"jdk.incubator.vector",
"--add-exports",
"java.base/jdk.internal.vm.vector=ALL-UNNAMED",
"--add-exports",
"java.base/jdk.internal.vm.annotation=ALL-UNNAMED"
),
TestSettings
)
lazy val `elastiknn-jmh-benchmarks` = project
.in(file("elastiknn-jmh-benchmarks"))
.dependsOn(`elastiknn-models` % "compile->compile;compile->test", `elastiknn-api4s`, `elastiknn-lucene`)
.enablePlugins(JmhPlugin)
.settings(
Jmh / javaOptions ++= Seq("--add-modules", "jdk.incubator.vector"),
libraryDependencies ++= Seq(
"org.eclipse.collections" % "eclipse-collections" % "11.1.0",
"org.eclipse.collections" % "eclipse-collections-api" % "11.1.0"
)
)
lazy val `elastiknn-plugin` = project
.in(file("elastiknn-plugin"))
.enablePlugins(ElasticsearchPluginPlugin)
.dependsOn(
`elastiknn-api4s`,
`elastiknn-lucene` % "compile->compile;test->test",
`elastiknn-client-elastic4s` % "test->compile"
)
.settings(
name := "elastiknn",
version := ElastiknnVersion,
elasticsearchPluginName := "elastiknn",
elasticsearchPluginClassname := "com.klibisz.elastiknn.ElastiknnPlugin",
elasticsearchPluginDescription := "...",
elasticsearchPluginVersion := ElastiknnVersion,
elasticsearchVersion := ElasticsearchVersion,
elasticsearchPluginRunSettings += "elastiknn.jdk-incubator-vector.enabled=true",
elasticsearchPluginEsJavaOpts += "--add-modules jdk.incubator.vector",
libraryDependencies ++= Seq(
"com.google.guava" % "guava" % "33.3.1-jre",
"com.google.guava" % "failureaccess" % "1.0.2",
"org.scalanlp" %% "breeze" % "2.1.0" % Test,
"io.circe" %% "circe-parser" % CirceVersion % Test,
"ch.qos.logback" % "logback-classic" % "1.5.12" % Test
),
TestSettings
)
lazy val `elastiknn-plugin-integration-tests` = project
.in(file("elastiknn-plugin-integration-tests"))
.dependsOn(`elastiknn-plugin` % "test->test")
.settings(
libraryDependencies += "io.circe" %% "circe-generic" % CirceVersion % Test,
TestSettings
)