Skip to content

Commit fa0946f

Browse files
committed
Remove silencer plugin
1 parent 4c529fb commit fa0946f

File tree

3 files changed

+25
-42
lines changed

3 files changed

+25
-42
lines changed

build.sbt

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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),

project/BuildHelper.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ object BuildHelper {
5959
def commonSettings = Seq(
6060
scalacOptions ++= commonScalacOptions ++ (if (isScala3.value) scalac3Options
6161
else scalac2Options),
62-
libraryDependencies ++= (if (!isScala3.value) Dependencies.silencer else Nil),
6362
libraryDependencies += Dependencies.scalaCollectionCompat.value,
6463
Compile / unmanagedSourceDirectories += (Compile / scalaSource).value.getParentFile / (if (
6564
isScala3.value

project/Dependencies.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ object Dependencies {
66
object versions {
77
val grpc = "1.62.2"
88
val protobuf = "3.25.8"
9-
val silencer = "1.7.17"
109
val collectionCompat = "2.12.0"
1110
val coursier = "2.1.9"
1211
val protocGen = "0.9.9"
@@ -30,13 +29,6 @@ object Dependencies {
3029

3130
val Scala3 = "3.3.6"
3231

33-
val silencer = Seq(
34-
sbt.compilerPlugin(
35-
"com.github.ghik" % "silencer-plugin" % versions.silencer cross CrossVersion.full
36-
),
37-
"com.github.ghik" % "silencer-lib" % versions.silencer % Provided cross CrossVersion.full
38-
)
39-
4032
val protobufJava = "com.google.protobuf" % "protobuf-java" % versions.protobuf
4133
val scalaCollectionCompat = Def.setting {
4234
"org.scala-lang.modules" %%% "scala-collection-compat" % versions.collectionCompat

0 commit comments

Comments
 (0)