Skip to content

Commit

Permalink
remove shaded protobuf-java v2 jar (pekko-protobuf) (#489)
Browse files Browse the repository at this point in the history
* remove protobuf v2 support

* Update OSGi.scala

* ci issue

* remove refs to pekko-protobuf classes

* fix comment

* update comments

* Update Serialization.scala
  • Loading branch information
pjfanning authored Aug 1, 2023
1 parent c18a81a commit 964dcf5
Show file tree
Hide file tree
Showing 58 changed files with 6 additions and 49,069 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scala3-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- serialization-jackson/test
- stream/test stream-testkit/test stream-tests/test stream-typed/test
- stream-tests-tck/test
- remote/test remote-tests/test protobuf/test protobuf-v3/test
- remote/test remote-tests/test protobuf-v3/test
fail-fast: true
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scala3-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- serialization-jackson/Test/compile
- stream/Test/compile stream-testkit/Test/compile stream-tests/Test/compile stream-typed/Test/compile
- stream-tests-tck/Test/compile
- remote/Test/compile remote-tests/Test/compile protobuf/Test/compile protobuf-v3/Test/compile
- remote/Test/compile remote-tests/Test/compile protobuf-v3/Test/compile
fail-fast: true
steps:
- name: Checkout
Expand Down
6 changes: 0 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,6 @@ Copyright 2014 - 2016 Real Logic Ltd.

---------------

pekko-protobuf contains the sources of Google protobuf 2.5.0 runtime support,
moved into the source package `org.apache.pekko.protobuf` so as to avoid version conflicts.
For license information see COPYING.protobuf

---------------

pekko-persistence-typed contains AuctionEntity.java in its test source.
This code is derived from a class in Lagom <https://github.com/lagom>,
licensed under the Apache 2.0 license.
Expand Down
1 change: 0 additions & 1 deletion actor/src/main/resources/reference.conf
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,6 @@ pekko {
"com.google.protobuf.GeneratedMessage",
"com.google.protobuf.GeneratedMessageV3",
"scalapb.GeneratedMessageCompanion",
"org.apache.pekko.protobuf.GeneratedMessage",
"org.apache.pekko.protobufv3.internal.GeneratedMessageV3"
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
private[pekko] val bindings: immutable.Seq[ClassSerializer] = {
val fromConfig = for {
(className: String, alias: String) <- settings.SerializationBindings
if alias != "none" && checkGoogleProtobuf(className) && checkPekkoProtobuf(className)
if alias != "none" && checkGoogleProtobuf(className)
} yield (system.dynamicAccess.getClassFor[Any](className).get, serializers(alias))

val fromSettings = serializerDetails.flatMap { detail =>
Expand Down Expand Up @@ -484,10 +484,6 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
// include "com.google.protobuf.GeneratedMessage" = proto in configured serialization-bindings.
private def checkGoogleProtobuf(className: String): Boolean = checkClass("com.google.protobuf", className)

// pekko-protobuf is now not a dependency of remote so only load if user has explicitly added it
// remove in v1.1
private def checkPekkoProtobuf(className: String): Boolean = checkClass("org.apache.pekko.protobuf", className)

private def checkClass(prefix: String, className: String): Boolean =
!className.startsWith(prefix) || system.dynamicAccess.getClassFor[Any](className).isSuccess

Expand Down
11 changes: 0 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ lazy val userProjects: Seq[ProjectReference] = List[ProjectReference](
persistenceQuery,
persistenceTyped,
persistenceTestkit,
protobuf,
protobufV3,
pki,
remote,
Expand Down Expand Up @@ -116,7 +115,6 @@ lazy val root = Project(id = "pekko", base = file("."))
UnidocRoot.autoImport.unidocRootIgnoreProjects := Seq(
remoteTests,
benchJmh,
protobuf,
protobufV3,
pekkoScalaNightly,
docs,
Expand Down Expand Up @@ -362,14 +360,6 @@ lazy val persistenceTypedTests = pekkoModule("persistence-typed-tests")
.disablePlugins(MimaPlugin)
.enablePlugins(NoPublish)

lazy val protobuf = pekkoModule("protobuf")
.settings(OSGi.protobuf)
.settings(AutomaticModuleName.settings("pekko.protobuf"))
.settings(AddMetaInfLicenseFiles.protobufSettings)
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.disablePlugins(MimaPlugin)
.settings(autoScalaLibrary := false) // Pure java project

lazy val protobufV3 = pekkoModule("protobuf-v3")
.settings(OSGi.protobufV3)
.settings(AutomaticModuleName.settings("pekko.protobuf.v3"))
Expand Down Expand Up @@ -413,7 +403,6 @@ lazy val remote =
actor,
stream,
pki,
protobuf % "test",
actorTests % "test->test",
testkit % "test->test",
streamTestkit % "test",
Expand Down
207 changes: 0 additions & 207 deletions legal/pekko-protobuf-jar-license.txt

This file was deleted.

13 changes: 0 additions & 13 deletions project/AddMetaInfLicenseFiles.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,6 @@ object AddMetaInfLicenseFiles extends AutoPlugin {
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-remote-jar-license.txt",
apacheSonatypeNoticeFile := baseDir.value / "legal" / "pekko-remote-jar-notice.txt")

/**
* Settings specific for Pekko protobuf subproject which requires a different license file
* as well as an additional "COPYING.protobuf" file.
*/
lazy val protobufSettings = Seq(
apacheSonatypeLicenseFile := baseDir.value / "legal" / "pekko-protobuf-jar-license.txt") ++ inConfig(Compile)(Seq(
resourceGenerators += {
Def.task {
List(
ApacheSonatypePlugin.addFileToMetaInf(resourceManaged.value, baseDir.value / "COPYING.protobuf"))
}
}))

/**
* Settings specific for Pekko protobuf-v3 subproject which requires a different license file
* as well as an additional "COPYING.protobuf" file.
Expand Down
2 changes: 0 additions & 2 deletions project/OSGi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ object OSGi {

val osgi = exports(Seq("org.apache.pekko.osgi.*"))

val protobuf = exports(Seq("org.apache.pekko.protobuf.*"))

val protobufV3 = osgiSettings ++ Seq(
OsgiKeys.importPackage := Seq(
"!sun.misc",
Expand Down
2 changes: 0 additions & 2 deletions project/PekkoDisciplinePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ object PekkoDisciplinePlugin extends AutoPlugin {
"pekko-actor-typed-tests",
// references to deprecated PARSER fields in generated message formats?
"pekko-cluster-typed",
// use of deprecated org.apache.pekko.protobuf.GeneratedMessage
"pekko-protobuf",
"pekko-protobuf-v3",
// references to deprecated PARSER fields in generated message formats?
"pekko-remote",
Expand Down
Loading

0 comments on commit 964dcf5

Please sign in to comment.