From af3a13fbed9536d35ed190a8e403f8df474f1538 Mon Sep 17 00:00:00 2001 From: Juan Pedro Moreno <4879373+juanpedromoreno@users.noreply.github.com> Date: Wed, 15 May 2024 18:11:11 +0200 Subject: [PATCH] Upgrades scala 2&3 and sbt (#1779) * Upgrades scala 2&3 and sbt * Disables fatal warnings in rpc-service * Disables fatal warnings in somo other modules * Disables fatal warnings in test modules --- build.sbt | 4 ++-- project/ProjectPlugin.scala | 21 +++++++++++++++------ project/build.properties | 2 +- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/build.sbt b/build.sbt index b25a27efd..6c0a17f46 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,5 @@ -val scala213 = "2.13.12" -val scala3 = "3.3.3" +val scala213 = "2.13.14" +val scala3 = "3.4.1" ThisBuild / organization := "io.higherkindness" ThisBuild / githubOrganization := "47degrees" diff --git a/project/ProjectPlugin.scala b/project/ProjectPlugin.scala index 828472235..3926e7674 100644 --- a/project/ProjectPlugin.scala +++ b/project/ProjectPlugin.scala @@ -66,7 +66,8 @@ object ProjectPlugin extends AutoPlugin { libraryDependencies ++= scalaVersionSpecificDeps(3)( "com.sksamuel.avro4s" %% "avro4s-core" % "5.0.9" ).value, - scalacOptions --= on(2, 13)("-Wunused:patvars").value + scalacOptions --= on(2, 13)("-Wunused:patvars").value, + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val macroSettings: Seq[Setting[_]] = Seq( @@ -83,7 +84,8 @@ object ProjectPlugin extends AutoPlugin { lazy val clientNettySettings: Seq[Def.Setting[_]] = Seq( libraryDependencies ++= Seq( "io.grpc" % "grpc-netty" % V.grpc - ) + ), + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val clientOkHttpSettings: Seq[Def.Setting[_]] = Seq( @@ -105,13 +107,15 @@ object ProjectPlugin extends AutoPlugin { "org.typelevel" %% "cats-effect" % V.catsEffect ), muSrcGenIdlType := IdlType.Proto, - scalacOptions += "-Wconf:src=src_managed/.*:silent" + scalacOptions += "-Wconf:src=src_managed/.*:silent", + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val serverSettings: Seq[Def.Setting[_]] = Seq( libraryDependencies ++= Seq( "io.grpc" % "grpc-netty" % V.grpc - ) + ), + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val configSettings: Seq[Def.Setting[_]] = Seq( @@ -127,7 +131,8 @@ object ProjectPlugin extends AutoPlugin { lazy val prometheusMetricsSettings: Seq[Def.Setting[_]] = Seq( libraryDependencies ++= Seq( "io.prometheus" % "simpleclient" % V.prometheus - ) + ), + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val dropwizardMetricsSettings: Seq[Def.Setting[_]] = Seq( @@ -209,6 +214,7 @@ object ProjectPlugin extends AutoPlugin { publishArtifact := false, Test / parallelExecution := false, testFrameworks += new TestFramework("munit.Framework"), + scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( "io.grpc" % "grpc-core" % V.grpc, "org.scalameta" %% "munit-scalacheck" % V.munit, @@ -219,6 +225,7 @@ object ProjectPlugin extends AutoPlugin { publishArtifact := false, Test / parallelExecution := false, testFrameworks += new TestFramework("munit.Framework"), + scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( "io.grpc" % "grpc-netty" % V.grpc % Test, "io.netty" % "netty-tcnative-boringssl-static" % V.nettySSL % Test, @@ -235,7 +242,8 @@ object ProjectPlugin extends AutoPlugin { lazy val protobufSrcGenSettings = Seq( muSrcGenIdlType := IdlType.Proto, - scalacOptions += "-Wconf:src=src_managed/.*:silent" + scalacOptions += "-Wconf:src=src_managed/.*:silent", + scalacOptions --= on(3, 4)("-Xfatal-warnings").value ) lazy val protobufRPCTestSettings = testSettings ++ protobufSrcGenSettings @@ -261,6 +269,7 @@ object ProjectPlugin extends AutoPlugin { lazy val haskellIntegrationTestSettings = Seq( publishArtifact := false, Test / parallelExecution := false, + scalacOptions -= "-Xfatal-warnings", libraryDependencies ++= Seq( "co.fs2" %% "fs2-core" % V.fs2, "org.scalameta" %% "munit" % V.munit % Test, diff --git a/project/build.properties b/project/build.properties index 49214c4bb..be54e7763 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.9.9 +sbt.version = 1.10.0