Skip to content

Commit

Permalink
Remove play module, use Scala 3 exclusively
Browse files Browse the repository at this point in the history
  • Loading branch information
lenguyenthanh committed Jun 3, 2024
1 parent 7806225 commit f6e7478
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 293 deletions.
18 changes: 1 addition & 17 deletions .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version = "3.8.1"
runner.dialect = scala213
runner.dialect = scala3

align.preset = more
maxColumn = 110
Expand All @@ -15,20 +15,4 @@ fileOverride {
runner.dialect = scala213
}

"glob:**/modules/api/**" {
runner.dialect = scala3
}

"glob:**/modules/client/**" {
runner.dialect = scala3
}

"glob:**/modules/app/**" {
runner.dialect = scala3
}

"glob:**/modules/e2e/**" {
runner.dialect = scala3
}

}
30 changes: 2 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import org.typelevel.scalacoptions.{ ScalacOption, ScalacOptions }
import Dependencies.*

lazy val scala213 = "2.13.14"
lazy val scala3 = "3.4.2"
lazy val supportedScalaVersions = List(scala213, scala3)

inThisBuild(
Seq(
scalaVersion := scala213,
scalaVersion := "3.4.2",
versionScheme := Some("early-semver"),
version := "3.0.0-RC5",
organization := "org.lichess.search",
Expand All @@ -21,7 +17,6 @@ inThisBuild(
)

val commonSettings = Seq(
scalaVersion := scala3,
excludeDependencies ++= Seq(
"org.typelevel" % "cats-core_2.13",
"org.typelevel" % "cats-kernel_2.13",
Expand All @@ -37,8 +32,6 @@ val commonSettings = Seq(
lazy val core = project
.in(file("modules/core"))
.settings(
crossScalaVersions := supportedScalaVersions,
tpolecatScalacOptions ++= Set(ScalacOptions.source3),
name := "lila-search-core",
publish := {},
publish / skip := true,
Expand All @@ -49,25 +42,6 @@ lazy val core = project
)
)

lazy val play = project
.in(file("play"))
.enablePlugins(PlayScala)
.disablePlugins(PlayFilters)
.settings(
tpolecatExcludeOptions += ScalacOptions.fatalWarnings,
name := "lila-search",
publish := {},
publish / skip := true,
libraryDependencies ++= Seq(
"com.typesafe.play" %% "play-json" % "2.9.4",
"com.typesafe.play" %% "play-json-joda" % "2.9.4"
),
// Play provides two styles of routers, one expects its actions to be injected, the
// other, legacy style, accesses its actions statically.
routesGenerator := InjectedRoutesGenerator
)
.dependsOn(core)

lazy val api = (project in file("modules/api"))
.enablePlugins(Smithy4sCodegenPlugin)
.settings(
Expand Down Expand Up @@ -128,4 +102,4 @@ val e2e = (project in file("modules/e2e"))
lazy val root = project
.in(file("."))
.settings(publish := {}, publish / skip := true)
.aggregate(core, play, api, app, client, e2e)
.aggregate(core, api, app, client, e2e)
2 changes: 1 addition & 1 deletion modules/app/src/main/scala/service.search.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class SearchServiceImpl(esClient: ESClient[IO])(using logger: Logger[IO]) extend

override def deleteByIds(index: Index, ids: List[String]): IO[Unit] =
esClient
.deleteMany(index.transform, ids.map(Id))
.deleteMany(index.transform, ids.map(Id.apply))
.handleErrorWith: e =>
logger.error(e)(s"Error in deleteByIds: index=$index, ids=$ids") *>
IO.raiseError(InternalServerError("Internal server error"))
Expand Down
43 changes: 0 additions & 43 deletions play/app/src/main/scala/AppLoader.scala

This file was deleted.

21 changes: 0 additions & 21 deletions play/app/src/main/scala/Chronometer.scala

This file was deleted.

37 changes: 0 additions & 37 deletions play/app/src/main/scala/JsonParser.scala

This file was deleted.

102 changes: 0 additions & 102 deletions play/app/src/main/scala/controllers/WebApi.scala

This file was deleted.

9 changes: 0 additions & 9 deletions play/conf/application.conf

This file was deleted.

26 changes: 0 additions & 26 deletions play/conf/logback.xml

This file was deleted.

8 changes: 0 additions & 8 deletions play/conf/routes

This file was deleted.

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.20")
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.2")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.0")
addSbtPlugin("nl.gn0s1s" % "sbt-dotenv" % "3.0.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1")

0 comments on commit f6e7478

Please sign in to comment.