forked from alexklibisz/elastiknn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
138 lines (126 loc) · 4.32 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
import ElasticsearchPluginPlugin.autoImport.*
import org.typelevel.scalacoptions.*
Global / scalaVersion := "3.3.3"
Global / scalacOptions += "-explain"
lazy val CirceVersion = "0.14.7"
lazy val ElasticsearchVersion = "8.13.3"
lazy val Elastic4sVersion = "8.11.5"
lazy val ElastiknnVersion = IO.read(file("version")).strip()
lazy val LuceneVersion = "9.10.0"
lazy val TestSettings = Seq(
Test / parallelExecution := false,
Test / logBuffered := false,
Test / testOptions += Tests.Argument("-oD"),
libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.18" % 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(
"com.sksamuel.elastic4s" %% "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.2.0-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.4" % 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
)