Skip to content

Commit

Permalink
WIP scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
larousso committed Oct 8, 2024
1 parent 52f6fed commit 79854a3
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 25 deletions.
4 changes: 3 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import ReleaseTransformations._
import ReleaseTransformations.*

import scala.collection.Seq

name := """nio"""
organization := "fr.maif"
Expand Down
27 changes: 15 additions & 12 deletions nio-provider/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-connectors-kafka" % pekkoKafka,
"de.svenkubiak" % "jBCrypt" % "0.4.1", // ISC/BSD
"com.auth0" % "java-jwt" % javaJwt, // MIT license
"com.github.pureconfig" %% "pureconfig" % pureConfig, // Apache 2.0
"com.github.pureconfig" %% "pureconfig-core" % pureConfig, // Apache 2.0
"com.github.pureconfig" %% "pureconfig-generic-scala3" % pureConfig, // Apache 2.0
"org.scalactic" %% "scalactic" % scalaticVersion, // Apache 2.0
"org.webjars" % "swagger-ui" % "3.12.1",
"org.typelevel" %% "cats-core" % catsVersion, // MIT
Expand All @@ -37,16 +38,18 @@ scalacOptions ++= Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
"-language:existentials"
"-language:existentials",
"-Ykind-projector:underscores",
"Xsource:3"
)

/// ASSEMBLY CONFIG

mainClass in assembly := Some("play.core.server.ProdServerStart")
test in assembly := {}
assemblyJarName in assembly := "nio-provider.jar"
fullClasspath in assembly += Attributed.blank(PlayKeys.playPackageAssets.value)
assemblyMergeStrategy in assembly := {
assembly / mainClass := Some("play.core.server.ProdServerStart")
assembly / test := {}
assembly / assemblyJarName := "nio-provider.jar"
assembly / fullClasspath += Attributed.blank(PlayKeys.playPackageAssets.value)
assembly / assemblyMergeStrategy := {
case PathList("javax", xs @ _*) => MergeStrategy.first
case PathList("META-INF", "native", xs @ _*) => MergeStrategy.first
case PathList("org", "apache", "commons", "logging", xs @ _*) => MergeStrategy.discard
Expand All @@ -65,18 +68,18 @@ assemblyMergeStrategy in assembly := {

lazy val packageAll = taskKey[Unit]("PackageAll")
packageAll := {
(dist in Compile).value
(assembly in Compile).value
(Compile / dist).value
(Compile / assembly).value
}

/// DOCKER CONFIG

dockerExposedPorts := Seq(
9000
)
packageName in Docker := "nio-provider"
Docker / packageName := "nio-provider"

maintainer in Docker := "MAIF Team <maif@maif.fr>"
Docker / maintainer := "MAIF Team <maif@maif.fr>"

dockerBaseImage := "openjdk:8"

Expand Down Expand Up @@ -109,4 +112,4 @@ dockerEntrypoint ++= Seq(

dockerUpdateLatest := true

packageName in Universal := s"nio-provider"
Universal / packageName := s"nio-provider"
16 changes: 10 additions & 6 deletions nio-server/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ lazy val `nio-server` = (project in file("."))

scalaVersion := "2.13.14"

semanticdbVersion := scalafixSemanticdb.revision

resolvers ++= Seq(
Resolver.jcenterRepo,
"Maven central" at "https://repo1.maven.org/maven2/"
Expand Down Expand Up @@ -38,8 +40,9 @@ libraryDependencies ++= Seq(
"org.apache.commons" % "commons-lang3" % "3.11",
"de.svenkubiak" % "jBCrypt" % "0.4.1", // ISC/BSD
"com.auth0" % "java-jwt" % javaJwt, // MIT license
"com.github.pureconfig" %% "pureconfig" % pureConfig, // Apache 2.0
"org.scalactic" %% "scalactic" % scalaticVersion, // Apache 2.0
"com.github.pureconfig" %% "pureconfig-core" % pureConfig, // Apache 2.0
// "com.github.pureconfig" %% "pureconfig-generic-scala3" % pureConfig, // Apache 2.0
// "org.scalactic" %% "scalactic" % scalaticVersion, // Apache 2.0
"org.webjars" % "swagger-ui" % "3.12.1",
"org.typelevel" %% "cats-core" % catsVersion, // MIT
"com.softwaremill.macwire" %% "macros" % macwireVersion % "provided",
Expand All @@ -57,7 +60,8 @@ scalacOptions ++= Seq(
"-feature",
"-language:higherKinds",
"-language:implicitConversions",
"-language:existentials"
"-language:existentials",
"Xsource:3"
)

/// ASSEMBLY CONFIG
Expand Down Expand Up @@ -95,9 +99,9 @@ packageAll := {
dockerExposedPorts := Seq(
9000
)
packageName in Docker := "nio"
Docker / packageName := "nio"

maintainer in Docker := "MAIF Team <maif@maif.fr>"
Docker / maintainer := "MAIF Team <maif@maif.fr>"

dockerBaseImage := "openjdk:8"

Expand Down Expand Up @@ -134,4 +138,4 @@ dockerEntrypoint ++= Seq(

dockerUpdateLatest := true

packageName in Universal := s"nio"
Universal / packageName := s"nio"
10 changes: 5 additions & 5 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ object Dependencies {
val reactiveMongoVersion = "1.1.0"
val pekko = "1.1.1"
val pekkoKafka = "1.1.0"
val pureConfig = "0.14.0"
val scalaticVersion = "3.2.0"
val catsVersion = "2.2.0"
val macwireVersion = "2.3.7"
val metricsVersion = "4.0.2"
val pekkoS3Version = "1.0.2"
val pureConfig = "0.17.7"
val scalaticVersion = "3.2.19"
val catsVersion = "2.12.0"
val macwireVersion = "2.6.2"
val metricsVersion = "4.0.2"
val scalatestPlay = "7.0.1"
val javaJwt = "3.11.0"
}
4 changes: 4 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") // Apache 2.0

addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") // Apache 2.0

addSbtPlugin("ch.epfl.scala" % "sbt-scala3-migrate" % "0.6.1")

addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.13.0")

ThisBuild / libraryDependencySchemes += "org.scala-lang.modules" %% "scala-xml" % VersionScheme.Always
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "2.0.6-SNAPSHOT"
ThisBuild / version := "2.0.6-SNAPSHOT"

0 comments on commit 79854a3

Please sign in to comment.