@@ -58,12 +58,6 @@ lazy val runtime = (projectMatrix in file("scalapb-runtime"))
5858 ),
5959 testFrameworks += new TestFramework (" munit.Framework" ),
6060 Compile / unmanagedResourceDirectories += (LocalRootProject / baseDirectory).value / " protobuf" ,
61- scalacOptions ++= (if (! isScala3.value)
62- Seq (
63- " -P:silencer:globalFilters=avaGenerateEqualsAndHash in class .* is deprecated" ,
64- " -P:silencer:lineContentFilters=import scala.collection.compat._"
65- )
66- else Nil ),
6761 mimaPreviousArtifacts := Set (" com.thesamet.scalapb" %% " scalapb-runtime" % MimaPreviousVersion ),
6862 mimaBinaryIssueFilters ++= Seq (
6963 ProblemFilters .exclude[ReversedMissingMethodProblem ](" scalapb.GeneratedEnum.asRecognized" ),
@@ -84,7 +78,17 @@ lazy val runtime = (projectMatrix in file("scalapb-runtime"))
8478 Compile / unmanagedSourceDirectories += (Compile / scalaSource).value.getParentFile / " jvm-native" ,
8579 Compile / PB .protoSources := Seq (
8680 (LocalRootProject / baseDirectory).value / " protobuf"
87- )
81+ ),
82+ scalacOptions ++= {
83+ CrossVersion .partialVersion(scalaVersion.value) match {
84+ case Some ((v, n)) if v == 2 && n >= 13 | v == 3 =>
85+ Seq (
86+ " -Wconf:msg=[Uu]nused&origin=scala[.]collection[.]compat._:s" ,
87+ " -Wconf:cat=deprecation&msg=.*[Jj]avaGenerateEqualsAndHash.*deprecated.*:s"
88+ )
89+ case _ => Seq .empty // Scala 2.12 or other (e.g. pre-2.13)
90+ }
91+ }
8892 )
8993 )
9094 .jsPlatform(
@@ -257,11 +261,6 @@ lazy val proptest = (projectMatrix in file("proptest"))
257261 scalaTest.value % " test" ,
258262 scalaTestPlusScalaCheck.value % " test"
259263 ),
260- scalacOptions ++= (if (! isScala3.value)
261- Seq (
262- " -P:silencer:lineContentFilters=import scala.collection.compat._"
263- )
264- else Nil ),
265264 libraryDependencies ++= (if (! isScala3.value)
266265 Seq (" org.scala-lang" % " scala-compiler" % scalaVersion.value)
267266 else
@@ -318,6 +317,19 @@ val e2eCommonSettings = commonSettings ++ Seq(
318317 (scalaTestPlusScalaCheck.value % " test" )
319318 ),
320319 Compile / PB .recompile := true , // always regenerate protos, not cache
320+ scalacOptions ++= {
321+ CrossVersion .partialVersion(scalaVersion.value) match {
322+ case Some ((v, n)) if v == 2 && n >= 13 | v == 3 =>
323+ Seq (
324+ " -Wconf:msg=[uU]nused&origin=com.thesamet.pb.MisplacedMapper.weatherMapper:s" ,
325+ " -Wconf:cat=deprecation&src=.*custom_options.*:s" ,
326+ " -Wconf:cat=deprecation&src=.*CustomAnnotationProto.scala.*:s" ,
327+ " -Wconf:cat=deprecation&src=.*TestDeprecatedFields.scala.*:s" ,
328+ " -Wconf:msg=Unused import:s,origin=com.thesamet.proto.e2e.custom_options_use.FooMessage:s"
329+ )
330+ case _ => Seq .empty
331+ }
332+ },
321333 codeGenClasspath := (compilerPluginJVM2_12 / Compile / fullClasspath).value
322334)
323335
@@ -329,12 +341,6 @@ lazy val e2eGrpc = (projectMatrix in file("e2e-grpc"))
329341 .settings(e2eCommonSettings)
330342 .settings(
331343 libraryDependencies += (grpcProtocGen asProtocPlugin),
332- scalacOptions ++= (if (! isScala3.value)
333- Seq (
334- " -P:silencer:pathFilters=ServerReflectionGrpc.scala;ReflectionProto.scala" ,
335- " -P:silencer:lineContentFilters=import com.thesamet.pb.MisplacedMapper.weatherMapper"
336- )
337- else Nil ),
338344 Compile / PB .protoSources += (Compile / PB .externalIncludePath).value / " grpc" / " reflection" ,
339345 Compile / PB .targets := Seq (
340346 PB .gens.java(versions.protobuf) -> (Compile / sourceManaged).value,
@@ -352,13 +358,6 @@ lazy val e2eWithJava = (projectMatrix in file("e2e-withjava"))
352358 .dependsOn(runtime)
353359 .enablePlugins(LocalCodeGenPlugin )
354360 .settings(e2eCommonSettings)
355- .settings(
356- scalacOptions ++= (if (! isScala3.value)
357- Seq (
358- " -P:silencer:lineContentFilters=import com.thesamet.pb.MisplacedMapper.weatherMapper"
359- )
360- else Nil )
361- )
362361 .jvmPlatform(
363362 Seq (Scala212 , Scala213 , Scala3 ),
364363 settings = Seq (
@@ -368,7 +367,7 @@ lazy val e2eWithJava = (projectMatrix in file("e2e-withjava"))
368367 genModule(" scalapb.ScalaPbCodeGenerator$" ),
369368 Seq (" java_conversions" )
370369 ) -> (Compile / sourceManaged).value
371- )
370+ ),
372371 )
373372 )
374373 .jsPlatform(
@@ -433,13 +432,6 @@ lazy val e2e = (projectMatrix in file("e2e"))
433432 )
434433 .settings(e2eCommonSettings)
435434 .settings(
436- scalacOptions ++= (if (! isScala3.value)
437- Seq (
438- " -P:silencer:globalFilters=value deprecatedInt32 in class TestDeprecatedFields is deprecated" ,
439- " -P:silencer:pathFilters=custom_options_use;CustomAnnotationProto.scala;TestDeprecatedFields.scala" ,
440- " -P:silencer:lineContentFilters=import com.thesamet.pb.MisplacedMapper.weatherMapper"
441- )
442- else Nil ),
443435 Compile / PB .protoSources ++= (if (isScala3.value)
444436 Seq (sourceDirectory.value / " main" / " protobuf-scala3" )
445437 else Nil ),
0 commit comments