Skip to content

Commit

Permalink
[BE2] switch to Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Bettens committed Jun 18, 2022
1 parent 2d2ffdf commit b1ef8e8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 25 deletions.
29 changes: 5 additions & 24 deletions be2-scala/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,19 @@ import sbtsonar.SonarPlugin.autoImport.sonarProperties

name := "pop"

scalaVersion := "2.13.7"
scalaVersion := "3.1.2"

// Recommended 2.13 Scala flags (https://nathankleyn.com/2019/05/13/recommended-scalac-flags-for-2-13) slightly adapted for PoP
scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-explaintypes", // Explain type errors in more detail.
"-explain-types", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:package-object-classes", // Class or object defined in package object.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
"-Ywarn-numeric-widen", // Warn when numerics are widened.
"-Ycache-plugin-class-loader:last-modified", // Enables caching of classloaders for compiler plugins
"-Ycache-macro-class-loader:last-modified", // and macro definitions. This can lead to performance improvements.
)

// Reload changes automatically
Expand Down Expand Up @@ -100,9 +81,9 @@ sonarProperties := Map(
"sonar.tests" -> "src/test/scala",

"sonar.sourceEncoding" -> "UTF-8",
"sonar.scala.version" -> "2.13.7",
"sonar.scala.version" -> scalaVersion.value,
// Paths to the test and coverage reports
"sonar.scala.coverage.reportPaths" -> "./target/scala-2.13/scoverage-report/scoverage.xml",
"sonar.scala.coverage.reportPaths" -> "./target/scala-3/scoverage-report/scoverage.xml",
)

assembly/ assemblyMergeStrategy := {
Expand All @@ -122,7 +103,7 @@ val AkkaHttpVersion = "10.2.9"

libraryDependencies ++= Seq(
"com.typesafe.akka" %% "akka-stream-typed" % AkkaVersion, // Akka streams (Graph)
"com.typesafe.akka" %% "akka-http" % AkkaHttpVersion, // Akka http (WebSockets)
("com.typesafe.akka" %% "akka-http" % AkkaHttpVersion).cross(CrossVersion.for3Use2_13), // Akka http (WebSockets)
"com.typesafe.akka" %% "akka-cluster-tools" % AkkaVersion, // Akka distributed publish/subscribe cluster

"ch.qos.logback" % "logback-classic" % "1.1.3" % Runtime, // Akka logging library
Expand Down
1 change: 0 additions & 1 deletion be2-scala/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("com.sonar-scala" % "sbt-sonar" % "2.3.0")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.1.0")
addSbtPlugin("com.rallyhealth.sbt" % "sbt-git-versioning" % "1.6.0")
addSbtPlugin("ch.epfl.scala" % "sbt-scala3-migrate" % "0.5.1")

0 comments on commit b1ef8e8

Please sign in to comment.