chore: Remove serialversion-remover-plugin (#2204)
This commit is contained in:
parent
8c48393cd3
commit
3969ae8276
4 changed files with 2 additions and 71 deletions
19
build.sbt
19
build.sbt
|
|
@ -107,8 +107,7 @@ lazy val root = Project(id = "pekko", base = file("."))
|
||||||
benchJmh,
|
benchJmh,
|
||||||
protobufV3,
|
protobufV3,
|
||||||
pekkoScalaNightly,
|
pekkoScalaNightly,
|
||||||
docs,
|
docs))
|
||||||
serialversionRemoverPlugin))
|
|
||||||
.settings(
|
.settings(
|
||||||
Compile / headerCreate / unmanagedSources := (baseDirectory.value / "project").**("*.scala").get)
|
Compile / headerCreate / unmanagedSources := (baseDirectory.value / "project").**("*.scala").get)
|
||||||
.settings(PekkoBuild.welcomeSettings)
|
.settings(PekkoBuild.welcomeSettings)
|
||||||
|
|
@ -120,7 +119,6 @@ lazy val actor = pekkoModule("actor")
|
||||||
.settings(AutomaticModuleName.settings("pekko.actor"))
|
.settings(AutomaticModuleName.settings("pekko.actor"))
|
||||||
.settings(AddMetaInfLicenseFiles.actorSettings)
|
.settings(AddMetaInfLicenseFiles.actorSettings)
|
||||||
.settings(VersionGenerator.settings)
|
.settings(VersionGenerator.settings)
|
||||||
.settings(serialversionRemoverPluginSettings)
|
|
||||||
.enablePlugins(BoilerplatePlugin, SbtOsgi)
|
.enablePlugins(BoilerplatePlugin, SbtOsgi)
|
||||||
|
|
||||||
lazy val actorTests = pekkoModule("actor-tests")
|
lazy val actorTests = pekkoModule("actor-tests")
|
||||||
|
|
@ -406,7 +404,6 @@ lazy val remote =
|
||||||
.settings(OSGi.remote)
|
.settings(OSGi.remote)
|
||||||
.settings(Protobuf.settings)
|
.settings(Protobuf.settings)
|
||||||
.settings(Test / parallelExecution := false)
|
.settings(Test / parallelExecution := false)
|
||||||
.settings(serialversionRemoverPluginSettings)
|
|
||||||
.enablePlugins(DependWalkerPlugin, SbtOsgi)
|
.enablePlugins(DependWalkerPlugin, SbtOsgi)
|
||||||
|
|
||||||
lazy val remoteTests = pekkoModule("remote-tests")
|
lazy val remoteTests = pekkoModule("remote-tests")
|
||||||
|
|
@ -602,20 +599,6 @@ lazy val billOfMaterials = Project("bill-of-materials", file("bill-of-materials"
|
||||||
bomIncludeProjects := userProjects,
|
bomIncludeProjects := userProjects,
|
||||||
description := s"${description.value} (depending on Scala ${CrossVersion.binaryScalaVersion(scalaVersion.value)})")
|
description := s"${description.value} (depending on Scala ${CrossVersion.binaryScalaVersion(scalaVersion.value)})")
|
||||||
|
|
||||||
lazy val serialversionRemoverPlugin =
|
|
||||||
Project(id = "serialVersionRemoverPlugin", base = file("plugins/serialversion-remover-plugin")).settings(
|
|
||||||
scalaVersion := Dependencies.scala3Version,
|
|
||||||
libraryDependencies += ("org.scala-lang" %% "scala3-compiler" % Dependencies.scala3Version),
|
|
||||||
Compile / doc / sources := Nil,
|
|
||||||
Compile / publishArtifact := false)
|
|
||||||
|
|
||||||
lazy val serialversionRemoverPluginSettings = Seq(
|
|
||||||
Compile / scalacOptions ++= (
|
|
||||||
if (scalaVersion.value.startsWith("3."))
|
|
||||||
Seq("-Xplugin:" + (serialversionRemoverPlugin / Compile / Keys.`package`).value.getAbsolutePath.toString)
|
|
||||||
else Nil
|
|
||||||
))
|
|
||||||
|
|
||||||
def pekkoModule(moduleName: String): Project =
|
def pekkoModule(moduleName: String): Project =
|
||||||
Project(id = moduleName, base = file(moduleName))
|
Project(id = moduleName, base = file(moduleName))
|
||||||
.enablePlugins(ReproducibleBuildsPlugin)
|
.enablePlugins(ReproducibleBuildsPlugin)
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
pluginClass=org.apache.pekko.SerialVersionRemoverPlugin
|
|
||||||
|
|
@ -1,51 +0,0 @@
|
||||||
/*
|
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
* license agreements; and to You under the Apache License, version 2.0:
|
|
||||||
*
|
|
||||||
* https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* This file is part of the Apache Pekko project, which was derived from Akka.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2021-2022 Lightbend Inc. <https://www.lightbend.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.apache.pekko
|
|
||||||
|
|
||||||
import dotty.tools.dotc.ast.Trees._
|
|
||||||
import dotty.tools.dotc.ast.tpd
|
|
||||||
import dotty.tools.dotc.core.Contexts.Context
|
|
||||||
import dotty.tools.dotc.core.Symbols._
|
|
||||||
import dotty.tools.dotc.plugins.{ PluginPhase, StandardPlugin }
|
|
||||||
import dotty.tools.backend.jvm.GenBCode
|
|
||||||
import dotty.tools.dotc.core.Flags._
|
|
||||||
import dotty.tools.dotc.typer.FrontEnd
|
|
||||||
|
|
||||||
class SerialVersionRemoverPlugin extends StandardPlugin {
|
|
||||||
|
|
||||||
val name = "serialversion-remover-plugin"
|
|
||||||
val description = "Remove SerialVersionUid annotation from traits"
|
|
||||||
|
|
||||||
override def init(options: List[String]): List[PluginPhase] = {
|
|
||||||
(new SerialVersionRemoverPhase()) :: Nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class SerialVersionRemoverPhase extends PluginPhase {
|
|
||||||
import tpd._
|
|
||||||
|
|
||||||
val phaseName = "serialversion-remover"
|
|
||||||
|
|
||||||
override val runsBefore = Set(GenBCode.name)
|
|
||||||
|
|
||||||
override def transformTypeDef(tree: TypeDef)(implicit ctx: Context): Tree = {
|
|
||||||
val symbol = tree.symbol
|
|
||||||
if (tree.symbol.getAnnotation(defn.SerialVersionUIDAnnot).isDefined && tree.symbol.is(Trait)) {
|
|
||||||
tree.symbol.removeAnnotation(defn.SerialVersionUIDAnnot)
|
|
||||||
}
|
|
||||||
|
|
||||||
tree
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -119,7 +119,7 @@ object PekkoDisciplinePlugin extends AutoPlugin {
|
||||||
lazy val disciplineSettings =
|
lazy val disciplineSettings =
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
nowarnSettings ++ Seq(
|
nowarnSettings ++ Seq(
|
||||||
Compile / scalacOptions ++= Seq("-Xfatal-warnings"),
|
Compile / scalacOptions ++= (if (scalaVersion.value.startsWith("3.")) Nil else Seq("-Xfatal-warnings")),
|
||||||
Test / scalacOptions --= testUndiscipline,
|
Test / scalacOptions --= testUndiscipline,
|
||||||
Compile / javacOptions ++= (
|
Compile / javacOptions ++= (
|
||||||
if (jvmIgnoreWarnings || scalaVersion.value.startsWith("3.") || nonFatalJavaWarningsFor(name.value)) {
|
if (jvmIgnoreWarnings || scalaVersion.value.startsWith("3.") || nonFatalJavaWarningsFor(name.value)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue