Skip to content

Commit

Permalink
#360: Migrate to SBT (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexklibisz authored Sep 24, 2022
1 parent 20751c3 commit e28378e
Show file tree
Hide file tree
Showing 21 changed files with 380 additions and 510 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
cache: 'sbt'
- name: Misc. Setup
run: |
sudo snap install task --classic
sudo sysctl -w vm.max_map_count=262144
- name: Compile
run: task jvm:compile
- name: Docs
run: task jvm:docs
- name: Publish Local
run: task jvm:plugin:publish:local
- name: Run Cluster
Expand All @@ -54,7 +52,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
cache: 'sbt'
- uses: actions/setup-python@v2
with:
python-version: '3.7.5'
Expand All @@ -81,7 +79,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
cache: 'sbt'
- uses: actions/setup-python@v2
with:
python-version: '3.6'
Expand Down Expand Up @@ -133,7 +131,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
cache: 'sbt'
- uses: actions/setup-python@v2
with:
python-version: '3.7.5'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
distribution: 'adopt'
java-version: 17
cache: 'gradle'
cache: 'sbt'
- uses: actions/setup-python@v2
with:
python-version: '3.7.5'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ target
release.md
*.csv
.task
.bsp

# Ignore Gradle GUI config
gradle-app.setting
Expand Down
1 change: 0 additions & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ vars:
sh: pwd
GITHUB_URL: https://github.com/alexklibisz/elastiknn
MAVEN_URL: https://repo1.maven.org/maven2/com/klibisz/elastiknn
CMD_GRADLE: "./gradlew --console=plain"
SITE_SSH_ALIAS: elastiknn-site
SITE_MAIN_DIR: elastiknn.com
SITE_ARCH_DIR: archive.elastiknn.com
Expand Down
182 changes: 0 additions & 182 deletions build.gradle

This file was deleted.

122 changes: 122 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
Global / scalaVersion := "2.13.6"

lazy val CirceVersion = "0.14.1"
lazy val CirceGenericExtrasVersion = "0.14.1"
lazy val ElasticsearchVersion = "8.4.2"
lazy val Elastic4sVersion = "8.0.0"
lazy val ElastiknnVersion = IO.read(file("version")).strip()
lazy val LuceneVersion = "9.3.0"

lazy val ScalacOptions = List("-Xfatal-warnings", "-Ywarn-unused:imports")

lazy val `elastiknn-root` = project
.in(file("."))
.settings(
name := "elastiknn-root"
)
.aggregate(
`elastiknn-api4s`,
`elastiknn-client-elastic4s`,
`elastiknn-lucene`,
`elastiknn-models`,
`elastiknn-plugin`,
`elastiknn-testing`
)

lazy val `elastiknn-api4s` = project
.in(file("elastiknn-api4s"))
.settings(
name := "api4s",
version := ElastiknnVersion,
libraryDependencies ++= Seq(
"org.elasticsearch" % "elasticsearch-x-content" % ElasticsearchVersion
),
scalacOptions ++= ScalacOptions
)

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
),
scalacOptions ++= ScalacOptions
)

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
),
scalacOptions ++= ScalacOptions
)

lazy val `elastiknn-models` = project
.in(file("elastiknn-models"))
.settings(
name := "models",
version := ElastiknnVersion,
javacOptions ++= Seq(
// Needed for @ForceInline annotation.
"--add-exports",
"java.base/jdk.internal.vm.annotation=ALL-UNNAMED"
),
scalacOptions ++= ScalacOptions
)

import ElasticsearchPluginPlugin.autoImport._

lazy val `elastiknn-plugin` = project
.in(file("elastiknn-plugin"))
.enablePlugins(ElasticsearchPluginPlugin)
.dependsOn(
`elastiknn-api4s`,
`elastiknn-lucene`
)
.settings(
name := "elastiknn",
version := ElastiknnVersion,
elasticsearchPluginName := "elastiknn",
elasticsearchPluginClassname := "com.klibisz.elastiknn.ElastiknnPlugin",
elasticsearchPluginDescription := "...",
elasticsearchPluginVersion := ElastiknnVersion,
elasticsearchVersion := ElasticsearchVersion,
libraryDependencies ++= Seq(
"com.google.guava" % "guava" % "28.1-jre",
"com.google.guava" % "failureaccess" % "1.0.1"
),
scalacOptions ++= ScalacOptions
)

lazy val `elastiknn-testing` = project
.in(file("elastiknn-testing"))
.dependsOn(`elastiknn-client-elastic4s`, `elastiknn-plugin`)
.settings(
Test / parallelExecution := false,
libraryDependencies ++= Seq(
"io.circe" %% "circe-generic-extras" % CirceGenericExtrasVersion,
"io.circe" %% "circe-parser" % CirceVersion,
"org.apache.lucene" % "lucene-core" % LuceneVersion,
"org.elasticsearch" % "elasticsearch" % ElasticsearchVersion,
"org.scalanlp" %% "breeze" % "1.3",
"org.scalatest" %% "scalatest" % "3.2.0",
"ch.qos.logback" % "logback-classic" % "1.2.3" % Test,
"com.klibisz.futil" %% "futil" % "0.1.2" % Test,
"com.typesafe" % "config" % "1.4.0" % Test,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2" % Test,
"com.vladsch.flexmark" % "flexmark-all" % "0.35.10" % Test,
"org.apache.commons" % "commons-math3" % "3.6.1" % Test,
"org.apache.lucene" % "lucene-analysis-common" % LuceneVersion % Test,
"org.apache.lucene" % "lucene-backward-codecs" % LuceneVersion % Test,
"org.elasticsearch" % "elasticsearch" % ElasticsearchVersion % Test,
"org.pegdown" % "pegdown" % "1.4.2" % Test
),
scalacOptions ++= ScalacOptions
)
Loading

0 comments on commit e28378e

Please sign in to comment.